3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tries = 0; try { a: $tries++; throw new \Exception(sprintf('Tried %d time(s)', $tries)); } catch(\Exception $exception) { echo $exception->getMessage() . "\n"; if($tries > 4) { goto b; } goto a; } b: echo 'Finished\n';
based on ubOuA
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Tried 1 time(s) Tried 2 time(s) Tried 3 time(s) Tried 4 time(s) Tried 5 time(s) Finished\n