|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-03-01 09:00 UTC] a at phpe dot net
Description:
------------
see the code below
the first block code's output i think will be: NULL & FALSE
As i think:
the code:
$a["a"]["b"];
will equal to
array('a'=>array("b"));
may be i wrong? or that's a bug??
Reproduce code:
---------------
<?php
# First block
$a[] = "abc";
print_r($a);
// may be wrong here
echo $a[0][2]; // output: c, may be "null"?
echo isset($a[0][2]); // output: 1 (true), may be "false"?
######################
# Second block
$a["1"] = "123";
$a["1"]["2"] = 'abc';
print_r($a);
echo $a[1]; // output:12a, may will be "123"($a["1"]) ??
?>
Expected result:
----------------
Array
(
[0] => abc
)
Array
(
[0] => Array
(
[2] => abc
)
[1] => 123
)
12a
Actual result:
--------------
Array
(
[0] => abc
)
c1
Array
(
[0] => abc
[1] => 12a
)
12a
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 06:00:01 2025 UTC |
Expected result is: ---------------- Array ( [0] => abc ) Array ( [0] => Array ( [2] => abc ) [1] => 123 ) 123