note 93246 deleted from migration5.incompatible by danbrown
| From: | danbrown@php.net | Date: | Sun, 30 Aug 2009 18:49:10 +0000 |
| Subject: | note 93246 deleted from migration5.incompatible by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160053@lists.php.net to get a copy of this message | ||
Note Submitter: Abhijit
----
This is response to Steven's post. Yes, it's true that PHP returns objects via object
handles ( or object identifiers ) but.
class A
{
function A
{
echo "In";
}
}
$a &= new A(); is wrong.
Here the interpreter tries to bitwise AND the contents of $a ( which is NULL ) with the object
identifier returned by new A().
That's why possibly you got a notice.
Please note that either way
$a =& new A() OR $a = new A() returns an object identifier, and it will not raise a notice.
Cheers ,
Abhijit