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 {} function anyFish(array $collection) { foreach ($collection as $item) { if((is_array($item) && anyFish($item)) || $item instanceof Fish) { return true; } } return false; } $solar_system = [ 'mars' => [ 'dirt' => [new Human] ], 'earth' => [ 'pacific' => [new Whale, new Whale, new Whale], 'atlantic' => [new Human] ] ]; $seas = [ 'pacific' => [new Whale, new Whale, new Shark, new Whale], 'atlantic' => [new Human, new Shark] ]; $pub = [new Human, new Human]; var_dump(anyFish($solar_system)); 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.130.0080.01017.75
8.4.120.0080.00820.38
8.4.110.0140.00518.83
8.4.100.0100.01118.82
8.4.90.0120.00718.84
8.4.80.0020.00718.71
8.4.70.0110.00917.95
8.4.60.0120.00918.87
8.4.50.0070.01418.66
8.4.40.0110.00819.43
8.4.30.0130.00717.90
8.4.20.0090.01220.66
8.4.10.0060.00317.81
8.3.260.0050.00316.84
8.3.250.0120.00718.72
8.3.240.0090.01016.60
8.3.230.0120.01016.47
8.3.220.0130.00619.00
8.3.210.0100.00816.76
8.3.200.0100.00816.62
8.3.190.0080.01116.85
8.3.180.0100.00616.82
8.3.170.0180.00017.48
8.3.160.0080.00018.59
8.3.150.0040.00417.42
8.3.140.0050.00318.93
8.3.130.0040.00416.63
8.3.120.0060.00320.86
8.3.110.0090.00620.94
8.3.100.0050.00316.75
8.3.90.0040.01126.77
8.3.80.0040.00417.97
8.3.70.0070.00716.88
8.3.60.0170.00318.43
8.3.50.0040.00918.20
8.3.40.0110.00418.79
8.3.30.0040.01218.85
8.3.20.0040.00420.85
8.3.10.0000.00821.72
8.3.00.0000.00721.96
8.2.290.0090.01020.36
8.2.280.0100.00818.73
8.2.270.0110.00719.02
8.2.260.0120.00618.23
8.2.250.0040.00418.57
8.2.240.0090.00917.35
8.2.230.0000.01522.58
8.2.220.0060.00624.06
8.2.210.0050.00326.77
8.2.200.0060.00316.75
8.2.190.0170.00316.60
8.2.180.0120.00916.50
8.2.170.0070.00722.96
8.2.160.0090.00620.96
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0070.00019.77
8.2.120.0080.00026.35
8.2.110.0060.01120.24
8.2.100.0030.00919.57
8.2.90.0090.00018.02
8.2.80.0000.00817.97
8.2.70.0000.00918.05
8.2.60.0000.00718.16
8.2.50.0040.00418.10
8.2.40.0000.00819.34
8.2.30.0040.00419.24
8.2.20.0040.00418.14
8.2.10.0100.00019.37
8.2.00.0050.00218.13
8.1.330.0120.00622.27
8.1.320.0130.00716.05
8.1.310.0170.00018.36
8.1.300.0040.00416.07
8.1.290.0090.00030.84
8.1.280.0070.01125.92
8.1.270.0050.00318.91
8.1.260.0100.00326.35
8.1.250.0070.00028.09
8.1.240.0100.00019.26
8.1.230.0090.00320.99
8.1.220.0080.00017.77
8.1.210.0040.00418.77
8.1.200.0080.00017.35
8.1.190.0060.00317.22
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0040.00418.93
8.1.150.0040.00718.93
8.1.140.0040.00418.82
8.1.130.0040.00417.49
8.1.120.0000.00717.50
8.1.110.0070.00017.55
8.1.100.0070.00017.54
8.1.90.0000.00817.55
8.1.80.0030.00517.51
8.1.70.0000.00717.54
8.1.60.0050.00317.49
8.1.50.0040.00417.44
8.1.40.0040.00417.49
8.1.30.0040.00417.58
8.1.20.0000.00817.61
8.1.10.0060.00317.54
8.1.00.0000.00817.55
8.0.300.0050.00319.67
8.0.290.0080.00016.63
8.0.280.0030.00718.48
8.0.270.0000.00717.30
8.0.260.0000.00616.86
8.0.250.0000.00716.90
8.0.240.0040.00416.98
8.0.230.0000.00717.00
8.0.220.0070.00016.94
8.0.210.0030.00416.99
8.0.200.0000.00716.92
8.0.190.0050.00216.86
8.0.180.0000.00816.88
8.0.170.0040.00416.98
8.0.160.0040.00416.91
8.0.150.0000.00816.91
8.0.140.0030.00516.82
8.0.130.0000.00613.40
8.0.120.0040.00416.91
8.0.110.0050.00316.75
8.0.100.0070.00016.78
8.0.90.0000.00716.86
8.0.80.0110.00716.88
8.0.70.0040.00416.82
8.0.60.0050.00316.90
8.0.50.0040.00416.91
8.0.30.0120.00717.02
8.0.20.0110.01017.40
8.0.10.0030.00516.98
8.0.00.0100.00916.87
7.4.330.0050.00015.55
7.4.320.0060.00016.64
7.4.300.0000.00616.66
7.4.290.0000.00716.61
7.4.280.0040.00416.55
7.4.270.0030.00316.69
7.4.260.0020.00516.63
7.4.250.0030.00316.43
7.4.240.0070.00016.57
7.4.230.0080.00016.45
7.4.220.0040.00416.61
7.4.210.0030.01116.63
7.4.200.0030.00316.62
7.4.160.0120.00616.63
7.4.140.0120.00717.86
7.4.130.0110.00916.59
7.4.120.0090.01216.57
7.4.110.0120.01216.56
7.4.100.0070.01416.59
7.4.90.0030.01416.48
7.4.80.0100.01319.39
7.4.70.0160.00016.63
7.4.60.0090.00616.60
7.4.50.0070.00716.37
7.4.40.0180.00616.43
7.4.00.0050.00514.95
7.3.330.0000.00513.22
7.3.320.0000.00613.24
7.3.310.0090.00016.39
7.3.300.0040.00416.39
7.3.290.0000.00616.35
7.3.280.0080.00816.37
7.3.260.0110.00716.46
7.3.240.0120.00716.57
7.3.230.0130.00316.39
7.3.210.0030.01516.37
7.3.200.0070.01016.68
7.3.190.0120.00316.36
7.3.180.0070.01316.40
7.3.170.0130.01016.43
7.3.160.0110.00716.35
7.3.10.0730.00314.91
7.3.00.0750.00714.85
7.2.330.0040.01416.83
7.2.320.0150.00916.70
7.2.310.0100.00616.66
7.2.300.0070.01016.44
7.2.290.0120.01216.53
7.2.130.0560.00714.96
7.2.120.1390.00315.02
7.2.110.0710.00314.97
7.2.100.0620.00315.25
7.2.90.0750.00315.00
7.2.80.0730.00315.08
7.2.70.0640.00614.99
7.2.60.0720.00715.07
7.2.50.0500.01014.79
7.2.40.0770.00315.14
7.2.30.0690.00314.93
7.2.20.0550.00315.05
7.2.10.0750.00714.89
7.2.00.0520.00314.97
7.1.250.0650.01013.69

preferences:
30.3 ms | 403 KiB | 5 Q