|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-06-19 20:44 UTC] peehaa@php.net
-Status: Open
+Status: Not a bug
[2017-06-19 20:44 UTC] peehaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
Description: ------------ This is more a doubt that a bug, when I don't pass any param to the function get_class() or pass a variable that it value is NULL the function return the current Class where the script run's, is this behavior correct ? I ask because some time when I try to debug something and use the function get_class() I will pass some var and sometimes this var is NULL, turning my debug a bit confuse because any other scalar value that I pass this will throw an exception saying that the param is not an object. Sorry for any noob question and thanks for any feedback. Test script: --------------- <?php class Foo { public function bar() { echo get_class(); } } $foo = new Foo; $foo->bar();// Foo Expected result: ---------------- Throw exception saying that the param is not a object instance. Actual result: -------------- Return the name of the current class