3v4l.org

run code in 300+ PHP versions simultaneously
<?php //We set an error handler to throw an ErrorException whenever an error is triggered set_error_handler(function (int $severity, string $message, string $filename, int $line) { echo "Throwing ErrorException\n"; throw new ErrorException($message, 0, $severity, $filename, $line); }); //We're going to test this error handler passing wrong arguments to array_diff //array_diff compares array items CASTING them to string. Yes, it is retarded. No, it's not the lol here. //http://php.net/manual/en/function.array-diff.php //We declare an object that can't be cast to string $stdObject = new stdClass(); //First case: let's trigger an error try { $hello = (string) $stdObject; }catch(ErrorException $ee){ //Handler is called, exception is thrown and catched here. Yay! echo "Catched exception: " . $ee->getMessage() . "\n"; } echo "\n----------\n"; //Second case: let's trigger an error try { array_diff([], [$stdObject]); }catch(ErrorException $ee){ //Handler is called, exception is thrown and catched here. Yay! echo "Catched exception: " . $ee->getMessage() . "\n"; } echo "\n----------\n"; //Third case: let's trigger a slightly different error try { array_diff([$stdObject], [$stdObject]); }catch(ErrorException $ee){ //Handler is called, exception is thrown but... IT IS NOT CATCHED! echo "Catched exception: " . $ee->getMessage() . "\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)
8.3.60.0120.00618.50
8.3.50.0070.00716.50
8.3.40.0120.00818.98
8.3.30.0090.00618.88
8.3.20.0050.00321.73
8.3.10.0070.00021.98
8.3.00.0080.00019.68
8.2.180.0100.01318.60
8.2.170.0040.01122.96
8.2.160.0170.00321.04
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.00720.52
8.2.120.0040.00426.35
8.2.110.0040.01419.18
8.2.100.0090.00317.84
8.2.90.0040.00418.05
8.2.80.0080.00018.03
8.2.70.0060.00317.93
8.2.60.0040.00418.09
8.2.50.0000.00818.10
8.2.40.0040.00419.47
8.2.30.0040.00419.33
8.2.20.0050.00318.14
8.2.10.0040.00417.98
8.2.00.0000.00718.06
8.1.280.0120.00625.92
8.1.270.0080.00023.71
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0040.00722.55
8.1.230.0120.00020.85
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0090.00317.35
8.1.190.0030.00617.35
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0050.00218.89
8.1.150.0050.00318.71
8.1.140.0030.00320.91
8.1.130.0070.00018.82
8.1.120.0000.00717.38
8.1.110.0070.00017.45
8.1.100.0000.00817.31
8.1.90.0080.00017.39
8.1.80.0080.00017.37
8.1.70.0040.00417.39
8.1.60.0070.00017.42
8.1.50.0020.00517.45
8.1.40.0080.00017.55
8.1.30.0040.00417.58
8.1.20.0040.00417.66
8.1.10.0000.00717.64
8.1.00.0070.00017.46
8.0.300.0030.00319.85
8.0.290.0040.00416.75
8.0.280.0040.00418.46
8.0.270.0000.00817.25
8.0.260.0050.00316.74
8.0.250.0030.00316.91
8.0.240.0000.00916.94
8.0.230.0030.00616.98
8.0.220.0070.00016.91
8.0.210.0050.00316.90
8.0.200.0000.00816.97
8.0.190.0060.00317.00
8.0.180.0040.00417.02
8.0.170.0030.00316.99
8.0.160.0060.00317.00
8.0.150.0070.00016.84
8.0.140.0040.00416.94
8.0.130.0000.00613.36
8.0.120.0000.00816.85
8.0.110.0000.00716.92
8.0.100.0030.00316.84
8.0.90.0000.00717.03
8.0.80.0100.00616.92
8.0.70.0020.00516.83
8.0.60.0040.00416.79
8.0.50.0070.00016.91
8.0.30.0070.01117.05
8.0.20.0110.00817.40
8.0.10.0000.00716.89
8.0.00.0070.01016.97
7.4.330.0050.00015.55
7.4.320.0020.00516.62
7.4.300.0060.00016.61
7.4.290.0030.00916.59
7.4.280.0040.00416.58
7.4.270.0050.00216.44
7.4.260.0030.00313.29
7.4.250.0000.00816.48
7.4.240.0050.00316.44
7.4.230.0000.00716.68
7.4.220.0100.01316.56
7.4.210.0060.00916.54
7.4.200.0040.00416.63
7.4.160.0080.00816.64
7.4.150.0060.01217.40
7.4.140.0140.00517.86
7.4.130.0000.01716.38
7.4.120.0140.01016.51
7.4.110.0130.00316.62
7.4.100.0090.00916.62
7.4.90.0150.00616.55
7.4.80.0030.01319.39
7.4.70.0090.00616.57
7.4.60.0060.00916.52
7.4.50.0080.00816.57
7.4.40.0130.00916.52
7.4.30.0030.01816.37
7.4.00.0090.00615.00
7.3.330.0030.00313.23
7.3.320.0030.00313.23
7.3.310.0030.00616.41
7.3.300.0030.00316.29
7.3.290.0060.01016.39
7.3.280.0090.00916.36
7.3.270.0140.00717.40
7.3.260.0090.01116.41
7.3.250.0100.01116.43
7.3.240.0120.00616.36
7.3.230.0070.01416.55
7.3.210.0080.00816.45
7.3.200.0060.01016.60
7.3.190.0040.01916.57
7.3.180.0100.01016.55
7.3.170.0140.00616.31
7.3.160.0110.00416.28
7.3.10.0070.00416.52
7.3.00.0040.01116.69
7.2.330.0100.00716.82
7.2.320.0150.00916.75
7.2.310.0120.00416.77
7.2.300.0100.00716.71
7.2.290.0090.01216.81
7.2.130.0070.00516.85
7.2.120.0070.00516.89
7.2.110.0040.00516.94
7.2.100.0030.01116.97
7.2.90.0040.00816.84
7.2.80.0060.00517.00
7.2.70.0060.00816.85
7.2.60.0080.00516.84
7.2.50.0030.00616.88
7.2.40.0080.00616.99
7.2.30.0070.00616.91
7.2.20.0060.01016.98
7.2.10.0030.01017.03
7.2.00.0070.00616.83
7.1.250.0050.00815.76
7.1.200.0000.01215.89
7.1.70.0050.00316.95
7.1.60.0670.00733.21
7.1.50.0600.01732.91
7.1.40.0530.01032.36
7.1.30.0730.01332.79
7.1.20.0530.01332.85
7.1.10.0530.00714.80
7.1.00.0470.01014.76
7.0.200.0530.01015.15
7.0.190.0500.00714.85
7.0.180.0370.01714.68
7.0.170.0870.01314.68
7.0.160.0570.00314.66
7.0.150.0430.01014.45
7.0.140.0500.00714.52
7.0.130.0470.01014.83
7.0.120.0400.01014.88
7.0.110.0530.00714.48
7.0.100.0470.01014.51
7.0.90.0400.01314.45
7.0.80.0730.01014.75
7.0.70.0430.01714.46
7.0.60.0400.01314.47
7.0.50.0430.01014.64
7.0.40.0730.01014.68
7.0.30.0370.01314.75
7.0.20.0400.01014.74
7.0.10.0400.01014.53
7.0.00.0400.01014.64
5.6.300.0100.05720.84
5.6.290.0030.06320.83
5.6.280.0100.05720.97
5.6.270.0100.05720.79
5.6.260.0070.06320.84
5.6.250.0170.05320.77
5.6.240.0130.05320.83
5.6.230.0070.06720.94
5.6.220.0070.06320.72
5.6.210.0100.05720.52
5.6.200.0100.05720.73
5.6.190.0200.05720.93
5.6.180.0100.06020.74
5.6.170.0100.05320.72
5.6.160.0070.06020.72
5.6.150.0230.04720.88
5.6.140.0030.06320.82
5.6.130.0070.05720.72
5.6.120.0100.05720.88
5.6.110.0130.05720.75
5.6.100.0100.06020.71
5.6.90.0130.05320.68
5.6.80.0200.06720.37
5.6.70.0170.05020.28
5.6.60.0030.06020.29
5.6.50.0070.05720.37
5.6.40.0170.04720.09
5.6.30.0100.05720.19
5.6.20.0170.05020.24
5.6.10.0130.05320.16
5.6.00.0030.06320.18
5.5.380.0230.04317.59
5.5.370.0100.05017.48
5.5.360.0100.08017.43
5.5.350.0070.05317.39
5.5.340.0100.05318.04
5.5.330.0100.05318.04
5.5.320.0170.04718.13
5.5.310.0170.04717.80
5.5.300.0070.05717.80
5.5.290.0030.06317.94
5.5.280.0030.06318.13
5.5.270.0100.05718.03
5.5.260.0100.05718.03
5.5.250.0100.06017.55
5.5.240.0100.06317.16
5.5.230.0070.05717.44
5.5.220.0100.05017.49
5.5.210.0030.05717.32
5.5.200.0170.04717.38
5.5.190.0070.06017.32
5.5.180.0070.05317.39
5.5.160.0130.05017.30
5.5.150.0030.05717.12
5.5.140.0130.04717.38
5.5.130.0070.05717.49
5.5.120.0070.05317.38
5.5.110.0170.04317.47
5.5.100.0070.05316.96
5.5.90.0070.05017.19
5.5.80.0130.04317.25
5.5.70.0030.06017.37
5.5.60.0000.05717.25
5.5.50.0200.06317.29
5.5.40.0030.08016.99
5.5.30.0030.07017.03
5.5.20.0070.05716.94
5.5.10.0130.05017.28
5.5.00.0070.05317.26
5.4.450.0100.05319.25
5.4.440.0130.05319.34
5.4.430.0100.05319.33
5.4.420.0030.06019.18
5.4.410.0100.06719.21
5.4.400.0070.05719.24
5.4.390.0030.05718.92
5.4.380.0100.05019.01
5.4.370.0130.04719.02
5.4.360.0070.05719.07
5.4.350.0100.05018.83
5.4.340.0000.06319.05
5.4.320.0070.05319.04
5.4.310.0130.04719.00
5.4.300.0130.04719.02
5.4.290.0200.04319.00
5.4.280.0230.04019.15
5.4.270.0130.05018.99
5.4.260.0070.05319.14
5.4.250.0100.05019.04
5.4.240.0100.05718.98
5.4.230.0000.06018.98
5.4.220.0070.05718.91
5.4.210.0230.06019.14
5.4.200.0100.07719.09
5.4.190.0170.04718.82
5.4.180.0070.05318.84
5.4.170.0170.04319.14
5.4.160.0070.05319.12
5.4.150.0170.06319.00
5.4.140.0200.04016.45
5.4.130.0070.05016.53
5.4.120.0070.05016.70
5.4.110.0070.05316.57
5.4.100.0000.05716.69
5.4.90.0070.04716.69
5.4.80.0070.04716.61
5.4.70.0130.04316.55
5.4.60.0070.05316.66
5.4.50.0030.05316.56
5.4.40.0030.05316.45
5.4.30.0070.04716.71
5.4.20.0130.06016.63
5.4.10.0130.04716.55
5.4.00.0070.05015.85
5.3.290.0070.05314.86
5.3.280.0100.05014.59
5.3.270.0070.05714.49
5.3.260.0030.06014.83
5.3.250.0230.04014.78
5.3.240.0100.05014.80
5.3.230.0070.06014.84
5.3.220.0030.05714.83
5.3.210.0030.05714.83
5.3.200.0070.05014.74
5.3.190.0070.05014.85
5.3.180.0130.04314.56
5.3.170.0000.06014.44
5.3.160.0130.04314.83
5.3.150.0030.05314.79
5.3.140.0000.05714.44
5.3.130.0100.05014.54
5.3.120.0200.05714.61
5.3.110.0130.04714.73
5.3.100.0070.05014.09
5.3.90.0100.05014.31
5.3.80.0070.05013.90
5.3.70.0070.05314.30
5.3.60.0070.05014.31
5.3.50.0130.05714.25
5.3.40.0030.05314.10
5.3.30.0030.05013.91
5.3.20.0030.05014.00
5.3.10.0030.05013.84
5.3.00.0000.05713.81
5.2.170.0070.05311.07
5.2.160.0030.04011.38
5.2.150.0100.03311.25
5.2.140.0070.04311.19
5.2.130.0000.04311.21
5.2.120.0030.04011.08
5.2.110.0070.04011.25
5.2.100.0130.03311.08
5.2.90.0070.03711.21
5.2.80.0100.04011.24
5.2.70.0030.04311.23
5.2.60.0100.04711.25
5.2.50.0100.03710.95
5.2.40.0030.04710.81
5.2.30.0030.04311.02
5.2.20.0100.03311.16
5.2.10.0130.03010.91
5.2.00.0030.04010.59
5.1.60.0070.03010.04
5.1.50.0030.03310.30
5.1.40.0030.04310.20
5.1.30.0070.03310.32
5.1.20.0030.04010.55
5.1.10.0030.03710.27
5.1.00.0030.03710.19
5.0.50.0070.0278.66
5.0.40.0070.0238.39
5.0.30.0000.0478.41
5.0.20.0000.0308.47
5.0.10.0030.0278.35
5.0.00.0030.0438.45
4.4.90.0030.0205.86
4.4.80.0030.0205.88
4.4.70.0000.0235.84
4.4.60.0070.0175.88
4.4.50.0030.0205.92
4.4.40.0000.0375.89
4.4.30.0000.0235.91
4.4.20.0000.0235.94
4.4.10.0070.0176.02
4.4.00.0000.0376.06
4.3.110.0070.0205.83
4.3.100.0000.0235.78
4.3.90.0000.0235.80
4.3.80.0070.0275.92
4.3.70.0000.0275.81
4.3.60.0030.0335.78
4.3.50.0000.0235.82
4.3.40.0100.0275.78
4.3.30.0000.0235.78
4.3.20.0030.0205.78
4.3.10.0030.0205.78
4.3.00.0000.0235.78

preferences:
66.84 ms | 400 KiB | 5 Q