GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Skip non-existing properties returned by __sleep() by nicolas-grekas · Pull Request #5413 · php/php-src

Conversation

@nicolas-grekas

@nicolas-grekas nicolas-grekas commented Apr 18, 2020

Copy link
Copy Markdown
Contributor

Serializing a null for properties that don't exist makes no sense.
Better skip them.

I think this old behavior was due to a pure side effect of the implementation, which has been fixed in 90fea67 and can now be fixed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adamwojs reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@TysonAndre

TysonAndre commented Apr 19, 2020

Copy link
Copy Markdown
Contributor

This seems like an improvement, and would be consistent with the other PR being worked on to omit uninitialized&unset declared typed properties from __sleep.

If there was a need in an application to serialize a literal null, then __serialize is available in 7.4 as an alternative - I'd assume most application writers that had notices enabled would fix the notices.

It should be noted in UPGRADING afterwards if this gets merged, though.

Would like to hear what @nikic and others think

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nikic

nikic commented Apr 19, 2020

Copy link
Copy Markdown
Member

I agree that this change makes sense. I think it would be safer to land it in master only though, assuming there is no particular urgency to make the change.

TysonAndre reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicolas-grekas
nicolas-grekas changed the base branch from PHP-7.4 to master April 19, 2020 09:48
@nicolas-grekas
Skip non-existing properties returned by __sleep()
149a9dc
@nicolas-grekas
nicolas-grekas force-pushed the sleep-skip branch from 88ec8b9 to 149a9dc Compare April 19, 2020 09:50
@nicolas-grekas

nicolas-grekas commented Apr 19, 2020

Copy link
Copy Markdown
Contributor Author

Works for me, now rebased on master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nikic
nikic approved these changes Apr 20, 2020
View reviewed changes
@cmb69

cmb69 commented Apr 22, 2020

Copy link
Copy Markdown
Member

Thanks! Applied as 657f756.

nicolas-grekas reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cmb69 cmb69 closed this Apr 22, 2020
@nicolas-grekas
nicolas-grekas deleted the sleep-skip branch April 22, 2020 14:53
@TysonAndre TysonAndre mentioned this pull request Apr 24, 2020
Skip uninitialized/unset typed properties returned from __sleep() in php 8.0+ igbinary/igbinary#273
Open
@carusogabriel carusogabriel added this to the PHP 8.0 milestone May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@nikic nikic nikic approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

PHP 8.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@nicolas-grekas @TysonAndre @nikic @cmb69 @carusogabriel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.