3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('first', 'second', 'third'); function $pop = function () use ($data) { list($key, $value) = each($data); var_dump($key, $value); }; $pop(); $pop(); $pop(); echo "Length of data is " . count($data);
Output for 5.4.0 - 5.4.23
Parse error: syntax error, unexpected '$pop' (T_VARIABLE), expecting identifier (T_STRING) or '(' in /in/jVgsJ on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING or '(' in /in/jVgsJ on line 5
Process exited with code 255.

preferences:
200.2 ms | 1399 KiB | 60 Q