|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-17 09:14 UTC] rquadling@php.net
[2009-11-17 10:00 UTC] sjoerd-php at linuxonly dot nl
[2009-11-17 10:04 UTC] rquadling@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 09:00:02 2026 UTC |
Description: ------------ The documentation on get_class() does not specify what happens when the parameter is omitted. I assumed the parameter defaults to $this, but this is not the case. Note that this may also be a bug in the implementation instead of the documentation. Reproduce code: --------------- <?php class A { function a() { echo get_class(); echo get_class($this); } } class B extends A { } $b = new B(); $b->a(); ?> Actual result: -------------- get_class() in A will return A, where get_class($this) will return B.