I had the bright idea of using a custom error handler which led me down a rabbit hole.
Following code gives (with and without custom error handler): Fatal er
It's a memory corruption issue (according to PHP dev team). Just throw in an assignment:
function foo(){
$b = array_pop($arr = array("a","b","c"));
return $b;
}
print_r(foo());
:
function foo(){
$a = explode( '/' , 'a/b/c');
$c = array_pop($arr = array_slice($a,-2,1));
return $c;
}
print_r(foo());
The second produces an E_STRICT. You can handle that differently in your error handler if you wish (if you don't want to change those functions).