3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL|E_STRICT); function do_test(): int { try { 1/0; // a warning in php 7 - reported as documented nonexistent_function(); // a fatal error - not reported - program continues 1%0; // a fatal error return 0; } catch (Throwable $t) { printf("CATCH\n"); return 1; } finally { printf("FINALLY\n"); return 2; } return 3; } printf("%d\n", do_test());

preferences:
58.8 ms | 402 KiB | 5 Q