1--TEST-- 2Dynamic static call to instance method should throw. 3--CREDITS-- 4Aaron Piotrowski <aaron@icicle.io> 5--FILE-- 6<?php 7class TestClass 8{ 9 private $test; 10 11 public function method() 12 { 13 $this->test = 'test'; 14 return "Hello, world!\n"; 15 } 16} 17 18$callback = 'TestClass::method'; 19echo $callback(); 20?> 21--EXPECTF-- 22Deprecated: Non-static method TestClass::method() should not be called statically in %s on line %d 23 24Fatal error: Uncaught Error: Using $this when not in object context in %s:%d 25Stack trace: 26#0 %s(%d): TestClass::method() 27#1 {main} 28 thrown in %s on line %d 29