Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $a =& new Book('test1');
- $b = $a;
- debug_zval_dump($b);
- $c =& new Book('test2');
- $d = &$c;
- debug_zval_dump($d);
- /*
- Output:
- Deprecated: Assigning the return value of new by reference is deprecated in /var/www/y/y.php on line 35
- Deprecated: Assigning the return value of new by reference is deprecated in /var/www/y/y.php on line 39
- object(Book)#1 (1) refcount(2){ <--- !!!
- ["title":protected]=>
- string(5) "test1" refcount(1)
- }
- object(Book)#1 (1) refcount(1){ <--- !!!
- ["title":protected]=>
- string(5) "test1" refcount(1)
- }
Advertisement
Add Comment
Please, Sign In to add comment