|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-24 12:32 UTC] jani@php.net
[2007-12-03 14:16 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Feb 05 08:00:02 2026 UTC |
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.