3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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);
based on TgYul
Output for 5.5.0 - 7.3.0rc4
array ( 0 => 2, 1 => 12, 2 => '13 ', )array ( 0 => 2, 1 => 12, 2 => '13 ', )