2015-06-30 11:07:29 +08:00
|
|
|
--TEST--
|
|
|
|
Dynamic static call to instance method should throw.
|
|
|
|
--CREDITS--
|
|
|
|
Aaron Piotrowski <aaron@icicle.io>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
class TestClass
|
|
|
|
{
|
|
|
|
private $test;
|
|
|
|
|
|
|
|
public function method()
|
|
|
|
{
|
|
|
|
$this->test = 'test';
|
|
|
|
return "Hello, world!\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$callback = 'TestClass::method';
|
|
|
|
echo $callback();
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2019-01-29 23:03:24 +08:00
|
|
|
Fatal error: Uncaught Error: Non-static method TestClass::method() cannot be called statically in %s:%d
|
2015-06-30 11:07:29 +08:00
|
|
|
Stack trace:
|
2019-01-29 23:03:24 +08:00
|
|
|
#0 {main}
|
2015-06-30 11:07:29 +08:00
|
|
|
thrown in %s on line %d
|