3v4l.org

run code in 300+ PHP versions simultaneously
<?php assert('12' > '2'); // Numeric comparison assert('2' > '13 '); // String comparison assert('13 ' > '12'); // String comparison assert('12' > '2' && '2' > '13 ' && '13 ' > '12'); assert(12 > 2); assert(2 > '13 '); assert('13 ' > 12); $a = [12, 2, '13 ']; sort($a); var_export($a); sort($a); var_export($a);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught AssertionError: assert('2' > '13 ') in /in/TgYul:3 Stack trace: #0 /in/TgYul(3): assert(false, 'assert('2' > '1...') #1 {main} thrown in /in/TgYul on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: assert(): assert(2 > '13 ') failed in /in/TgYul on line 7 array ( 0 => 2, 1 => 12, 2 => '13 ', )array ( 0 => 2, 1 => 12, 2 => '13 ', )
Output for 5.5.0 - 5.5.37, 5.6.0 - 5.6.28
Warning: assert(): Assertion failed in /in/TgYul on line 7 array ( 0 => 2, 1 => 12, 2 => '13 ', )array ( 0 => 2, 1 => 12, 2 => '13 ', )

preferences:
174.84 ms | 402 KiB | 221 Q