3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test($n) { if ($n === 'bar') { throw new RuntimeException('WTF this ^ warning if I\'m catching the exception?'); } return $n; } try { array_map('test', ['foo', 'bar', 'bar']); } catch(RuntimeException $e) { echo $e->getMessage(); }
based on oTMNV
Output for 7.0.0 - 7.3.1
WTF this ^ warning if I'm catching the exception?
Output for 5.4.2 - 5.6.28
Warning: array_map(): An error occurred while invoking the map callback in /in/gfjg8 on line 11 WTF this ^ warning if I'm catching the exception?
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/gfjg8 on line 11
Process exited with code 255.