3v4l.org

run code in 300+ PHP versions simultaneously
<?php function random($car) { $string = ""; $chaine = "abcdefghijklmnpqrstuvwxy"; srand((double)microtime()*1000000); for($i=0; $i<$car; $i++) { $string .= $chaine[rand()%strlen($chaine)]; } return $string; } $nombreDeTentative = 0; while(random(4) != "samu") { $nombreDeTentative++; } echo "Le nombre de tentative pour trouver samu est de ".$nombreDeTentative; ?>

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.2.00.0100.42019.44
7.1.70.0000.40016.91
7.1.60.0100.68019.70
7.1.50.0100.42316.99
7.0.200.0031.81216.92
5.4.440.0100.17319.48
5.4.430.0271.91319.54
5.4.420.0330.07319.41
5.4.410.0230.91719.39
5.4.400.0201.91019.15
5.4.380.0270.21719.03
5.4.370.0171.92319.06
5.4.360.0300.91719.17
5.4.350.0170.92319.07
5.4.340.0201.04718.87
5.4.320.0300.90019.06
5.4.310.0201.74719.13
5.4.300.0132.09019.22
5.4.290.0631.87719.09
5.4.280.0432.45718.93
5.4.270.0571.34019.21
5.4.260.0500.89018.86
5.4.250.0801.69719.31
5.4.240.0601.05019.14
5.4.230.0501.88018.99
5.4.220.0570.88319.31
5.4.210.0400.90018.98
5.4.200.0232.47318.81
5.4.190.0031.33719.15
5.4.180.0071.76719.16
5.4.170.0000.10318.96
5.4.160.0001.76019.13
5.4.150.2002.29718.90
5.4.140.2672.23016.32
5.4.130.2331.64016.36
5.4.120.0101.09316.56
5.4.110.0072.49016.56
5.4.100.1370.10016.50
5.4.90.2402.25716.44
5.4.80.2630.31016.57
5.4.70.2802.21716.50
5.4.60.0002.49716.40
5.4.50.0071.69716.53
5.4.40.0030.91316.36
5.4.30.1430.79716.19
5.4.20.2970.64316.16
5.4.10.2800.59316.55
5.4.00.2271.71315.75
5.3.290.0000.93314.77
5.3.280.0032.09714.54
5.3.270.0071.93714.68
5.3.260.0000.94014.57
5.3.250.2401.69714.72
5.3.240.2732.22314.36
5.3.230.2630.97314.75
5.3.220.3070.63314.46
5.3.210.2671.83714.58
5.3.200.0002.49714.40
5.3.190.1101.13714.64
5.3.180.2601.84314.57
5.3.170.2630.49714.46
5.3.160.2431.86014.47
5.3.150.2932.20714.48
5.3.140.0001.38714.46
5.3.130.0030.77314.52
5.3.120.0931.01314.77
5.3.110.2531.67314.46
5.3.100.2301.54014.05
5.3.90.2600.61314.13
5.3.80.2701.66314.04
5.3.70.2500.64714.16
5.3.60.2600.68014.09
5.3.50.2500.69013.86
5.3.40.2300.71314.18
5.3.30.2871.65013.81
5.3.20.2900.81713.61
5.3.10.2201.55313.59
5.3.00.2530.66713.71

preferences:
38.07 ms | 400 KiB | 5 Q