note 107408 deleted from language.types.object by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 May 2012 21:17:52 +0000 |
| Subject: | note 107408 deleted from language.types.object by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187871@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
arnold stated that "Casting scalars to objects can give unexpected results"; not if you
use the "scalar" member variable (as below in $bar->scalar):
<?php
$foo = "something";
$bar = (object)$foo;
var_dump($foo == $bar->scalar); // Outputs "bool(true)"
?>