3v4l.org

run code in 300+ PHP versions simultaneously
<?php class lol { function one() { return array_map(function ($elem) { return $this->parse($elem); }, array('one', 'two', 'three')); } function parse($elem) { return strtoupper($elem) } } $lol = new lol; var_dump($lol->one());
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected '}', expecting ';' in /in/s8CFd on line 12
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected '}' in /in/s8CFd on line 12
Process exited with code 255.

preferences:
164.01 ms | 1395 KiB | 25 Q