3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f(string $str): void { if ($a = explode("-", $str)) { echo "reached if: ", var_dump($a), "\n"; } else { echo "unreached else\n"; } } f(""); f("a"); f("a-b-c");

preferences:
10.17 ms | 408 KiB | 5 Q