|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-07-15 12:57 UTC] zeev@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 04:00:01 2025 UTC |
the use of the parent keyword when the inherited class is in a different file from the parent class produces an error: (just by writing both classes on a single file avoids the problem) Fatal error: No parent class available in this context in file_of_inherited_class.php example: file: a.php -------------- class a { function f() { echo "a::f()" ; } } file: b.php --------------- class b extends a { function f() { echo parent::f() ; // <---- error when compiling echo "b::f()" ; } } $obj = new b() ; $obj->f();