Fixed Bug #61025 __invoke() visibility not honored#298
Fixed Bug #61025 __invoke() visibility not honored#298reeze wants to merge 3 commits intophp:PHP-5.5from
Conversation
- check visibility of __invoke when calling - make is_callable consist - Add the ZEND_ACC_CLOSURE flag to the closure created with: zend_create_closure()
Related to bug #61025 Consist with similar magic methods which will raise warning when modified with improper modifiers
There was a problem hiding this comment.
Don’t we miss a return 0 here?
There was a problem hiding this comment.
Hmm, I only see four conditions, they are closure function and other three possible ZEND_ACC_PPP* flags.
or else it's common function, but that wouldn't happen when get the function with get_closure
|
I don't think this need to be fixed in this way, like __call: <?php
class Bar {
private function __call($name, $value) {
return __CLASS__;
}
}
$b = new Bar;
$b->__call("name", NULL);works well, but with an warning: I am not sure whether this is a bug, or just need document. |
|
This patch is inconsistent with what actually exist. I think it's better to stay consistent and add the checks in the zend_compile.c cases. |
|
Comment on behalf of laruence at php.net: wrong fix, closed |
See bug https://bugs.php.net/bug.php?id=61025
This patch make __invoke() visibility consist with other magic methods.