php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10057 Multidimensional arrays passed to function using func_get_args
Submitted: 2001-03-29 10:38 UTC Modified: 2001-06-14 16:51 UTC
From: dave dot kingdon at ukonline dot co dot uk Assigned:
Status: Closed Package: Variables related
PHP Version: 4.0.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dave dot kingdon at ukonline dot co dot uk
New email:
PHP Version: OS:

 

 [2001-03-29 10:38 UTC] dave dot kingdon at ukonline dot co dot 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' 




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-29 10:50 UTC] cynic@php.net
please include a shortest possible self-contained script that reproduces the behavior
 [2001-03-29 11:02 UTC] 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-04-29 11:51 UTC] jmoore@php.net
this should be open not feedback
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 19:01:37 2025 UTC