php-8.0.30-src/ext/standard/tests/general_functions/bug47857.phpt

28 lines
563 B
PHP

--TEST--
Bug #47851 (is_callable throws fatal error)
--FILE--
<?php
class foo {
function bar() {
echo "ok\n";
}
}
var_dump(is_callable(array('foo','bar')));
try {
foo::bar();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
var_dump(is_callable(array('Exception','getMessage')));
try {
Exception::getMessage();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(false)
Non-static method foo::bar() cannot be called statically
bool(false)
Non-static method Exception::getMessage() cannot be called statically