3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A; $version = '10.'; if (str_starts_with($version, '10.')) { class Comparator { public static function test() { echo "a"; } } } else { class Comparator { public static function test() { echo "b"; } } } Comparator::test();
Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.24, 8.3.0 - 8.3.12
a

preferences:
57.96 ms | 406 KiB | 5 Q