From: wb at pro-net dot co dot uk
Operating system: FreeBSD 5.2.1
PHP version: 5.0.3
PHP Bug Type: *General Issues
Bug description: call_user_func_array() with parent causing loop and calls
incorrect method
Description:
------------
When trying to use call_user_func_array() to call a parent method php
calls the current class method and therefore goes into a loop.
Reproduce code:
---------------
<?php
class a {
public function xyz () {
$args = func_get_args();
print("\n\na:\n");
var_export($args);
}
}
class b extends a {
public function xyz () {
$args = func_get_args();
print("\n\nb:\n");
var_export($args);
call_user_func_array(array('parent', 'xyz'), $args);
}
}
$b = new b();
$b->xyz('zero', 'one', 'two', 'three', 'four');
?>
Expected result:
----------------
b:
array (
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
)
a:
array (
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
)
Actual result:
--------------
b:
array (
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
)
b:
array (
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
)
b:
array (
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
)
... [Inf loop]
--
Edit bug report at http://bugs.php.net/?id=32350&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32350&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32350&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32350&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32350&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32350&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32350&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32350&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32350&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32350&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32350&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32350&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32350&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32350&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32350&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32350&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32350&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32350&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32350&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32350&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32350&r=mysqlcfg