3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasNonEmptyArray(array $array): bool { try { array_walk_recursive( $array, fn($v, $k) => throw new Exception("Found element $k\n") ); return false; } catch (Exception $e) { echo $e->getMessage(); return true; } } $array = [ [ 'one' => [], 'two' => [ 'a' => [ 'foo' => [], ], 'b' => [] ], 'three' => [ 'c' => [ 'fizz' => 'buzz' ] ] ] ]; var_export(hasNonEmptyArray($array));

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.0120.00920.55
8.4.110.0130.00722.39
8.4.100.0120.01017.71
8.4.90.0110.00618.02
8.4.80.0040.00417.95
8.4.70.0130.00717.96
8.4.60.0040.00517.67
8.4.50.0080.00920.51
8.4.40.0070.01417.76
8.4.30.0030.01720.41
8.4.20.0120.00821.30
8.4.10.0100.00719.56
8.3.250.0130.00618.88
8.3.240.0090.01117.30
8.3.230.0090.00216.61
8.3.220.0090.00917.18
8.3.210.0120.00616.77
8.3.200.0060.00916.69
8.3.190.0100.00917.13
8.3.180.0130.00718.59
8.3.170.0080.00816.93
8.3.160.0070.00018.13
8.3.150.0030.00517.05
8.3.140.0040.00416.46
8.3.130.0340.00816.35
8.3.120.0310.01216.60
8.3.110.0440.00016.18
8.3.100.0330.01316.71
8.3.90.0230.02316.59
8.3.80.0420.00316.39
8.3.70.0310.00316.25
8.3.60.0220.01116.28
8.3.50.0240.00316.32
8.3.40.0200.00417.29
8.3.30.0360.00617.36
8.3.20.0350.00417.39
8.3.10.0330.00317.56
8.3.00.0170.00617.46
8.2.290.0060.00320.28
8.2.280.0090.00816.80
8.2.270.0110.00716.54
8.2.260.0110.00717.31
8.2.250.0210.01816.44
8.2.240.0300.00316.57
8.2.230.0300.00616.19
8.2.220.0270.00816.71
8.2.210.0240.01016.38
8.2.200.0410.00016.51
8.2.190.0300.00616.23
8.2.180.0390.00016.44
8.2.170.0380.00017.61
8.2.160.0460.00417.61
8.2.150.0400.00317.39
8.2.140.0350.00817.49
8.2.130.0340.00717.57
8.2.120.0280.01417.53
8.2.110.0340.00817.74
8.2.100.0280.01417.50
8.2.90.0480.00417.57
8.2.80.0440.01117.68
8.2.70.0400.00317.45
8.2.60.0360.00717.27
8.2.50.0290.01417.48
8.2.40.0330.00417.42
8.2.30.0350.00317.41
8.2.20.0260.00717.57
8.2.10.0310.00917.68
8.2.00.0260.01317.48
8.1.330.0120.00621.82
8.1.320.0130.00616.43
8.1.310.0080.00016.58
8.1.300.0330.01016.18
8.1.290.0190.01216.28
8.1.280.0350.00416.32
8.1.270.0260.01617.19
8.1.260.0250.00917.51
8.1.250.0350.00617.25
8.1.240.0310.00617.14
8.1.230.0370.00417.01
8.1.220.0320.01116.96
8.1.210.0260.01017.31
8.1.200.0240.01217.26
8.1.190.0360.00416.87
8.1.180.0390.00016.91
8.1.170.0320.00317.00
8.1.160.0260.01117.25
8.1.150.0260.01017.22
8.1.140.0220.01316.98
8.1.130.0280.00717.05
8.1.120.0300.00617.16
8.1.110.0340.00717.23
8.1.100.0350.00317.02
8.1.90.0300.00817.27
8.1.80.0190.01617.13
8.1.70.0300.00317.19
8.1.60.0290.01217.38
8.1.50.0330.00616.98
8.1.40.0270.01117.07
8.1.30.0260.01317.37
8.1.20.0140.01417.11
8.1.10.0350.00417.25
8.1.00.0280.01117.14

preferences:
26.56 ms | 403 KiB | 5 Q