3v4l.org

run code in 300+ PHP versions simultaneously
<?php for ($i = 4; $i <= 6; print $i ++): $i=4; $j=30; $k=0; $k=$j++/$i++; echo $i . ' ' . $j . ' ' . $k . ' ' ."\r\n"; $aa = 10; echo 'Value of a = $a'."\r\n"; $a = array( 1=> 'one', 2 => 'two', 3 => 'three'); unset( $a[2] ); print_r($a[2]); print_r($a[3]); $great = 'fantastic'; echo "This is {$great}"; $var1="a"; $$var1="b"; echo "$var1 $a"; class Insurance{ function clsNAme(){ echo get_class($this); } } print 5+2 * 4+6; $cl = new Insurance(); $cl->clsName(); Insurance::clsName(); var_dump (3*4); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); $var = "testing module"; $statement = 'This is a $var'; echo ($statement); $var = "testing module"; $statement = "This is a $var"; echo ($statement); $arr = array("foo","bar","baz"); for ( $i = 0; $i < count($arr); $i++){ $item = $arr[$i]; } echo "<pre>"; print_r($item); echo "</pre><br/>\r\n"; $a = 3; print '$a'."\r\n"; echo '$a'."\r\n"; print "$a\r\n"; echo "$a\r\n"; $array = array(array(141,151,161), 2, 3, array(101, 202, 303)); function DisplayArray($array) { foreach ($array as $value) { if (is_array($value)) { DisplayArray($value); } else { echo $value . " "; } } } DisplayArray($array); echo 0x10; ?>

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)
7.0.20.0300.07020.01
7.0.10.0070.07720.18
7.0.00.0070.05720.09
5.6.170.0330.07720.48
5.6.160.0030.05020.55
5.6.150.0000.07318.24
5.6.140.0100.05718.25
5.6.130.0000.06318.15
5.6.120.0100.08021.02
5.6.110.0070.08021.04
5.6.100.0230.06021.01
5.6.90.0070.05721.00
5.6.80.0130.07320.54
5.5.310.0270.07020.23
5.5.300.0100.08017.96
5.5.290.0100.08017.96
5.5.280.0070.08720.90
5.5.270.0100.05020.75
5.5.260.0100.06020.89
5.5.250.0000.07720.48
5.5.240.0130.06720.28

preferences:
147.84 ms | 1394 KiB | 7 Q