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