1--TEST-- 2method_exists() on internal classes 3--FILE-- 4<?php 5echo " ---(Internal classes, using string class name)---\n"; 6echo "Does exception::getmessage exist? "; 7var_dump(method_exists("exception", "getmessage")); 8echo "Does stdclass::nonexistent exist? "; 9var_dump(method_exists("stdclass", "nonexistent")); 10 11echo "\n ---(Internal classes, using class instance)---\n"; 12echo "Does exception::getmessage exist? "; 13var_dump(method_exists(new exception, "getmessage")); 14echo "Does stdclass::nonexistent exist? "; 15var_dump(method_exists(new stdclass, "nonexistent")); 16 17echo "Done"; 18?> 19--EXPECT-- 20 ---(Internal classes, using string class name)--- 21Does exception::getmessage exist? bool(true) 22Does stdclass::nonexistent exist? bool(false) 23 24 ---(Internal classes, using class instance)--- 25Does exception::getmessage exist? bool(true) 26Does stdclass::nonexistent exist? bool(false) 27Done 28