3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasNonEmptyArray(array $array): bool { foreach ($array as $k => $v) { if (is_array($v)) { if (hasNonEmptyArray($v)) { return true; // pass deeper true outcome up the call chain } } else { echo "Found element $k\n"; return true; } } return false; } $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.5.00.0090.01219.87
8.4.150.0020.00014.05
8.4.140.0120.00917.38
8.4.130.0080.00817.82
8.4.120.0090.01120.60
8.4.110.0090.01122.26
8.4.100.0130.00917.65
8.4.90.0080.00518.78
8.4.80.0110.00919.68
8.4.70.0060.00217.75
8.4.60.0120.00818.77
8.4.50.0110.00924.05
8.4.40.0100.01018.97
8.4.30.0130.00620.53
8.4.20.0080.00421.21
8.4.10.0100.00719.19
8.3.280.0090.01118.31
8.3.270.0130.00716.42
8.3.260.0120.00616.75
8.3.250.0110.00818.83
8.3.240.0080.01117.05
8.3.230.0140.00516.46
8.3.220.0020.00516.97
8.3.210.0070.00118.43
8.3.200.0050.00416.60
8.3.190.0100.01017.29
8.3.180.0040.00718.39
8.3.170.0110.00717.20
8.3.160.0140.00420.72
8.3.150.0080.00017.04
8.3.140.0090.00916.54
8.3.130.0310.01216.35
8.3.120.0300.01316.28
8.3.110.0310.00916.22
8.3.100.0360.01016.80
8.3.90.0240.01316.63
8.3.80.0210.00716.63
8.3.70.0140.00716.45
8.3.60.0310.00816.21
8.3.50.0460.00316.34
8.3.40.0370.00617.38
8.3.30.0190.01317.28
8.3.20.0340.00017.19
8.3.10.0190.01217.41
8.3.00.0030.01417.31
8.2.290.0090.00920.52
8.2.280.0140.00418.35
8.2.270.0090.00916.32
8.2.260.0070.00716.87
8.2.250.0300.00916.39
8.2.240.0280.01216.45
8.2.230.0210.01016.59
8.2.220.0310.00816.46
8.2.210.0320.00716.18
8.2.200.0350.00416.45
8.2.190.0350.00316.51
8.2.180.0330.00516.34
8.2.170.0300.00717.88
8.2.160.0230.00317.62
8.2.150.0330.01017.70
8.2.140.0370.01017.34
8.2.130.0250.00317.30
8.2.120.0230.00017.54
8.2.110.0140.00717.53
8.2.100.0220.00317.39
8.2.90.0360.00317.46
8.2.80.0330.00717.27
8.2.70.0360.00317.45
8.2.60.0310.00917.38
8.2.50.0340.00717.39
8.2.40.0300.00717.54
8.2.30.0270.01017.18
8.2.20.0360.00317.41
8.2.10.0520.00717.46
8.2.00.0280.00817.39
8.1.330.0100.00721.90
8.1.320.0100.00915.90
8.1.310.0040.00416.63
8.1.300.0340.00716.18
8.1.290.0320.00616.29
8.1.280.0340.01316.18
8.1.270.0170.01417.46
8.1.260.0100.00517.51
8.1.250.0180.00017.41
8.1.240.0110.00417.33
8.1.230.0080.00816.91
8.1.220.0120.00417.35
8.1.210.0160.00017.09
8.1.200.0210.01417.28
8.1.190.0260.00716.88
8.1.180.0300.00717.08
8.1.170.0260.00317.16
8.1.160.0270.00517.21
8.1.150.0300.00617.27
8.1.140.0320.00016.94
8.1.130.0240.01217.07
8.1.120.0280.00417.35
8.1.110.0200.00817.14
8.1.100.0240.00417.26
8.1.90.0260.01117.36
8.1.80.0260.01017.14
8.1.70.0350.00317.20
8.1.60.0350.00817.32
8.1.50.0320.00617.14
8.1.40.0240.01317.32
8.1.30.0270.01417.54
8.1.20.0330.00717.27
8.1.10.0340.00717.10
8.1.00.0390.00017.13

preferences:
37.08 ms | 403 KiB | 5 Q