21 lines
399 B
PHP
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
|