Date: 06/17/02
- Next message: hholzgra <email protected>: "[PHP-DOC] Bug #15915 Updated: the sample code have some wrong on Creating Extensions"
- Previous message: hholzgra <email protected>: "[PHP-DOC] Bug #14591 Updated: uasort mixes array with equal elements"
- Next in thread: hholzgra <email protected>: "[PHP-DOC] Bug #14791 Updated: Array_shift always the problem ..."
- Maybe reply: hholzgra <email protected>: "[PHP-DOC] Bug #14791 Updated: Array_shift always the problem ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 14791
Updated by: hholzgra <email protected>
Reported By: philippe <email protected>
Status: Open
-Bug Type: Arrays related
+Bug Type: Documentation problem
Operating System: Linux 2.4.9
PHP Version: 4.1.1
New Comment:
array_shift() and unshift() renumber numerical indices
so it's not a but but a feature
-> reclassified as Doc problem
Previous Comments:
------------------------------------------------------------------------
[2002-01-01 13:23:23] philippe <email protected>
Scuse me, a little error by my hands ... ;(
normally i should have :
before : Array ( [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6
)
next : Array ( [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 )
Regards,
Philippe BEAU
Email / Philippe--at--beau.nom.Fr
------------------------------------------------------------------------
[2002-01-01 13:20:40] philippe <email protected>
This script :
<?
print "before : ";
for ($i=1;$i<=6;$i++) {
$toto[$i] = $i;
}
print_r($toto);
print "<br>\n";
array_shift($toto);
print "next : ";
print_r($toto);
print "<br>\n";
?>
give this :
before : Array ( [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6
)
next : Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 )
normally i should have :
before : Array ( [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6
)
next : Array ( [1] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 )
Regards,
Philippe BEAU
Email / Philippe--at--beau.nom.Fr
------------------------------------------------------------------------
-- Edit this bug report at http://bugs.php.net/?id=14791&edit=1
- Next message: hholzgra <email protected>: "[PHP-DOC] Bug #15915 Updated: the sample code have some wrong on Creating Extensions"
- Previous message: hholzgra <email protected>: "[PHP-DOC] Bug #14591 Updated: uasort mixes array with equal elements"
- Next in thread: hholzgra <email protected>: "[PHP-DOC] Bug #14791 Updated: Array_shift always the problem ..."
- Maybe reply: hholzgra <email protected>: "[PHP-DOC] Bug #14791 Updated: Array_shift always the problem ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

