Skip to content

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #46881
License MIT
Doc PR -

Comment on lines -358 to 360
$handler = set_error_handler('var_dump');
$handler = set_error_handler('is_int');
$handler = \is_array($handler) ? $handler[0] : null;
restore_error_handler();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ever is_int was called, it would throw an ArgumentCountError, so a few questions:

  • Is that actually a good thing?
  • Are there reasons for not passing null here? or e.g. function () {}?
  • Would it be safer to move up the restore_{error|exception}_handler(); immediately after the set_{error|exception}_handler call, with no operation in-between?
  • Should add get_error_handler() and get_exception_handler() php/php-src#969 be revived?

Copy link
Member Author

@nicolas-grekas nicolas-grekas Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should php/php-src#969 be revived?

Maybe. For your other questions, they're mostly theoretical at the moment so I wouldn't care much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants