|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-10-30 20:07 UTC] colder@php.net
[2007-11-01 21:10 UTC] colder@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 05:00:01 2025 UTC |
Description: ------------ 'self' and 'parent' don't are evaluated when calling static member/method with class name in variables. Reproduce code: --------------- <?php class foo { const foo = 1; public function __construct() { $classname = 'parent'; echo $classname::FOO; // Fatal error: Class 'parent' not found $classname = 'self'; echo $classname::FOO; // Fatal error: Class 'self' not found // new $classname; too } } new foo; Actual result: -------------- Fatal error: Class 'parent' not found and Fatal error: Class 'self' not found