3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function (int $severity, string $message, string $filename, int $line) { echo "throwing\n"; throw new ErrorException($message, 0, $severity, $filename, $line); }); $stdObject = new stdClass(); //Can't be casted to string //array_diff compares array items CASTING them to string //http://php.net/manual/en/function.array-diff.php try { array_diff([], [$stdObject]); }catch(ErrorException $ee){ echo "Catched exception: " . $ee->getMessage() . "\n"; } echo "\n----------\n"; try { array_diff([$stdObject], []); }catch(ErrorException $ee){ 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.0070.01118.43
8.3.50.0090.00616.47
8.3.40.0150.00318.90
8.3.30.0110.00418.62
8.3.20.0000.00821.89
8.3.10.0040.00423.48
8.3.00.0060.00317.93
8.2.180.0110.01118.41
8.2.170.0170.00022.96
8.2.160.0070.00721.13
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00020.39
8.2.120.0040.00426.35
8.2.110.0050.00520.97
8.2.100.0000.01118.03
8.2.90.0040.00419.20
8.2.80.0090.00017.97
8.2.70.0070.00417.75
8.2.60.0040.00417.80
8.2.50.0060.00319.22
8.2.40.0030.00522.14
8.2.30.0000.00719.30
8.2.20.0000.00718.09
8.2.10.0040.00418.09
8.2.00.0040.00418.07
8.1.280.0030.01225.92
8.1.270.0040.00422.24
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0110.01120.87
8.1.230.0000.01217.70
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0050.00317.64
8.1.180.0030.00518.10
8.1.170.0050.00318.59
8.1.160.0070.00018.89
8.1.150.0070.00020.07
8.1.140.0040.00419.60
8.1.130.0030.00318.98
8.1.120.0000.00717.53
8.1.110.0050.00317.36
8.1.100.0060.00317.48
8.1.90.0050.00217.38
8.1.80.0000.00717.40
8.1.70.0070.00017.43
8.1.60.0040.00417.50
8.1.50.0040.00417.45
8.1.40.0080.00017.50
8.1.30.0070.00017.70
8.1.20.0040.00417.67
8.1.10.0030.00617.47
8.1.00.0060.00317.47
8.0.300.0030.00618.77
8.0.290.0070.00016.88
8.0.280.0030.00518.46
8.0.270.0070.00017.23
8.0.260.0000.00616.80
8.0.250.0050.00317.05
8.0.240.0030.00717.07
8.0.230.0000.00817.02
8.0.220.0000.00816.98
8.0.210.0000.00716.89
8.0.200.0000.00616.90
8.0.190.0000.00716.99
8.0.180.0040.00417.01
8.0.170.0040.00416.90
8.0.160.0040.00416.97
8.0.150.0030.00316.81
8.0.140.0040.00416.81
8.0.130.0000.00513.44
8.0.120.0020.00516.94
8.0.110.0000.00716.83
8.0.100.0050.00216.95
8.0.90.0040.00416.82
8.0.80.0070.01016.93
8.0.70.0080.00017.03
8.0.60.0020.00516.92
8.0.50.0030.00516.99
8.0.30.0110.00917.06
8.0.20.0130.00917.42
8.0.10.0070.00016.89
8.0.00.0170.00416.81
7.4.330.0000.00515.55
7.4.320.0030.00316.63
7.4.300.0000.00716.44
7.4.290.0030.00316.64
7.4.280.0000.00816.50
7.4.270.0030.00316.55
7.4.260.0060.00013.27
7.4.250.0070.00016.56
7.4.240.0000.00716.61
7.4.230.0000.00716.69
7.4.220.0110.00716.57
7.4.210.0030.01016.48
7.4.200.0050.00216.41
7.4.160.0050.01116.68
7.4.150.0070.01117.40
7.4.140.0130.00517.86
7.4.130.0100.01316.65
7.4.120.0120.00816.56
7.4.110.0100.01116.59
7.4.100.0120.00616.66
7.4.90.0120.00416.48
7.4.80.0070.01819.39
7.4.70.0000.01516.36
7.4.60.0000.01816.38
7.4.50.0040.00816.57
7.4.40.0070.01016.40
7.4.30.0100.00716.76
7.4.10.0040.01515.02
7.4.00.0030.00815.04
7.3.330.0000.00513.31
7.3.320.0000.00613.34
7.3.310.0080.00016.43
7.3.300.0030.00316.29
7.3.290.0070.00816.35
7.3.280.0070.00816.36
7.3.270.0110.00617.40
7.3.260.0080.00916.59
7.3.250.0060.01116.46
7.3.240.0110.00516.43
7.3.230.0090.00916.37
7.3.210.0100.00716.44
7.3.200.0090.01216.48
7.3.190.0030.01216.36
7.3.180.0000.01716.49
7.3.170.0040.01216.62
7.3.160.0040.01216.50
7.3.130.0000.01815.10
7.3.120.0000.01914.91
7.3.110.0100.00614.93
7.3.100.0100.00314.71
7.3.90.0080.00814.66
7.3.80.0000.01515.18
7.3.70.0090.00314.69
7.3.60.0000.01014.94
7.3.50.0030.00914.85
7.3.40.0040.00714.89
7.3.30.0000.00814.63
7.3.20.0030.01016.82
7.3.10.0030.00616.81
7.3.00.0040.01116.67
7.2.330.0110.00716.53
7.2.320.0060.01616.59
7.2.310.0120.00316.70
7.2.300.0070.01016.81
7.2.290.0030.01416.84
7.2.260.0090.01114.93
7.2.250.0060.01214.95
7.2.240.0030.01215.23
7.2.230.0000.01415.14
7.2.220.0000.01114.84
7.2.210.0090.00615.24
7.2.200.0060.00314.77
7.2.190.0000.01415.20
7.2.180.0030.01315.19
7.2.170.0030.01015.19
7.2.160.0040.01114.88
7.2.150.0030.01116.85
7.2.140.0000.01116.93
7.2.130.0030.00616.92
7.2.120.0070.00716.65
7.2.110.0110.00416.91
7.2.100.0060.00916.99
7.2.90.0060.00617.11
7.2.80.0110.00316.79
7.2.70.0100.00717.09
7.2.60.0070.00916.96
7.2.50.0130.00216.92
7.2.40.0120.00316.67
7.2.30.0000.00916.88
7.2.20.0060.00616.94
7.2.10.0000.01416.73
7.2.00.0000.01118.20
7.1.330.0030.01015.76
7.1.320.0030.00615.64
7.1.310.0030.01015.81
7.1.300.0030.01315.83
7.1.290.0030.00615.81
7.1.280.0000.01415.35
7.1.270.0110.00415.61
7.1.260.0060.00915.70
7.1.250.0060.00616.01
7.1.240.0060.00615.69
7.1.230.0000.01415.89
7.1.220.0070.00715.55
7.1.210.0000.01615.88
7.1.200.0020.01015.84
7.1.190.0060.00915.92
7.1.180.0150.00015.64
7.1.170.0090.00315.71
7.1.160.0110.00315.67
7.1.150.0110.00315.53
7.1.140.0040.00815.57
7.1.130.0000.01415.57
7.1.120.0060.00615.84
7.1.110.0060.01215.77
7.1.100.0060.00615.75
7.1.90.0030.00615.44
7.1.80.0000.01215.71
7.1.70.0060.00316.17
7.1.60.0400.01124.36
7.1.50.0640.00924.29
7.1.40.0600.01524.19
7.1.30.0720.01424.28
7.1.20.0380.01124.21
7.1.10.0350.00815.33
7.1.00.0400.01315.31
7.0.330.0000.01015.46
7.0.320.0100.00315.23
7.0.310.0000.01215.55
7.0.300.0030.00715.59
7.0.290.0080.00615.45
7.0.280.0060.00815.58
7.0.270.0000.01415.42
7.0.260.0000.01715.39
7.0.250.0090.00315.57
7.0.240.0030.01315.58
7.0.230.0060.00615.61
7.0.220.0040.00715.22
7.0.210.0000.01515.48
7.0.200.0520.01315.20
7.0.190.0570.00715.27
7.0.180.0510.00815.03
7.0.170.0670.00514.77
7.0.160.0380.00715.10
7.0.150.0650.01414.89
7.0.140.0290.01214.96
7.0.130.0480.01215.14
7.0.120.0480.00815.07
7.0.110.0500.01014.81
7.0.100.0530.01314.91
7.0.90.0520.01214.95
7.0.80.0360.00815.04
7.0.70.0470.01114.96
7.0.60.0340.00414.87
7.0.50.0360.00615.02
7.0.40.0320.01514.01
7.0.30.0360.00714.12
7.0.20.0380.01014.10
7.0.10.0350.01313.98
7.0.00.0370.01014.15
5.6.400.0060.00314.27
5.6.390.0000.01514.45
5.6.380.0060.00614.27
5.6.370.0040.00914.51
5.6.360.0030.01213.98
5.6.350.0070.00714.38
5.6.340.0040.00714.33
5.6.330.0080.00414.29
5.6.320.0070.01114.17
5.6.310.0060.01014.34
5.6.300.0000.01314.24
5.6.290.0070.00714.34
5.6.280.0030.00714.42
5.6.270.0030.00914.40
5.6.260.0030.00514.16
5.6.250.0030.00914.53
5.6.240.0090.00314.43
5.6.230.0070.00714.41
5.6.220.0000.01214.38
5.6.210.0060.00914.47
5.6.200.0090.00614.24
5.6.190.0110.00414.11
5.6.180.0070.00714.27
5.6.170.0030.00914.10
5.6.160.0070.00713.97
5.6.150.0030.00614.42
5.6.140.0030.00914.41
5.6.130.0120.00614.18
5.6.120.0040.01114.42
5.6.110.0140.00014.36
5.6.100.0030.01414.39
5.6.90.0050.00514.01
5.6.80.0040.00414.06
5.6.70.0030.00614.24
5.6.60.0090.00614.25
5.6.50.0100.00313.92
5.6.40.0100.00614.29
5.6.30.0070.00714.49
5.6.20.0000.01214.26
5.6.10.0000.01214.43
5.6.00.0040.01114.25

preferences:
83.15 ms | 400 KiB | 5 Q