3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myErrorHandler ($errno, $errstr, $errfile, $errline) { switch ($errno) { case FATAL: echo "<b>FATAL</b> [$errno] $errstr<br>\n"; echo " Fatal error in line ".$errline." of file ".$errfile; break; case ERROR: echo "<b>ERROR</b> [$errno] $errstr<br>\n"; break; case WARNING: echo "<b>WARNING</b> [$errno] $errstr<br>\n"; break; default: echo "Unkown error type: [$errno] $errstr<br>\n"; break; } } // funzione di prova del gestore di errore function scale_by_log ($vect, $scale) { if ( !is_numeric($scale) || $scale <= 0 ) trigger_error("log(x) for x <= 0 is undefined, you used: scale = $scale", FATAL); if (!is_array($vect)) { trigger_error("Incorrect input vector, array of values expected", ERROR); return null; } for ($i=0; $i<count($vect); $i++) { if (!is_numeric($vect[$i])) trigger_error("Value at position $i is not a number, using 0 (zero)", WARNING); $temp[$i] = log($scale) * $vect[$i]; } return $temp; } // attiva alcuni errori, definendo prima un array misto con elementi non numerici echo "vector a\n"; $a = array(2,3,"foo",5.5,43.3,21.11); print_r($a); // genera il secondo array, generando un avviso echo "----\nvector b - a warning (b = log(PI) * a)\n"; $b = scale_by_log($a, M_PI); print_r($b); // questo è il problema, passiamo una stringa al posto di un array echo "----\nvector c - an error\n"; $c = scale_by_log("not array",2.3); var_dump($c); // errore critico, il log di zero o di un numero negativo non è definito echo "----\nvector d - fatal error\n"; $d = scale_by_log($a, -2.5); ?>

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)
8.3.70.0100.00718.80
8.3.60.0150.00716.88
8.3.50.0110.00816.75
8.3.40.0070.00719.09
8.3.30.0070.00718.72
8.3.20.0040.01418.97
8.3.10.0040.00419.04
8.3.00.0000.00819.63
8.2.180.0120.00618.54
8.2.170.0040.01119.34
8.2.160.0030.01319.02
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.91
8.2.110.0050.00522.50
8.2.100.0120.00018.03
8.2.90.0040.00418.13
8.2.80.0000.00819.11
8.2.70.0040.00418.30
8.2.60.0090.00518.07
8.2.50.0040.00418.10
8.2.40.0090.00021.34
8.2.30.0040.00419.53
8.2.20.0050.00418.00
8.2.10.0080.00018.00
8.2.00.0000.00918.08
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0030.00621.02
8.1.230.0080.00318.02
8.1.220.0040.00417.78
8.1.210.0030.00518.77
8.1.200.0000.01017.60
8.1.190.0060.00317.48
8.1.180.0050.00318.10
8.1.170.0030.00618.84
8.1.160.0030.00519.12
8.1.150.0000.00719.06
8.1.140.0030.00717.68
8.1.130.0040.00419.43
8.1.120.0040.00417.62
8.1.110.0000.00817.64
8.1.100.0040.00417.70
8.1.90.0000.00717.57
8.1.80.0070.00017.57
8.1.70.0070.00017.63
8.1.60.0040.00417.75
8.1.50.0040.00417.58
8.1.40.0000.00817.73
8.1.30.0030.00617.70
8.1.20.0070.00317.74
8.1.10.0040.00417.80
8.1.00.0040.00417.69
8.0.300.0080.00019.18
8.0.290.0040.00416.88
8.0.280.0000.00718.58
8.0.270.0070.00017.56
8.0.260.0000.00817.10
8.0.250.0000.01017.25
8.0.240.0080.00017.12
8.0.230.0000.00817.19
8.0.220.0040.00317.07
8.0.210.0050.00517.13
8.0.200.0040.00817.16
8.0.190.0070.00017.20
8.0.180.0040.00417.17
8.0.170.0000.00817.08
8.0.160.0040.00417.00
8.0.150.0000.00717.11
8.0.140.0040.00417.13
8.0.130.0000.00513.63
8.0.120.0030.00617.13
8.0.110.0040.00417.05
8.0.100.0070.00017.15
8.0.90.0070.00017.07
8.0.80.0000.01417.06
8.0.70.0040.00417.00
8.0.60.0030.00617.00
8.0.50.0030.00617.20
8.0.30.0120.00617.22
8.0.20.0070.01217.05
8.0.10.0040.00417.11
8.0.00.0140.00617.01
7.4.330.0040.00413.21
7.4.320.0040.00416.75
7.4.300.0020.00516.75
7.4.290.0090.00216.81
7.4.280.0090.00016.66
7.4.270.0000.00816.91
7.4.260.0050.00013.50
7.4.250.0000.00816.82
7.4.240.0050.00316.77
7.4.230.0040.00416.70
7.4.220.0110.00716.75
7.4.210.0190.00316.78
7.4.200.0040.00416.50
7.4.190.0040.00416.88
7.4.160.0080.00816.48
7.4.150.0120.01216.55
7.4.140.0070.01117.86
7.4.130.0110.01716.70
7.4.120.0140.00316.86
7.4.110.0070.01116.63
7.4.100.0070.01016.68
7.4.90.0100.01016.65
7.4.80.0030.01319.39
7.4.70.0100.01016.63
7.4.60.0100.00616.66
7.4.50.0040.00416.56
7.4.40.0080.01316.66
7.4.30.0030.01416.63
7.4.10.0140.00916.12
7.4.00.0060.01215.85
7.3.330.0060.00013.63
7.3.320.0000.00613.42
7.3.310.0070.00016.78
7.3.300.0000.00716.70
7.3.290.0050.01216.56
7.3.280.0070.01316.49
7.3.270.0170.00016.74
7.3.260.0150.00416.70
7.3.240.0140.00716.56
7.3.230.0100.00616.73
7.3.210.0090.00916.58
7.3.200.0030.01316.82
7.3.190.0100.00616.41
7.3.180.0130.01016.60
7.3.170.0120.00616.43
7.3.160.0090.00616.55
7.3.130.0120.01115.87
7.3.120.0120.01015.74
7.3.110.0110.01415.88
7.3.100.0150.00315.79
7.3.90.0160.01015.94
7.3.80.0100.01016.07
7.3.70.0160.00615.89
7.3.60.0060.01015.95
7.3.50.0100.00815.81
7.3.40.0160.00815.93
7.3.30.0140.00815.75
7.3.20.0120.00616.79
7.3.10.0090.00916.79
7.3.00.0100.00816.79
7.2.330.0090.00916.74
7.2.320.0130.01016.93
7.2.310.0130.00516.96
7.2.300.0090.01216.88
7.2.290.0040.01717.08
7.2.260.0110.01216.14
7.2.250.0110.01315.83
7.2.240.0130.01016.04
7.2.230.0080.01115.91
7.2.220.0080.01216.31
7.2.210.0050.01515.97
7.2.200.0100.01016.13
7.2.190.0130.01116.01
7.2.180.0090.01116.03
7.2.170.0060.01616.12
7.2.160.0120.00616.04
7.2.150.0110.01217.11
7.2.140.0130.00817.00
7.2.130.0070.01216.99
7.2.120.0150.00516.94
7.2.110.0170.00517.08
7.2.100.0100.01217.02
7.2.90.0100.01017.05
7.2.80.0170.00617.16
7.2.70.0100.01117.04
7.2.60.0450.00916.44
7.2.50.0110.01316.93
7.2.40.0210.00517.05
7.2.30.0090.00916.98
7.2.20.0150.00816.96
7.2.10.0100.01116.93
7.2.00.0100.00417.76
7.1.330.0140.00816.16
7.1.320.0110.01115.82
7.1.310.0110.00916.04
7.1.300.0100.00615.94
7.1.290.0140.00815.97
7.1.280.0130.00816.02
7.1.270.0160.00515.98
7.1.260.0070.01315.88
7.1.250.0040.01315.70
7.1.240.0110.01015.76
7.1.230.0140.00516.00
7.1.220.0150.00515.79
7.1.210.0070.00915.99
7.1.200.0140.00815.85
7.1.190.0150.00615.92
7.1.180.0060.01015.98
7.1.170.0150.00715.66
7.1.160.0130.00815.78
7.1.150.0110.01015.80
7.1.140.0100.00916.00
7.1.130.0190.00316.04
7.1.120.0140.00615.79
7.1.110.0120.01115.94
7.1.100.0100.00616.69
7.1.90.0110.01116.00
7.1.80.0090.01115.90
7.1.70.0100.00916.45
7.1.60.0110.01016.94
7.1.50.0090.01216.30
7.1.40.0020.01516.04
7.1.30.0120.00715.97
7.1.20.0120.01216.05
7.1.10.0140.00715.97
7.1.00.0060.02018.22
7.0.330.0070.01115.38
7.0.320.0090.00815.61
7.0.310.0080.01215.61
7.0.300.0090.00815.49
7.0.290.0120.00815.66
7.0.280.0050.01415.46
7.0.270.0100.00715.49
7.0.260.0110.00715.59
7.0.250.0120.00815.47
7.0.240.0060.00915.43
7.0.230.0090.01315.59
7.0.220.0070.01215.52
7.0.210.0100.00915.54
7.0.200.0100.00515.95
7.0.190.0110.00915.49
7.0.180.0140.00415.41
7.0.170.0090.01515.55
7.0.160.0070.01115.45
7.0.150.0110.01015.62
7.0.140.0090.03017.84
7.0.130.0050.01315.63
7.0.120.0070.03417.77
7.0.110.0090.00715.56
7.0.100.0090.00815.58
7.0.90.0130.01015.69
7.0.80.0120.01015.45
7.0.70.0070.01515.55
7.0.60.0100.03417.20
7.0.50.0170.01516.51
7.0.40.0120.03315.63
7.0.30.0110.01915.71
7.0.20.0120.03215.78
7.0.10.0100.03215.81
7.0.00.0090.03315.79
5.6.400.0070.01415.41
5.6.390.0110.01215.59
5.6.380.0120.01015.40
5.6.370.0100.01115.39
5.6.360.0090.01015.50
5.6.350.0110.01215.66
5.6.340.0130.00715.52
5.6.330.0100.01415.42
5.6.320.0100.01115.63
5.6.310.0120.01015.56
5.6.300.0140.00815.35
5.6.290.0150.00915.32
5.6.280.0070.03317.54
5.6.270.0140.00815.65
5.6.260.0080.01315.57
5.6.250.0090.01015.16
5.6.240.0100.01015.54
5.6.230.0110.00915.39
5.6.220.0120.01115.42
5.6.210.0080.02017.42
5.6.200.0090.03316.48
5.6.190.0100.02016.63
5.6.180.0110.03116.56
5.6.170.0140.01516.52
5.6.160.0090.02116.51
5.6.150.0120.03216.35
5.6.140.0100.03116.52
5.6.130.0060.03816.44
5.6.120.0100.02516.46
5.6.110.0090.03016.43
5.6.100.0160.02916.63
5.6.90.0120.02316.41
5.6.80.0090.01816.16
5.6.70.0100.03116.32
5.6.60.0070.01816.26
5.6.50.0080.02116.34
5.6.40.0130.01916.32
5.6.30.0100.02716.28
5.6.20.0120.01816.25
5.6.10.0150.01316.28
5.6.00.0100.03316.23
5.5.380.0120.01015.58
5.5.370.0100.01315.38
5.5.360.0140.01015.42
5.5.350.0160.03017.16
5.5.340.0110.02616.41
5.5.330.0080.03116.50
5.5.320.0100.02616.43
5.5.310.0070.03416.46
5.5.300.0070.02316.47
5.5.290.0100.03316.49
5.5.280.0120.02816.44
5.5.270.0140.02116.41
5.5.260.0070.03316.42
5.5.250.0070.02116.19
5.5.240.0090.01816.18
5.5.230.0100.03016.22
5.5.220.0080.02116.02
5.5.210.0110.02616.18
5.5.200.0090.02316.14
5.5.190.0060.02616.08
5.5.180.0070.01816.23
5.5.170.0120.01015.53
5.5.160.0070.03216.19
5.5.150.0090.02216.18
5.5.140.0080.02416.04
5.5.130.0090.02116.15
5.5.120.0080.02315.99
5.5.110.0060.03516.28
5.5.100.0110.03316.09
5.5.90.0110.02916.19
5.5.80.0050.03115.97
5.5.70.0060.03616.13
5.5.60.0090.02515.96
5.5.50.0080.03216.00
5.5.40.0110.01916.03
5.5.30.0080.03215.95
5.5.20.0130.03216.12
5.5.10.0090.03415.94
5.5.00.0080.03615.96
5.4.450.0050.02415.36
5.4.440.0080.03115.33
5.4.430.0060.02215.25
5.4.420.0030.03315.25
5.4.410.0100.02015.33
5.4.400.0090.01815.17
5.4.390.0100.02615.22
5.4.380.0090.02115.06
5.4.370.0080.01715.27
5.4.360.0100.03015.20
5.4.350.0070.02015.16
5.4.340.0100.02115.29
5.4.330.0100.00413.02
5.4.320.0080.02915.26
5.4.310.0090.02015.13
5.4.300.0070.01815.21
5.4.290.0090.01415.13
5.4.280.0050.02515.16
5.4.270.0080.02815.23
5.4.260.0110.02615.19
5.4.250.0110.02315.15
5.4.240.0090.03115.04
5.4.230.0080.02915.23
5.4.220.0080.03215.15
5.4.210.0070.03215.15
5.4.200.0060.02115.26
5.4.190.0090.03115.27
5.4.180.0080.02615.17
5.4.170.0080.02715.17
5.4.160.0070.02915.11
5.4.150.0100.02815.21
5.4.140.0090.02914.30
5.4.130.0120.02514.28
5.4.120.0070.02214.30
5.4.110.0120.02714.37
5.4.100.0110.02614.31
5.4.90.0100.02814.35
5.4.80.0110.03014.33
5.4.70.0090.01714.39
5.4.60.0120.02714.28
5.4.50.0070.02914.38
5.4.40.0070.02914.29
5.4.30.0050.03414.27
5.4.20.0060.03014.23
5.4.10.0100.02914.27
5.4.00.0100.02614.11
5.3.290.0100.02713.88
5.3.280.0090.02013.78
5.3.270.0080.02713.85
5.3.260.0070.03213.87
5.3.250.0050.03213.88
5.3.240.0050.03313.76
5.3.230.0080.03013.81
5.3.220.0110.02713.81
5.3.210.0070.03113.77
5.3.200.0080.02113.88
5.3.190.0060.02413.81
5.3.180.0070.03313.85
5.3.170.0070.02113.87
5.3.160.0090.02413.82
5.3.150.0080.02013.88
5.3.140.0120.02713.88
5.3.130.0100.02813.90
5.3.120.0060.03313.82
5.3.110.0070.03513.82
5.3.100.0100.02713.71
5.3.90.0040.02613.64
5.3.80.0030.02613.56
5.3.70.0100.02113.66
5.3.60.0070.02813.65
5.3.50.0050.01813.63
5.3.40.0100.02513.58
5.3.30.0060.02213.64
5.3.20.0080.02813.50
5.3.10.0070.03013.49
5.3.00.0080.02113.37
5.2.170.0030.06311.47
5.2.160.0030.05311.43
5.2.150.0030.05311.57
5.2.140.0030.05311.58
5.2.130.0000.04711.47
5.2.120.0070.06311.52
5.2.110.0000.05311.45
5.2.100.0030.06311.45
5.2.90.0070.05011.53
5.2.80.0000.04311.61
5.2.70.0000.03311.61
5.2.60.0000.07011.49
5.2.50.0070.05711.38
5.2.40.0000.04311.32
5.2.30.0100.02711.41
5.2.20.0030.04311.27
5.2.10.0070.06311.30
5.2.00.0070.05311.08
5.1.60.0000.04310.54
5.1.50.0070.05010.33
5.1.40.0030.04710.42
5.1.30.0030.05010.61
5.1.20.0030.05710.81
5.1.10.0030.05710.40
5.1.00.0100.04010.46
5.0.50.0000.0509.01
5.0.40.0000.0308.80
5.0.30.0070.0608.67
5.0.20.0030.0278.54
5.0.10.0030.0478.64
5.0.00.0030.0638.59
4.4.90.0030.0307.89
4.4.80.0000.0377.89
4.4.70.0030.0237.89
4.4.60.0000.0307.89
4.4.50.0070.0137.89
4.4.40.0000.0307.89
4.4.30.0070.0377.89
4.4.20.0000.0337.89
4.4.10.0000.0407.89
4.4.00.0100.0477.89
4.3.110.0000.0177.89
4.3.100.0030.0377.89
4.3.90.0000.0377.89
4.3.80.0000.0377.89
4.3.70.0070.0277.89
4.3.60.0030.0337.89
4.3.50.0000.0377.89
4.3.40.0170.0377.89
4.3.30.0030.0307.89
4.3.20.0000.0407.89
4.3.10.0000.0277.89
4.3.00.0030.0337.89

preferences:
47.44 ms | 401 KiB | 5 Q