From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      4CVS-2002-10-27
PHP Bug Type:     Scripting Engine problem
Bug description:  Calling functions through variables produces seg fault

If I try to call a function from a class and the name of the function is
inside a variable php seg faults.
It works fine with php 4.2.3 and if the function isn't inside a class.
Some pear script which use this don't produce a crash but give errors
about an undefined function with a numeric name. (e.g. Fatal error: Call
to undefined function:  138421340() in /usr/lib/php/PEAR.php on line 512)

Example:
<?php
class bugtest {
        function bug() {
                echo "test\n";
        }
}

$test = new bugtest();
$test1 = "bug";
$test->$test1();
?>

Backtrace:

#0  execute (op_array=0x83b64bc) at
/home/pcgod/php4/Zend/zend_execute.c:1496
1496                                            tmp = *function_name;
(gdb) bt
#0  execute (op_array=0x83b64bc) at
/home/pcgod/php4/Zend/zend_execute.c:1496
#1  0x0822380b in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /home/pcgod/php4/Zend/zend.c:839
#2  0x081f26f4 in php_execute_script (primary_file=0x5ffff8f0) at
/home/pcgod/php4/main/main.c:1542
#3  0x0823aa24 in main (argc=2, argv=0x5ffff994) at
/home/pcgod/php4/sapi/cli/php_cli.c:695
#4  0x265dc1eb in __libc_start_main () from /lib/libc.so.6

-- 
Edit bug report at http://bugs.php.net/?id=20120&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20120&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20120&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20120&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20120&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20120&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20120&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20120&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20120&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20120&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20120&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20120&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20120&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20120&r=isapi

Reply via email to