|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-18 13:19 UTC] andrey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 UTC |
First part of code is the same in every way: class Foo {} $o = new Foo(); Now there is: if (get_class($o) == "foo") { // ok } else { // not ok } I can create walkaround: function typeof(&$obj, $classname) { return (get_class($obj) == strtolower(trim($classname))); } if (typeof($o, "Foo"))) { // ok } else { // not ok } You should make it easier, by new `typeof' operator: if ($o typeof Foo) { // ok } else { // not ok } like in JavaScript.