cvs: php-src /tests/lang bug27395.phpt

From: Date: Wed, 25 Feb 2004 18:54:15 +0000
Subject: cvs: php-src /tests/lang bug27395.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-26397@lists.php.net to get a copy of this message
sniper Wed Feb 25 13:54:15 2004 EDT Added files: /php-src/tests/lang bug27395.phpt Log: Test for bug #27395 http://cvs.php.net/co.php/php-src/tests/lang/bug27395.phpt?r=1.1&p=1 Index: php-src/tests/lang/bug27395.phpt +++ php-src/tests/lang/bug27395.phpt --TEST-- Bug #27395 (reference to an array index makes the array to be passed by reference always) --FILE-- <?php function theFunction($arg) { $arg[0] = 2; } // Reference on array index $arr1 = array (1); $reference1 =& $arr1[0]; var_dump($reference1); var_dump($arr1); theFunction($arr1); var_dump($reference1); var_dump($arr1); echo "--------\n"; // Reference on array $arr2 = array (1); $reference2 =& $arr2; var_dump($reference2); var_dump($arr2); theFunction($arr2); var_dump($reference2); var_dump($arr2); ?> --EXPECT-- int(1) array(1) { [0]=> &int(1) } int(1) array(1) { [0]=> &int(1) } -------- array(1) { [0]=> int(1) } array(1) { [0]=> int(1) } array(1) { [0]=> int(1) } array(1) { [0]=> int(1) }

« previous php.cvs (#26397) next »