From: joaner1206 at gmail dot com
Operating system: Linux 2.6
PHP version: ä¸çè¾¹é
Package: Scripting Engine problem
Bug Type: Feature/Change Request
Bug description:Magic __call() not work through inheritance
Description:
------------
When the magic __call() form extends,It can't call the private or protected
function of child class, and worse, it would have been to call its own.
But I watch others magic like __set(), __get(), they will not be affected
for
work in child.
Test script:
---------------
class superTest {
public function __call($func, $param) {
echo "Is __call", PHP_EOL;
$this->$func($param);
}
}
final class test extends superTest {
private function hello($i) {
echo "hello,world - $i[0]", PHP_EOL;
}
/** It will call hello() , only once, everything is fine
public function __call($func, $param) {
echo "Is __call in Child", PHP_EOL;
$this->$func($param);
} */
}
$test = new test();
$test->hello(1);
Expected result:
----------------
Is __call
Hello,world - 1
Actual result:
--------------
Is __call
Is __call
Is __call
Is __call
Is __call
Is __call
Is __call
...
// stack exception
--
Edit bug report at https://bugs.php.net/bug.php?id=64286&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64286&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64286&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64286&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64286&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64286&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64286&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64286&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64286&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64286&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64286&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64286&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64286&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64286&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64286&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64286&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64286&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64286&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64286&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64286&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64286&r=mysqlcfg