3v4l.org

run code in 500+ PHP versions simultaneously
<?php function test($c) { try { if ($c) { return 0; } else { return 1; } } finally { try { // NOOP } finally { // NOOP } } } var_dump(test(true), test(false));

Abusive script

This script was stopped while abusing our resources

Output for 5.5.0 - 5.5.15
Output for 5.5.16 - 5.5.38, 5.6.0 - 5.6.40
int(1) int(1)
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.11
int(0) int(1)
Output for 7.0.0 - 7.0.33
NULL NULL

preferences:
27.97 ms | 1146 KiB | 13 Q