3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = true ? 2 > 1 ? 1 < 2 ? 2 : 2 : 1 : 3; echo $foo;
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.30, 7.4.0 - 7.4.23, 8.0.0 - 8.0.11, 8.1rc1 - rc2
2

preferences:
56.85 ms | 459 KiB | 5 Q