|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesfix-crash-but-not-underlying-problem (last revision 2011-05-24 20:20 UTC by crrodriguez at opensuse dot org)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-25 03:53 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: dmitry
[2011-05-31 11:20 UTC] dmitry@php.net
[2011-05-31 11:21 UTC] dmitry@php.net
-Status: Assigned
+Status: Closed
[2011-05-31 11:21 UTC] dmitry@php.net
[2011-05-31 13:37 UTC] dmitry@php.net
[2012-04-18 09:50 UTC] laruence@php.net
[2012-07-24 23:41 UTC] rasmus@php.net
[2013-11-17 09:38 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ Firstly the function is_callable(array('B', 'noSuchMethod')) returns true even such static method does not exist. This could be caused by class A having magic method __call (which shouldn't accept static methods though). Still because of this the code fails with segmentation fault. Test script: --------------- class A { public function __call($method, $args) { if (stripos($method, 'get') === 0) { return $this->get(); } throw new BadMethodCallException("No such method"); } protected function get() { $class = get_class($this); $call = array($class, 'noSuchMethod'); if (is_callable($call)) { call_user_func($call); } } } class B extends A {} $input = new B(); echo $input->getEmail(); Expected result: ---------------- Script should end with no output. Actual result: -------------- Segmentation fault.