3v4l.org

run code in 300+ PHP versions simultaneously
<?php $h='my home is my castle'; $n='is'; $part = stristr($h,$n,true); $part2 = stristr($h,$n); if (version_compare(PHP_VERSION, '5.0.0', '>=')) { if($pos=stripos($h,$n)) $part3=substr($h,0,$pos); }else echo 'I am using PHP 4, my version: ' . PHP_VERSION . "\n"; } $h=strtolower($h); $n=strtolower($n); if($pos=strpos($h,$n)) $part4=substr($h,0,$pos); echo "This is my: $part\n"; echo "That is my: $part2\n"; echo "Also, this: $part3\n"; echo "This too: $part4\n"; ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.40.0180.04211.96
5.4.30.0210.04211.96
5.4.20.0170.04511.96
5.4.10.0220.04111.96
5.4.00.0210.04011.46
5.3.140.0250.05312.66
5.3.130.0140.04912.66
5.3.120.0180.04412.66
5.3.110.0190.04512.66
5.3.100.0220.04512.12
5.3.90.0170.04312.08
5.3.80.0150.04912.07
5.3.70.0160.04612.08
5.3.60.0230.05612.06
5.3.50.0150.04812.00
5.3.40.0120.04912.00
5.3.30.0180.04211.95
5.3.20.0190.04311.73
5.3.10.0190.04411.69
5.3.00.0200.04011.67

preferences:
135.28 ms | 1394 KiB | 7 Q