<?php
set_error_handler(function($no, $str, $file, $line) {
throw new ErrorException($str, 0, $no, $file, $line);
});
set_exception_handler(function(\Exception $e) {
echo "Halp! I cant rite teh codez: " . $e->getMessage() . "\n" . $e->getTraceAsString();
});
eval('class A { public function foo() {} } class B extends A { public function foo($bar) {} }');
Halp! I cant rite teh codez: Declaration of B::foo($bar) should be compatible with A::foo()
#0 /in/toaMF(11): {closure}(2, 'Declaration of ...', '/in/toaMF(11) :...', 1, Array)
#1 /in/toaMF(11): eval()
#2 {main}
Halp! I cant rite teh codez: Declaration of B::foo() should be compatible with A::foo()
#0 /in/toaMF(11): {closure}(2048, 'Declaration of ...', '/in/toaMF(11) :...', 1, Array)
#1 /in/toaMF(11): eval()
#2 {main}
Output for 5.3.0 - 5.3.29
Halp! I cant rite teh codez: Declaration of B::foo() should be compatible with that of A::foo()
#0 /in/toaMF(11): {closure}(2048, 'Declaration of ...', '/in/toaMF(11) :...', 1, Array)
#1 /in/toaMF(11): eval()
#2 {main}