Req #60573 [Com]: type hinting with "self" keyword causes weird errors

From: Date: Tue, 17 Sep 2013 07:19:33 +0000
Subject: Req #60573 [Com]: type hinting with "self" keyword causes weird errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-181617@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60573&edit=1 ID: 60573 Comment by: andries at centim dot be Reported by: jpauli@php.net Summary: type hinting with "self" keyword causes weird errors Status: Closed Type: Feature/Change Request Package: Scripting Engine problem Operating System: *nix PHP Version: 5.3.8 Assigned To: laruence Block user comment: N Private report: N New Comment: This patch seems to cause strange behaviour for interfaces. If the "self" keyword is defined in an interface, I would think that "self" would refer to the implementing class. Test script which worked in 5.3.19: <?php interface Comparable { function compare(self $compare); } // Which is then implemented: class Foo implements Comparable { function compare(self $compare) {} } class Bar implements Comparable { function compare(self $compare) {} } $foo = new Foo(); $bar = new Bar(); $foo->compare($foo); $bar->compare($bar); Previous Comments: ------------------------------------------------------------------------ [2012-07-24 23:37:43] rasmus@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=d74a258f240e3d1dcb14ec086ba6fe48a4864dad Log: Fixed Bug #60573 (type hinting with &quot;self&quot; keyword causes weird errors) ------------------------------------------------------------------------ [2012-07-24 23:37:02] rasmus@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=0b7f94545e95813b3d6392d92deead5b8bd022b8 Log: MFH: Fixed bug #60573 (type hinting with &quot;self&quot; keyword causes weird errors) ------------------------------------------------------------------------ [2012-04-18 09:46:34] laruence@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=d74a258f240e3d1dcb14ec086ba6fe48a4864dad Log: Fixed Bug #60573 (type hinting with &quot;self&quot; keyword causes weird errors) ------------------------------------------------------------------------ [2012-04-18 09:45:50] laruence@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=0b7f94545e95813b3d6392d92deead5b8bd022b8 Log: MFH: Fixed bug #60573 (type hinting with &quot;self&quot; keyword causes weird errors) ------------------------------------------------------------------------ [2012-03-02 03:32:33] laruence@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=60573 -- Edit this bug report at https://bugs.php.net/bug.php?id=60573&edit=1

« previous php.bugs (#181617) next »