|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-19 00:32 UTC] tony2001@php.net
[2005-12-19 14:29 UTC] t dot isler at bbn dot de
[2005-12-19 14:49 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 14:00:01 2025 UTC |
Description: ------------ I don't know wether you want to consider the following a bug, but as far as my understanding of oop is concerned, the behavior of php 4.4 and 5.1 is "unusual" when comes to constructors with a return by reference. Reproduce code: --------------- <?php class firstObject { function & __construct() {} } class secondObject { function & __construct() {return $this;} } $firstObject =& new firstObject(); $secondObject =& new secondObject(); ?> Expected result: ---------------- The first constructor should pass without a problem, the second should throw an error. Actual result: -------------- The first constructor throws a notice, the second passes without any problem.