note 94416 added to language.oop5.basic
| From: | r dot wilczek at web-appz dot de | Date: | Tue, 03 Nov 2009 18:16:49 +0000 |
| Subject: | note 94416 added to language.oop5.basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-162371@lists.php.net to get a copy of this message | ||
Wierd about the 'new'-operator is, that you can use it with not only with the name of a
concrete class, but with an instance also!
<?php
$x = new stdClass();
$y = new $x;
?>
This is the same as
<?php
$x = new stdClass();
$y = new stdClass();
?>
Not sure, if this is a bug ... but for sure it's a wierdo ...
(tested with PHP 5.3.0)
----
Server IP: 212.124.37.9
Probable Submitter: 87.79.200.243
----
Manual Page -- http://www.php.net/manual/en/language.oop5.basic.php
Edit -- https://master.php.net/note/edit/94416
Del: integrated -- https://master.php.net/note/delete/94416/integrated
Del: useless -- https://master.php.net/note/delete/94416/useless
Del: bad code -- https://master.php.net/note/delete/94416/bad+code
Del: spam -- https://master.php.net/note/delete/94416/spam
Del: non-english -- https://master.php.net/note/delete/94416/non-english
Del: in docs -- https://master.php.net/note/delete/94416/in+docs
Del: other reasons-- https://master.php.net/note/delete/94416
Reject -- https://master.php.net/note/reject/94416
Search -- https://master.php.net/manage/user-notes.php