#43332 [Asn->Csd]: self and parent as type hint in namespace

From: Date: Mon, 03 Dec 2007 14:16:55 +0000
Subject: #43332 [Asn->Csd]: self and parent as type hint in namespace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120315@lists.php.net to get a copy of this message
ID: 43332 Updated by: dmitry@php.net Reported By: felipensp at gmail dot com -Status: Assigned +Status: Closed Bug Type: Scripting Engine problem PHP Version: 5.3CVS-2007-11-19 (snap) Assigned To: dmitry New Comment: This bug has been fixed in CVS. 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/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2007-11-24 12:32:37] jani@php.net Another namespace issue. ------------------------------------------------------------------------ [2007-11-19 11:40:02] felipensp at gmail dot com Description: ------------ self and parent as type hint in namespace must be prefixed with '::', but not is possible to use them as class name. So, i'm guessing that shouldn't be necessary the prefix. Reproduce code: --------------- <?php namespace foobar; class foo { // no namespace //public function baz(self $a) { } // with namespace public function baz(::self $a) { } } $foo = new foo; $foo->baz($foo); // Ok! //$foo->baz(new stdclass); // Error, ok! Expected result: ---------------- Don't be necessary prefix in self/parent. Actual result: -------------- They must be prefixed. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43332&edit=1

« previous php.bugs (#120315) next »