note 68275 added to function.array-merge

From: Date: Thu, 20 Jul 2006 13:02:38 +0000
Subject: note 68275 added to function.array-merge
Groups: php.notes 
Request: Send a blank email to php-notes+get-114975@lists.php.net to get a copy of this message
I don't think that the comment on + operator for array in array_merge page, was understandable, this is just a little test to know exactly what's happend. <?php //test code for (array)+(array) operator $a1 = array( '10', '11' , '12' , 'a' => '1a', 'b' => '1b'); $a2 = array( '20', '21' , '22' , 'a' => '2a', 'c' => '2c'); $a = $a1 + $a2; print_r( $a ); //result: Array ( [0] => 10 // [1] => 11 // [2] => 12 // [a] => 1a // [b] => 1b // [c] => 2c ) $a = $a2 + $a1; print_r( $a ); //result: Array ( [0] => 20 // [1] => 21 // [2] => 22 // [a] => 2a // [c] => 2c // [b] => 1b ) ?> ---- Server IP: 195.26.5.2 Probable Submitter: 80.64.152.37 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.array-merge.php Edit -- http://master.php.net/note/edit/68275 Del: integrated -- http://master.php.net/note/delete/68275/integrated Del: useless -- http://master.php.net/note/delete/68275/useless Del: bad code -- http://master.php.net/note/delete/68275/bad+code Del: spam -- http://master.php.net/note/delete/68275/spam Del: non-english -- http://master.php.net/note/delete/68275/non-english Del: in docs -- http://master.php.net/note/delete/68275/in+docs Del: other reasons-- http://master.php.net/note/delete/68275 Reject -- http://master.php.net/note/reject/68275 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#114975) next »