TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
538 B
31 lines
538 B
--TEST--
|
|
is_callable with array callables and dynamic method names
|
|
--FILE--
|
|
<?php
|
|
|
|
class IsCallableArrayTarget
|
|
{
|
|
public function run(): void
|
|
{
|
|
}
|
|
|
|
public static function stat(): void
|
|
{
|
|
}
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
$object = new IsCallableArrayTarget();
|
|
$method = 'run';
|
|
$static = 'stat';
|
|
|
|
var_dump(is_callable([$object, $method]));
|
|
var_dump(is_callable([IsCallableArrayTarget::class, $static]));
|
|
var_dump(is_callable([$object, 'missing']));
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(true)
|
|
bool(false)
|
|
|