thefortrees Posted July 16, 2007 Share Posted July 16, 2007 Hi all - Is there any way to check to see if an object is an instance of a specific class? For example, in Java there is an instanceof operator... if (myObject instanceof classThatCreatesObject) //do cool stuff here Thanks Link to comment https://forums.phpfreaks.com/topic/60273-solved-instance-of-an-object/ Share on other sites More sharing options...
akitchin Posted July 16, 2007 Share Posted July 16, 2007 google's a wonderful thing: http://ca.php.net/is_a note that it's deprecated in favour of the instanceof operator in PHP 5, so take care to use the latter if you're on PHP 5. Link to comment https://forums.phpfreaks.com/topic/60273-solved-instance-of-an-object/#findComment-299786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.