3v4l.org

run code in 300+ PHP versions simultaneously
<?php $v1 = 5; $v2 = '5-4'; echo (strcmp($v1,$v2) === 0 ? 'they are the same' : 'they aren\'t the same'); $time = microtime(1); $i = 0; while($i++ < 50000) donull((strcmp($v1,$v2) === 0)); echo (microtime(1)-$time)." seconds for strcmp"; echo "\n"; $time = microtime(1); $i = 0; while($i++ < 50000) donull(((string) $v1 == (string) $v2)); echo (microtime(1)-$time)." seconds for typecasting"; function donull($v){};

preferences:
33.87 ms | 402 KiB | 5 Q