|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-09-14 19:32 UTC] jeroen@php.net
[2002-08-23 21:22 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 08:00:02 2025 UTC |
Consider the following script: <? class test { var $x; var $y; function test () { $this->x = 0; $this->y = 0; } function set ($x, $y) { $this->x = $x; $this->y = $y; } } $mumu = array(); $gaga = array(); for($i=0;$i<3;$i++) { $test = new test (); $test->set($i, $i); $mumu["xx".$i] = $test; } for($i=0;$i<5;$i++) { $test = new test (); $test->set($i, $i); $gaga["xx".$i] = $test; } $fff = array_diff($mumu, $gaga); $ggg = array_diff($gaga, $mumu); echo "<pre>"; print_r($fff); echo "</pre>"; echo "<pre>"; print_r($ggg); echo "</pre>"; ?> the following is the output from a server with php 4.0.4pl1: Array ( ) Array ( [xx3] => test Object ( [x] => 3 [y] => 3 ) [xx4] => test Object ( [x] => 4 [y] => 4 ) ) and the following is the ouput with php 4.0.5: Array ( ) Array ( ) the php.ini is the same on both servers.