php-8.0.30-src/Zend/tests/closures/closure_from_callable_non_s...

21 lines
399 B
PHP

--TEST--
Testing Closure::fromCallable() functionality: Getting non-static method statically
--FILE--
<?php
class A {
public function method() {
}
}
try {
$fn = Closure::fromCallable(['A', 'method']);
$fn();
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Failed to create closure from callable: non-static method A::method() cannot be called statically