note 112639 added to class.mongoid
| From: | Lionel | Date: | Mon, 08 Jul 2013 01:51:39 +0000 |
| Subject: | note 112639 added to class.mongoid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195495@lists.php.net to get a copy of this message | ||
Just to be careful with the strict comparison. Object inequalities holds.
<?php
$m1 = new MongoId('51b14c2de8e185801f000006');
$m2 = new MongoId('51b14c2de8e185801f000006');
var_dump($m1 === $m2); //gives you boolean false
var_dump($m1 == $m2); //gives you boolean true
$m3 = new MongoId('51b14c2de8e185801f000006');
$m4 = new MongoId('51b14c2de8e185801f000007');
var_dump($m3 === $m4); //gives you boolean false
var_dump($m3 == $m4); //gives you boolean false
?>
----
Server IP: 69.147.83.199
Probable Submitter: 220.255.1.22 (proxied: 220.255.31.13)
----
Manual Page -- http://php.net/manual/en/class.mongoid.php
Edit -- https://master.php.net/note/edit/112639
Del: integrated -- https://master.php.net/note/delete/112639/integrated
Del: useless -- https://master.php.net/note/delete/112639/useless
Del: bad code -- https://master.php.net/note/delete/112639/bad+code
Del: spam -- https://master.php.net/note/delete/112639/spam
Del: non-english -- https://master.php.net/note/delete/112639/non-english
Del: in docs -- https://master.php.net/note/delete/112639/in+docs
Del: other reasons-- https://master.php.net/note/delete/112639
Reject -- https://master.php.net/note/reject/112639
Search -- https://master.php.net/manage/user-notes.php