3v4l.org

run code in 300+ PHP versions simultaneously
<?php // ridefinisce la costante dell'errore utente - solo PHP 4 define (FATAL,E_USER_ERROR); define (ERROR,E_USER_WARNING); define (WARNING,E_USER_NOTICE); // configura il livello di restituzione errore per questo script error_reporting (FATAL | ERROR | WARNING); // funzione di gestione dell'errore 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; echo ", PHP ".PHP_VERSION." (".PHP_OS.")<br>\n"; echo "Aborting...<br>\n"; exit(1); 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; } // configura il gestore dell'errore definito dall'utente $old_error_handler = set_error_handler("myErrorHandler"); // 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.60.0000.01516.50
8.3.50.0060.00918.00
8.3.40.0080.00818.71
8.3.30.0070.00719.27
8.3.20.0000.00720.30
8.3.10.0050.00323.67
8.3.00.0040.00420.82
8.2.180.0120.00918.41
8.2.170.0070.00722.96
8.2.160.0070.00720.41
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0070.00020.57
8.2.110.0060.00322.25
8.2.100.0040.00817.91
8.2.90.0040.00419.22
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0080.00019.89
8.2.30.0070.00018.33
8.2.20.0000.00817.81
8.2.10.0040.00418.01
8.2.00.0040.00417.68
8.1.270.0040.00423.88
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.95
8.1.230.0090.00319.01
8.1.220.0090.00017.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0030.00517.13
8.1.180.0050.00518.10
8.1.170.0040.00418.49
8.1.160.0040.00421.90
8.1.150.0040.00418.51
8.1.140.0040.00417.30
8.1.130.0030.00317.78
8.1.120.0050.00217.38
8.1.110.0040.00417.41
8.1.100.0000.00817.31
8.1.90.0000.00717.41
8.1.80.0000.00817.41
8.1.70.0070.00017.37
8.1.60.0000.00817.52
8.1.50.0050.00317.44
8.1.40.0000.00817.48
8.1.30.0030.00517.57
8.1.20.0000.00817.52
8.1.10.0000.00817.45
8.1.00.0080.00017.45
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0080.00018.45
8.0.270.0030.00317.20
8.0.260.0030.00317.17
8.0.250.0000.00716.95
8.0.240.0030.00617.04
8.0.230.0000.00716.94
8.0.220.0050.00517.00
8.0.210.0000.00717.00
8.0.200.0030.00317.04
8.0.190.0000.00716.92
8.0.180.0030.00516.91
8.0.170.0040.00416.97
8.0.160.0040.00417.07
8.0.150.0000.00717.02
8.0.140.0000.00716.95
8.0.130.0000.00513.32
8.0.120.0000.00816.82
8.0.110.0040.00417.04
8.0.100.0030.00617.03
8.0.90.0040.00417.08
8.0.80.0200.00016.88
8.0.70.0000.00716.83
8.0.60.0030.00316.77
8.0.50.0000.00816.81
8.0.30.0050.01417.09
8.0.20.0150.00317.40
8.0.10.0040.00416.80
8.0.00.0050.01216.82
7.4.330.0050.00015.21
7.4.320.0000.00716.76
7.4.300.0000.01016.64
7.4.290.0060.00316.69
7.4.280.0040.00416.80
7.4.270.0000.00716.80
7.4.260.0000.00716.73
7.4.250.0070.00016.82
7.4.240.0030.00316.77
7.4.230.0070.00016.88
7.4.220.0400.01416.53
7.4.210.0070.00816.66
7.4.200.0030.00316.62
7.4.190.0050.00316.96
7.4.160.0120.00616.47
7.4.150.0110.00717.40
7.4.140.0160.00917.86
7.4.130.0110.00816.69
7.4.120.0140.00516.54
7.4.110.0100.00716.69
7.4.100.0110.00716.45
7.4.90.0060.01216.48
7.4.80.0070.01619.39
7.4.70.0120.00816.70
7.4.60.0100.00716.55
7.4.50.0000.00816.89
7.4.40.0110.00816.64
7.4.30.0100.00616.80
7.4.10.0030.01415.16
7.4.00.0100.00715.26
7.3.330.0000.00513.44
7.3.320.0000.00513.64
7.3.310.0040.00416.64
7.3.300.0030.00316.70
7.3.290.0090.00916.60
7.3.280.0040.01316.54
7.3.270.0060.01217.40
7.3.260.0030.01416.53
7.3.250.0110.00716.51
7.3.240.0120.01216.46
7.3.230.0070.01016.46
7.3.210.0060.01916.52
7.3.200.0060.01119.39
7.3.190.0140.00716.76
7.3.180.0070.01016.53
7.3.170.0170.00016.76
7.3.160.0070.01016.64
7.3.130.0100.01015.21
7.3.120.0080.01015.03
7.3.110.0100.01015.41
7.3.100.0120.00315.07
7.3.90.0060.00915.13
7.3.80.0030.00715.14
7.3.70.0030.00715.18
7.3.60.0090.00615.06
7.3.50.0110.00415.16
7.3.40.0000.00915.16
7.3.30.0000.01114.99
7.3.20.0000.01317.02
7.3.10.0030.00616.79
7.3.00.0040.00817.10
7.2.330.0060.01316.66
7.2.320.0060.01316.95
7.2.310.0130.00716.84
7.2.300.0000.01716.98
7.2.290.0070.01016.94
7.2.260.0030.01415.29
7.2.250.0030.01615.68
7.2.240.0070.00715.50
7.2.230.0070.01415.60
7.2.220.0100.01015.58
7.2.210.0070.00715.41
7.2.200.0120.00015.65
7.2.190.0040.01115.29
7.2.180.0070.00715.30
7.2.170.0000.01315.21
7.2.160.0110.00715.39
7.2.150.0100.00617.38
7.2.140.0100.00017.20
7.2.130.0120.00017.13
7.2.120.0060.00916.91
7.2.110.0000.01517.20
7.2.100.0030.01217.05
7.2.90.0030.01317.46
7.2.80.0000.01417.29
7.2.70.0100.00417.04
7.2.60.0080.00817.21
7.2.50.0090.00616.97
7.2.40.0070.01017.16
7.2.30.0110.00717.10
7.2.20.0060.00617.21
7.2.10.0130.00017.18
7.2.00.0030.01018.37
7.1.330.0030.01316.06
7.1.320.0090.00916.01
7.1.310.0090.00616.00
7.1.300.0060.00316.05
7.1.290.0060.00915.85
7.1.280.0100.00015.85
7.1.270.0030.00916.11
7.1.260.0080.00416.27
7.1.250.0000.01316.17
7.1.240.0080.00415.86
7.1.230.0090.00615.88
7.1.220.0030.01015.95
7.1.210.0080.00416.07
7.1.200.0060.01015.96
7.1.190.0030.00816.04
7.1.180.0070.00716.09
7.1.170.0090.00616.00
7.1.160.0030.00616.24
7.1.150.0030.01515.99
7.1.140.0030.00616.05
7.1.130.0030.00915.98
7.1.120.0060.00616.18
7.1.110.0040.00816.42
7.1.100.0050.00717.40
7.1.90.0000.01116.23
7.1.80.0030.00616.07
7.1.70.0100.00316.75
7.1.60.0050.01417.77
7.1.50.0130.00716.34
7.1.40.0030.00616.02
7.1.30.0000.01216.02
7.1.20.0080.00316.06
7.1.10.0070.00715.78
7.1.00.0050.04319.40
7.0.330.0070.00715.73
7.0.320.0030.01215.68
7.0.310.0160.00015.71
7.0.300.0030.01015.89
7.0.290.0000.01815.76
7.0.280.0060.00915.71
7.0.270.0070.00715.46
7.0.260.0000.00815.86
7.0.250.0000.01115.57
7.0.240.0110.00415.93
7.0.230.0000.00815.54
7.0.220.0030.00615.88
7.0.210.0070.00715.77
7.0.200.0030.00516.44
7.0.190.0030.00615.94
7.0.180.0060.00315.79
7.0.170.0030.00615.79
7.0.160.0030.00715.74
7.0.150.0060.00315.70
7.0.140.0020.04219.05
7.0.130.0060.00315.62
7.0.120.0000.01115.82
7.0.110.0030.00915.58
7.0.100.0040.00815.39
7.0.90.0000.00815.62
7.0.80.0030.01015.64
7.0.70.0050.00515.88
7.0.60.0100.03217.89
7.0.50.0130.03718.03
7.0.40.0090.04117.15
7.0.30.0090.03917.30
7.0.20.0160.02817.18
7.0.10.0170.02517.17
7.0.00.0070.03917.08
5.6.400.0030.01014.53
5.6.390.0090.00614.78
5.6.380.0060.00614.65
5.6.370.0060.00315.02
5.6.360.0070.00615.12
5.6.350.0040.01114.43
5.6.340.0060.01214.73
5.6.330.0030.00614.77
5.6.320.0030.00915.05
5.6.310.0030.00914.68
5.6.300.0090.00614.61
5.6.290.0000.01214.86
5.6.280.0050.03817.94
5.6.270.0070.00314.49
5.6.260.0060.00915.01
5.6.250.0090.00314.78
5.6.240.0080.00414.64
5.6.230.0060.00314.79
5.6.220.0070.00714.67
5.6.210.0150.02817.86
5.6.200.0100.03317.99
5.6.190.0080.04918.08
5.6.180.0100.04518.01
5.6.170.0100.03118.09
5.6.160.0070.03717.96
5.6.150.0120.03318.04
5.6.140.0120.03418.03
5.6.130.0030.03717.88
5.6.120.0090.03218.07
5.6.110.0100.03917.98
5.6.100.0130.02917.95
5.6.90.0120.03017.93
5.6.80.0050.03517.75
5.6.70.0080.00614.54
5.6.60.0030.01314.76
5.6.50.0150.00014.70
5.6.40.0060.00314.74
5.6.30.0040.01114.59
5.6.20.0030.00914.62
5.6.10.0060.00914.41
5.6.00.0040.00414.59
5.5.380.0080.00414.52
5.5.370.0030.01214.61
5.5.360.0060.01014.64
5.5.350.0070.03517.58
5.5.340.0080.04517.90
5.5.330.0130.02818.01
5.5.320.0070.03518.12
5.5.310.0140.02717.72
5.5.300.0170.03517.94
5.5.290.0070.03517.90
5.5.280.0120.04417.83
5.5.270.0170.02617.74
5.5.260.0070.04717.93
5.5.250.0050.03717.88
5.5.240.0120.02817.62
5.5.230.0060.00614.61
5.5.220.0030.01314.61
5.5.210.0120.00314.81
5.5.200.0060.00614.76
5.5.190.0000.01714.82
5.5.180.0040.01114.55
5.5.170.0030.00914.22
5.5.160.0050.00514.50
5.5.150.0070.00314.75
5.5.140.0070.00714.66
5.5.130.0000.01414.82
5.5.120.0000.01214.37
5.5.110.0030.00614.71
5.5.100.0000.01514.84
5.5.90.0080.00814.73
5.5.80.0090.00314.69
5.5.70.0090.00014.66
5.5.60.0030.01014.74
5.5.50.0160.00014.64
5.5.40.0000.01514.43
5.5.30.0110.00414.64
5.5.20.0070.00714.52
5.5.10.0040.01114.74
5.5.00.0100.00014.62
5.4.450.0130.02715.32
5.4.440.0080.04315.52
5.4.430.0060.03115.54
5.4.420.0120.03015.58
5.4.410.0130.02215.45
5.4.400.0070.03015.40
5.4.390.0070.03015.45
5.4.380.0050.03215.46
5.4.370.0080.03015.33
5.4.360.0040.03215.22
5.4.350.0050.03315.32
5.4.340.0030.04915.25
5.4.330.0060.00311.54
5.4.320.0080.02715.35
5.4.310.0100.02815.08
5.4.300.0090.02615.17
5.4.290.0060.03415.34
5.4.280.0080.02815.36
5.4.270.0080.03815.05
5.4.260.0100.03715.25
5.4.250.0070.04015.18
5.4.240.0100.03315.15
5.4.230.0080.03015.27
5.4.220.0100.02815.22
5.4.210.0050.04315.40
5.4.200.0070.03215.34
5.4.190.0030.03515.24
5.4.180.0090.03415.38
5.4.170.0080.02815.32
5.4.160.0130.02315.21
5.4.150.0050.04715.31
5.4.140.0100.02513.87
5.4.130.0050.02714.06
5.4.120.0050.04214.02
5.4.110.0130.03114.21
5.4.100.0020.03213.96
5.4.90.0060.03013.99
5.4.80.0100.02314.04
5.4.70.0080.02813.79
5.4.60.0080.02714.08
5.4.50.0020.03113.99
5.4.40.0050.03114.07
5.4.30.0080.02514.03
5.4.20.0080.03014.14
5.4.10.0070.02913.95
5.4.00.0050.02613.66
5.3.290.0050.04012.87
5.3.280.0050.03412.64
5.3.270.0070.03212.86
5.3.260.0120.03512.84
5.3.250.0110.03612.64
5.3.240.0020.03312.75
5.3.230.0070.02912.71
5.3.220.0120.02512.90
5.3.210.0030.03312.77
5.3.200.0070.03012.87
5.3.190.0080.02712.65
5.3.180.0080.02712.64
5.3.170.0080.02712.91
5.3.160.0050.04312.86
5.3.150.0020.03112.89
5.3.140.0080.04012.87
5.3.130.0090.02512.87
5.3.120.0070.02712.81
5.3.110.0050.03012.82
5.3.100.0070.03312.57
5.3.90.0060.03412.59
5.3.80.0070.02712.35
5.3.70.0080.03812.46
5.3.60.0130.02712.54
5.3.50.0080.02712.51
5.3.40.0100.02112.31
5.3.30.0090.03112.55
5.3.20.0050.03312.34
5.3.10.0030.04012.26
5.3.00.0110.02712.21
5.2.170.0100.04711.30
5.2.160.0030.04311.30
5.2.150.0070.04311.31
5.2.140.0200.05011.27
5.2.130.0000.04711.27
5.2.120.0100.03711.22
5.2.110.0030.04311.22
5.2.100.0100.03711.27
5.2.90.0070.05711.20
5.2.80.0070.04311.25
5.2.70.0070.05011.33
5.2.60.0100.05311.22
5.2.50.0070.04311.04
5.2.40.0070.04011.17
5.2.30.0100.03711.14
5.2.20.0130.03311.13
5.2.10.0170.03010.88
5.2.00.0130.03710.96
5.1.60.0070.05310.14
5.1.50.0100.03010.23
5.1.40.0030.0579.96
5.1.30.0030.05710.66
5.1.20.0100.04310.53
5.1.10.0100.03010.34
5.1.00.0070.03310.20
5.0.50.0030.0308.66
5.0.40.0070.0278.64
5.0.30.0070.0408.48
5.0.20.0070.0378.20
5.0.10.0130.0178.42
5.0.00.0000.0438.31
4.4.90.0070.0276.06
4.4.80.0000.0236.00
4.4.70.0070.0275.99
4.4.60.0100.0236.05
4.4.50.0070.0276.00
4.4.40.0030.0376.01
4.4.30.0000.0276.01
4.4.20.0070.0276.14
4.4.10.0130.0136.05
4.4.00.0030.0376.07
4.3.110.0030.0206.01
4.3.100.0030.0276.07
4.3.90.0000.0235.90
4.3.80.0030.0335.91
4.3.70.0000.0236.05
4.3.60.0100.0175.95
4.3.50.0070.0275.95
4.3.40.0000.0405.90
4.3.30.0200.0304.66
4.3.20.0000.0234.71
4.3.10.0030.0204.60
4.3.00.0030.0274.59

preferences:
42.06 ms | 400 KiB | 5 Q