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 — [#79521] Check `__set_state` structure by carusogabriel · Pull Request #5462 · php/php-src

Conversation

@carusogabriel

@carusogabriel carusogabriel commented Apr 26, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Found while working on #4177. This fixes two problems:

  • missing static: doesn't work on PHP 8 as per 6c73b50: https://3v4l.org/KCmJS/rfc#git-php-master
  • missing public: __set_state's functionality doesn't work: https://3v4l.org/l4sS9

Similar to #5441.

Sorry, something went wrong.

Uh oh!

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

All reactions
@carusogabriel carusogabriel mentioned this pull request Apr 26, 2020
Improve error message when the first argument of __state_state isn'… #5463
Closed
@carusogabriel carusogabriel changed the title Ensure declaration of __set_state modifiers Check __set_state structure Apr 26, 2020
@carusogabriel carusogabriel added the Bug label Apr 26, 2020
@carusogabriel carusogabriel changed the title Check __set_state structure [#79521] Check __set_state structure Apr 26, 2020
derickr
derickr reviewed Apr 26, 2020
View reviewed changes
Comment thread ext/date/tests/ExtendDateTime.phpt Resolved

Uh oh!

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

@nikic

nikic commented Apr 27, 2020

Copy link
Copy Markdown
Member

Hm, I'm wondering if we should be checking max arg number on magic methods, e.g. there's https://bugs.php.net/bug.php?id=46225.

Maybe it makes sense to rewrite magic method validation in terms of validation against dummy signatures, which will then follow exact PHP signature validation semantics.

carusogabriel 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.

@carusogabriel

carusogabriel commented Apr 27, 2020

Copy link
Copy Markdown
Contributor Author

@nikic Thanks for sharing that feature request, indeed is something that we could change. I'll remove the check related to arguments and I'll come up with something regarding the dummy signatures validation

All reactions

Sorry, something went wrong.

Uh oh!

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

@carusogabriel
carusogabriel requested a review from nikic April 27, 2020 14:30
nikic
nikic reviewed Apr 27, 2020
View reviewed changes
Comment thread Zend/tests/magic_methods_set_state.phpt Resolved

Uh oh!

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

nikic
nikic approved these changes Apr 27, 2020
View reviewed changes
@carusogabriel
Check __set_state structure
05e3fa0
Fix Bug #79521.
@php-pulls php-pulls closed this in 34c460f Apr 28, 2020
@carusogabriel
carusogabriel deleted the php8/set_state-static branch April 28, 2020 15:02
@carusogabriel carusogabriel added this to the PHP 8.0 milestone May 29, 2020
@ondrejmirtes ondrejmirtes mentioned this pull request Jul 30, 2021
[META] PHP 8 backward incompatible changes detection phpstan/phpstan#5368
Closed
9 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@derickr derickr derickr left review comments
+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

Bug

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.

3 participants

@carusogabriel @nikic @derickr
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.