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. //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 { 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"; //Second case: let's trigger another 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.5.10.0110.00816.90
8.5.00.0100.01020.41
8.4.160.0130.01025.48
8.4.150.0020.00014.05
8.4.140.0120.00917.79
8.4.130.0120.00318.19
8.4.120.0140.00622.33
8.4.110.0130.00718.96
8.4.100.0050.00517.84
8.4.90.0120.00920.47
8.4.80.0080.00520.50
8.4.70.0120.00318.95
8.4.60.0100.00920.59
8.4.50.0120.00920.44
8.4.40.0060.00319.51
8.4.30.0070.01318.80
8.4.20.0030.00618.01
8.4.10.0050.00519.56
8.3.280.0110.00820.21
8.3.270.0130.00716.59
8.3.260.0130.00616.57
8.3.250.0130.00618.70
8.3.240.0160.00316.66
8.3.230.0130.00616.63
8.3.220.0100.00718.95
8.3.210.0110.00818.56
8.3.200.0050.00316.78
8.3.190.0060.00417.29
8.3.180.0100.01019.04
8.3.170.0160.00317.13
8.3.160.0070.00717.19
8.3.150.0090.00618.76
8.3.140.0100.00716.90
8.3.130.0100.01016.91
8.3.120.0160.00319.05
8.3.110.0000.00820.94
8.3.100.0000.00924.06
8.3.90.0000.00826.77
8.3.80.0060.00319.36
8.3.70.0090.00918.27
8.3.60.0070.01116.63
8.3.50.0070.01216.52
8.3.40.0130.00318.97
8.3.30.0140.00718.67
8.3.20.0070.00021.73
8.3.10.0030.00621.90
8.3.00.0000.00918.05
8.2.290.0110.00917.32
8.2.280.0110.00918.65
8.2.270.0130.00616.91
8.2.260.0080.00017.29
8.2.250.0080.00018.47
8.2.240.0000.00819.02
8.2.230.0050.00522.58
8.2.220.0090.00637.54
8.2.210.0000.00726.77
8.2.200.0060.00318.88
8.2.190.0120.00316.60
8.2.180.0130.00918.37
8.2.170.0070.00722.96
8.2.160.0090.00621.08
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00420.58
8.2.120.0070.00026.35
8.2.110.0040.00422.08
8.2.100.0050.00517.84
8.2.90.0030.00619.34
8.2.80.0060.00317.97
8.2.70.0040.00717.50
8.2.60.0000.00918.05
8.2.50.0050.00317.63
8.2.40.0050.00322.20
8.2.30.0070.00019.10
8.2.20.0000.00718.14
8.2.10.0040.00418.14
8.2.00.0000.00717.93
8.1.330.0090.01016.04
8.1.320.0130.00716.24
8.1.310.0040.00416.70
8.1.300.0000.00916.41
8.1.290.0030.00730.84
8.1.280.0040.01125.92
8.1.270.0040.00423.93
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00319.29
8.1.230.0110.00017.77
8.1.220.0030.00517.79
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0050.00317.22
8.1.180.0030.00618.10
8.1.170.0030.00618.65
8.1.160.0000.00718.96
8.1.150.0040.00420.07
8.1.140.0030.00519.63
8.1.130.0030.00318.95
8.1.120.0070.00017.49
8.1.110.0040.00417.44
8.1.100.0050.00317.43
8.1.90.0040.00417.36
8.1.80.0030.00417.46
8.1.70.0000.00717.46
8.1.60.0080.00017.61
8.1.50.0040.00417.50
8.1.40.0060.00317.52
8.1.30.0000.00817.49
8.1.20.0030.00617.67
8.1.10.0030.00517.50
8.1.00.0000.00717.47
8.0.300.0070.00018.77
8.0.290.0060.00316.75
8.0.280.0050.00218.39
8.0.270.0070.00017.26
8.0.260.0030.00316.88
8.0.250.0000.00716.90
8.0.240.0060.00516.91
8.0.230.0000.00817.06
8.0.220.0070.00016.92
8.0.210.0000.00716.97
8.0.200.0000.00717.04
8.0.190.0000.00817.01
8.0.180.0040.00416.87
8.0.170.0040.00417.04
8.0.160.0030.00316.98
8.0.150.0050.00316.95
8.0.140.0050.00216.93
8.0.130.0000.00613.45
8.0.120.0040.00416.95
8.0.110.0000.00716.86
8.0.100.0040.00416.95
8.0.90.0040.00417.00
8.0.80.0030.01317.02
8.0.70.0030.00517.02
8.0.60.0070.00016.96
8.0.50.0030.00516.83
8.0.30.0060.01417.25
8.0.20.0100.01117.40
8.0.10.0040.00417.15
8.0.00.0080.01217.01
7.4.330.0000.00515.55
7.4.320.0000.00716.50
7.4.300.0000.00616.61
7.4.290.0070.00016.59
7.4.280.0060.00316.63
7.4.270.0030.00316.52
7.4.260.0000.00513.28
7.4.250.0030.00516.50
7.4.240.0000.00716.52
7.4.230.0000.00716.49
7.4.220.0060.01616.48
7.4.210.0070.00716.46
7.4.200.0030.00316.49
7.4.160.0120.00616.63
7.4.150.0140.00317.40
7.4.140.0110.01017.86
7.4.130.0110.01416.50
7.4.120.0120.00816.48
7.4.110.0120.00616.58
7.4.100.0090.01316.44
7.4.90.0080.00816.52
7.4.80.0110.00719.39
7.4.70.0030.01316.57
7.4.60.0090.00616.41
7.4.50.0060.00916.39
7.4.40.0140.00616.66
7.4.30.0050.01216.68
7.4.10.0060.01215.05
7.4.00.0080.00814.98
7.3.330.0030.00313.38
7.3.320.0000.00713.32
7.3.310.0030.00316.41
7.3.300.0000.00716.40
7.3.290.0000.00916.38
7.3.280.0110.00716.35
7.3.270.0030.01517.40
7.3.260.0140.00416.55
7.3.250.0090.01216.43
7.3.240.0090.00916.58
7.3.230.0070.01016.59
7.3.210.0130.00316.41
7.3.200.0070.01016.50
7.3.190.0130.00316.68
7.3.180.0070.01016.52
7.3.170.0080.00816.42
7.3.160.0100.00716.30
7.3.130.0120.00614.88
7.3.120.0110.00715.10
7.3.110.0030.01715.03
7.3.100.0080.00814.91
7.3.90.0120.00314.75
7.3.80.0040.01114.82
7.3.70.0000.01415.02
7.3.60.0110.00315.04
7.3.50.0030.01014.86
7.3.40.0060.01014.63
7.3.30.0030.01014.72
7.3.20.0040.00716.78
7.3.10.0070.00416.50
7.3.00.0070.00416.55
7.2.330.0120.00616.31
7.2.320.0120.00616.44
7.2.310.0030.01516.79
7.2.300.0090.00616.80
7.2.290.0190.00316.66
7.2.260.0040.01414.62
7.2.250.0070.01115.18
7.2.240.0040.00815.16
7.2.230.0060.00914.91
7.2.220.0060.00915.18
7.2.210.0070.00714.96
7.2.200.0040.01115.27
7.2.190.0060.00814.84
7.2.180.0030.00814.92
7.2.170.0120.00014.93
7.2.160.0000.01015.13
7.2.150.0060.00317.01
7.2.140.0120.00316.98
7.2.130.0070.00717.06
7.2.120.0090.00016.85
7.2.110.0130.00017.02
7.2.100.0030.01316.93
7.2.90.0030.01416.92
7.2.80.0060.01016.64
7.2.70.0030.01217.07
7.2.60.0060.00616.83
7.2.50.0000.01417.02
7.2.40.0040.00417.00
7.2.30.0060.00617.03
7.2.20.0030.01717.01
7.2.10.0060.00617.04
7.2.00.0090.00317.03
7.1.330.0060.00915.74
7.1.320.0030.00615.93
7.1.310.0090.00615.49
7.1.300.0000.01615.94
7.1.290.0090.00315.96
7.1.280.0130.00015.94
7.1.270.0050.00515.45
7.1.260.0030.00815.69
7.1.250.0080.00415.95
7.1.240.0060.00615.70
7.1.230.0060.00615.52
7.1.220.0060.00615.61
7.1.210.0060.00915.85
7.1.200.0040.00615.76
7.1.190.0090.00915.59
7.1.180.0040.00715.64
7.1.170.0080.00815.73
7.1.160.0030.00515.60
7.1.150.0070.00715.83
7.1.140.0170.00015.69
7.1.130.0040.01415.72
7.1.120.0030.00915.79
7.1.110.0110.00015.89
7.1.100.0060.00615.58
7.1.90.0070.01015.89
7.1.80.0060.00615.74
7.1.70.0080.00316.58
7.1.60.0380.01424.21
7.1.50.0130.01224.28
7.1.40.0300.01124.30
7.1.30.0100.01124.32
7.1.20.0410.00324.17
7.1.10.0080.00715.28
7.1.00.0310.00515.35
7.0.330.0040.00915.37
7.0.320.0060.00915.50
7.0.310.0040.00815.41
7.0.300.0030.00615.50
7.0.290.0050.00515.41
7.0.280.0030.01015.44
7.0.270.0030.01015.43
7.0.260.0040.01115.66
7.0.250.0000.01515.55
7.0.240.0090.00315.49
7.0.230.0070.00715.32
7.0.220.0060.01015.49
7.0.210.0040.00815.51
7.0.200.0400.01015.18
7.0.190.0050.01015.14
7.0.180.0280.00815.00
7.0.170.0290.00815.03
7.0.160.0680.00715.04
7.0.150.0040.00814.96
7.0.140.0280.00814.84
7.0.130.0400.01215.03
7.0.120.0380.01015.11
7.0.110.0250.00914.99
7.0.100.0200.01214.99
7.0.90.0430.00514.99
7.0.80.0310.00815.06
7.0.70.0290.00415.05
7.0.60.0280.01214.95
7.0.50.0160.01215.07
7.0.40.0200.00814.16
7.0.30.0180.00814.00
7.0.20.0230.00713.99
7.0.10.0240.00714.04
7.0.00.0230.00514.13
5.6.400.0070.00714.58
5.6.390.0070.01014.44
5.6.380.0100.00613.84
5.6.370.0030.01014.13
5.6.360.0060.00614.05
5.6.350.0060.00614.35
5.6.340.0070.00714.71
5.6.330.0060.00914.07
5.6.320.0030.01014.46
5.6.310.0040.00414.12
5.6.300.0030.00613.96
5.6.290.0000.01713.95
5.6.280.0040.00814.38
5.6.270.0060.00914.57
5.6.260.0070.00714.47
5.6.250.0040.01114.28
5.6.240.0060.00614.12
5.6.230.0060.00914.32
5.6.220.0040.01214.34
5.6.210.0070.00314.31
5.6.200.0080.00414.29
5.6.190.0030.00914.37
5.6.180.0060.00914.45
5.6.170.0060.00914.27
5.6.160.0060.00314.21
5.6.150.0030.00614.28
5.6.140.0030.00914.25
5.6.130.0060.00914.36
5.6.120.0120.00414.41
5.6.110.0060.00614.33
5.6.100.0030.01014.29
5.6.90.0030.00614.09
5.6.80.0000.01414.33
5.6.70.0090.00614.36
5.6.60.0060.00614.44
5.6.50.0030.01014.09
5.6.40.0040.00414.34
5.6.30.0060.00614.34
5.6.20.0060.01214.10
5.6.10.0030.01014.39
5.6.00.0030.00714.29

preferences:
40.33 ms | 403 KiB | 5 Q