#35559 [NEW]: Use of global crashes PHP

From: Date: Mon, 05 Dec 2005 16:23:14 +0000
Subject: #35559 [NEW]: Use of global crashes PHP
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89767@lists.php.net to get a copy of this message
From: alexei at nfsrm dot com Operating system: SuSE 9.3 PHP version: 5.1.1 PHP Bug Type: Scripting Engine problem Bug description: Use of global crashes PHP Description: ------------ Trying to access global variables using ${varname} syntax crashes PHP 5.1.x. This worked fine in previous version PHP 4.x and 5.0.x Reproduce code: --------------- $var = '12346789'; $a['b'] = 'var'; function test() { global $a, ${$a['b']}; echo ${$a['b']}; } test(); Expected result: ---------------- 12346789 Actual result: -------------- #0 0x082b79c5 in zend_inline_hash_func (arKey=0x0, nKeyLength=1515870811) at zend_hash.h:252 252 hash = ((hash << 5) + hash) + *arKey++; (gdb) bt #0 0x082b79c5 in zend_inline_hash_func (arKey=0x0, nKeyLength=1515870811) at zend_hash.h:252 #1 0x082b67e7 in zend_hash_find (ht=0x860005c, arKey=0x0, nKeyLength=1515870811, pData=0xbfffc3d0) at /usr/local/src/php-5.1.1/Zend/zend_hash.c:849 #2 0x082e47f8 in zend_fetch_var_address_helper_SPEC_VAR (type=0, execute_data=0xbfffc4d0) at zend_vm_execute.h:6700 #3 0x082e4b2e in ZEND_FETCH_R_SPEC_VAR_HANDLER (execute_data=0xbfffc4d0) at zend_vm_execute.h:6763 #4 0x082d53af in execute (op_array=0x85ff0b0) at zend_vm_execute.h:88 #5 0x082d5837 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfffc630) at zend_vm_execute.h:222 #6 0x082d8448 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0xbfffc630) at zend_vm_execute.h:1578 #7 0x082d53af in execute (op_array=0x85f9494) at zend_vm_execute.h:88 #8 0x082acfd4 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/local/src/php-5.1.1/Zend/zend.c:1090 #9 0x08269796 in php_execute_script (primary_file=0xbfffea70) at /usr/local/src/php-5.1.1/main/main.c:1704 #10 0x0831bcb2 in main (argc=3, argv=0xbfffeb54) at /usr/local/src/php-5.1.1/sapi/cli/php_cli.c:1039 -- Edit bug report at http://bugs.php.net/?id=35559&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35559&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35559&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35559&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35559&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35559&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35559&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35559&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35559&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35559&r=support Expected behavior: http://bugs.php.net/fix.php?id=35559&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35559&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35559&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35559&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35559&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35559&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35559&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35559&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35559&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35559&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35559&r=mysqlcfg

« previous php.bugs (#89767) next »