Bug #10057 Updated: Multidimensional arrays passed to function using func_get_args

From: Date: Sun, 29 Apr 2001 15:51:38 +0000
Subject: Bug #10057 Updated: Multidimensional arrays passed to function using func_get_args
Groups: php.dev 
Request: Send a blank email to php-dev+get-52938@lists.php.net to get a copy of this message
ID: 10057 Updated by: jmoore Reported By: dave.kingdon@ukonline.co.uk Old-Status: Feedback Status: Open Bug Type: Unknown/Other Function PHP Version: 4.0.2 Assigned To: Comments: this should be open not feedback Previous Comments: --------------------------------------------------------------------------- [2001-03-29 11:02:08] cnewbill@php.net Here's my quickie test. <?php function test() { var_dump(func_get_arg(0)); } $mya = array( array(1,2,3), array(3,4,5) ); test("$mya"); test($mya); ?> string(5) "Array" array(2) { [0]=> array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } [1]=> array(3) { [0]=> int(3) [1]=> int(4) [2]=> int(5) } } As you can see it works just fine(> 4.0.2), you just can't put quotes around it (it isnt a string after all), which you may be doing. -Chris --------------------------------------------------------------------------- [2001-03-29 10:50:43] cynic@php.net please include a shortest possible self-contained script that reproduces the behavior --------------------------------------------------------------------------- [2001-03-29 10:38:51] dave.kingdon@ukonline.co.uk When passing an array to a function declared without arguments, the contents of the array are replaced with 'Array'. It appears somewhere PHP is assigning the argument to itself literally, which isn't nice :) thanks, Dave System Linux arthur 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown Configure Command './configure' '--with-sybase-ct' '--with-apache=/usr/local/src/packages/apache_1.3.12' '--enable-track-vars' '--with-config-path-file=/etc' '--with-pgsql' '--with-mysql=/usr/local/mysql' --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=10057&edit=2

« previous php.dev (#52938) next »