php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37389 Impossible to declare a 2 dimensions Array
Submitted: 2006-05-09 21:47 UTC Modified: 2006-05-10 07:03 UTC
From: fourmi at lfi dot fr Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.4 OS: Linux Fedora core4
Private report: No CVE-ID: None
 [2006-05-09 21:47 UTC] fourmi at lfi dot fr
Description:
------------
settype ( $tablo , "array array")    ? not good
$tablo = array( array() )              ? not good

Why need to declare a 2 dim Array ?
Because :

$tablo[1][1] = "truc";
..
$tablo[2][1] = "machin";
$tablo[2][2] = "chose";
...

array_shift ($tablo[2])  run but give :
 "  PHP Warning:  array_shift()  The argument should be an array in ..."
But $tablo[2] is 1 dim array  !

The only workaround is to declare at the begining :
$tablo[0] = array() !!!

( $tablo = array();  is not enought )

Expected result:
----------------
No warning


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-10 07:03 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 22:01:35 2025 UTC