3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Fish {} class Mammal {} class Whale extends Mammal {} class Human extends Mammal {} class Shark extends Fish {} // Not very exceptional... class FoundException extends Exception {} function anyFish(array $collection) { $found = false; try { array_walk_recursive($collection, function ($v) { if($v instanceof Fish) throw new FoundException('I found a fish.'); }); } catch (FoundException $e) { $found = true; } return $found; } $seas = [ 'pacific' => [new Whale, new Shark], 'atlantic' => [new Human, new Shark] ]; $pub = [new Human, new Human]; var_dump(anyFish($seas)); var_dump(anyFish($pub));

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.4.120.0150.00624.28
8.4.110.0050.00419.07
8.4.100.0040.00518.13
8.4.90.0120.00918.24
8.4.80.0130.00717.80
8.4.70.0120.00819.56
8.4.60.0150.00818.67
8.4.50.0110.00920.42
8.4.40.0100.01019.78
8.4.30.0130.00317.79
8.4.20.0100.01320.77
8.4.10.0060.00317.80
8.3.250.0080.00118.89
8.3.240.0110.00917.11
8.3.230.0150.00416.74
8.3.220.0070.00117.35
8.3.210.0110.00616.79
8.3.200.0120.00816.63
8.3.190.0140.00517.21
8.3.180.0050.00318.48
8.3.170.0120.00617.19
8.3.160.0110.00718.50
8.3.150.0120.00620.80
8.3.140.0110.00718.94
8.3.130.0000.00916.75
8.3.120.0060.00319.00
8.3.110.0060.00318.66
8.3.100.0170.00016.68
8.3.90.0000.00826.77
8.3.80.0070.00318.52
8.3.70.0140.00618.55
8.3.60.0070.01116.75
8.3.50.0080.00918.09
8.3.40.0100.00718.73
8.3.30.0070.00718.68
8.3.20.0040.00420.90
8.3.10.0030.00621.77
8.3.00.0000.00821.74
8.2.290.0070.00620.82
8.2.280.0140.00518.38
8.2.270.0070.01317.04
8.2.260.0090.00616.93
8.2.250.0060.00317.08
8.2.240.0040.00419.13
8.2.230.0050.00320.94
8.2.220.0000.00824.06
8.2.210.0080.00026.77
8.2.200.0060.00318.16
8.2.190.0110.00416.59
8.2.180.0090.00616.75
8.2.170.0090.00619.21
8.2.160.0100.00322.96
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0080.00018.21
8.2.120.0040.00426.35
8.2.110.0070.00319.95
8.2.100.0120.00017.78
8.2.90.0040.00417.63
8.2.80.0000.00818.91
8.2.70.0060.00317.63
8.2.60.0000.00817.63
8.2.50.0030.00517.93
8.2.40.0040.00419.48
8.2.30.0080.00019.37
8.2.20.0000.00918.16
8.2.10.0050.00219.38
8.2.00.0000.00718.03
8.1.330.0100.00821.89
8.1.320.0140.00516.23
8.1.310.0100.00716.83
8.1.300.0040.01118.51
8.1.290.0090.00030.84
8.1.280.0140.00725.92
8.1.270.0080.00023.99
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0000.00924.01
8.1.230.0040.00822.81
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00517.35
8.1.190.0040.00817.35
8.1.180.0000.00918.10
8.1.170.0080.00017.62
8.1.160.0000.00718.82
8.1.150.0030.00518.83
8.1.140.0040.00418.91
8.1.130.0080.00020.16
8.1.120.0040.00417.52
8.1.110.0040.00417.46
8.1.100.0050.00317.42
8.1.90.0040.00417.52
8.1.80.0040.00417.54
8.1.70.0030.00317.47
8.1.60.0040.00417.61
8.1.50.0060.00317.43
8.1.40.0040.00417.55
8.1.30.0000.00817.57
8.1.20.0090.00317.72
8.1.10.0040.00417.65
8.1.00.0070.00017.58
8.0.300.0030.00818.77
8.0.290.0000.00716.75
8.0.280.0000.00718.40
8.0.270.0060.00318.55
8.0.260.0000.00618.43
8.0.250.0000.00717.02
8.0.240.0060.00317.05
8.0.230.0000.00717.02
8.0.220.0030.00316.88
8.0.210.0030.00317.01
8.0.200.0040.00417.02
8.0.190.0030.00616.95
8.0.180.0000.00816.93
8.0.170.0030.00616.90
8.0.160.0050.00317.01
8.0.150.0040.00416.82
8.0.140.0000.00716.95
8.0.130.0030.00313.41
8.0.120.0040.00416.94
8.0.110.0050.00316.93
8.0.100.0070.00016.79
8.0.90.0000.00716.90
8.0.80.0080.00717.01
8.0.70.0050.00316.96
8.0.60.0050.00216.87
8.0.50.0040.00416.87
8.0.30.0090.01117.03
8.0.20.0030.01517.40
8.0.10.0000.00717.18
8.0.00.0080.01016.84
7.4.330.0000.00515.55
7.4.320.0040.00416.43
7.4.300.0060.00016.54
7.4.290.0030.00316.47
7.4.280.0030.00516.66
7.4.270.0000.00716.54
7.4.260.0070.00016.61
7.4.250.0000.00716.61
7.4.240.0040.00416.64
7.4.230.0030.00316.75
7.4.220.0050.00316.53
7.4.210.0070.01016.56
7.4.200.0030.00316.66
7.4.160.0100.00516.57
7.4.140.0150.00317.86
7.4.130.0140.00716.48
7.4.120.0150.00816.48
7.4.110.0190.00016.61
7.4.100.0120.00916.68
7.4.90.0070.01016.73
7.4.80.0150.00719.39
7.4.70.0180.01116.49
7.4.60.0120.00616.70
7.4.50.0060.00916.45
7.4.40.0030.01416.30
7.4.00.0050.01115.07
7.3.330.0020.00213.34
7.3.320.0060.00013.41
7.3.310.0000.00716.51
7.3.300.0000.00816.26
7.3.290.0000.00716.36
7.3.280.0190.00516.42
7.3.260.0100.00816.53
7.3.240.0100.00816.49
7.3.230.0100.00716.61
7.3.210.0080.00816.54
7.3.200.0100.00616.74
7.3.190.0030.01416.59
7.3.180.0110.00716.52
7.3.170.0120.00416.53
7.3.160.0060.01116.56
7.3.120.0060.00914.89
7.3.110.0110.00715.02
7.3.100.0120.00414.76
7.3.90.0050.00514.93
7.3.80.0000.01014.73
7.3.70.0030.01214.89
7.3.60.0060.00314.97
7.3.50.0100.00714.92
7.3.40.0040.00414.95
7.3.30.0030.01214.70
7.3.20.0030.01016.66
7.3.10.0450.00615.58
7.3.00.0450.00815.77
7.2.330.0120.00616.72
7.2.320.0110.01116.75
7.2.310.0140.00316.32
7.2.300.0080.00916.68
7.2.290.0060.01616.38
7.2.250.0120.00615.09
7.2.240.0100.01014.97
7.2.230.0100.00715.05
7.2.220.0060.00614.96
7.2.210.0000.01215.05
7.2.200.0110.00415.12
7.2.190.0030.00914.94
7.2.180.0140.00414.70
7.2.170.0070.00314.71
7.2.130.0570.00314.84
7.2.120.0590.01014.79
7.2.110.0830.00014.66
7.2.100.0600.00314.66
7.2.90.0500.00314.94
7.2.80.0540.00714.67
7.2.70.0540.00014.85
7.2.60.0510.00614.86
7.2.50.0510.00014.77
7.2.40.0500.00714.60
7.2.30.0640.00714.84
7.2.20.0550.00314.40
7.2.10.0490.00614.61
7.2.00.0620.00615.03
7.1.330.0080.00815.71
7.1.320.0130.00015.85
7.1.310.0000.01515.65
7.1.300.0060.00615.65
7.1.290.0160.00315.60
7.1.280.0100.00315.79
7.1.270.0060.01015.79
7.1.260.0030.00615.77
7.1.250.0660.00313.80

preferences:
138.96 ms | 403 KiB | 5 Q