3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3,[5,6,7]]; $nu_array = null; $callback = function ( $item ) use(&$callback, &$nu_array) { if (!is_array($item)) { $nu_array[] = $item; } else if ( is_array( $item ) ) { foreach( array_values($item) as $v) { if ( !(is_array($v))) { $nu_array[] = $v; } else { $callback( $v ); continue; } } } }; array_walk($array, $callback); print_r($nu_array); $nu_array = []; array_walk_recursive($array, function ( $item ) use(&$nu_array ) { $nu_array[] = $item; } ); print_r($nu_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.130.0120.00717.77
8.4.120.0070.00122.05
8.4.110.0120.00218.44
8.4.100.0140.00518.94
8.4.90.0130.00617.92
8.4.80.0060.01217.72
8.4.70.0100.01017.91
8.4.60.0140.00718.96
8.4.50.0100.01019.15
8.4.40.0030.00717.50
8.4.30.0060.00318.73
8.4.20.0070.01317.69
8.4.10.0100.00019.50
8.3.260.0090.00316.74
8.3.250.0110.00918.98
8.3.240.0110.00716.71
8.3.230.0090.00916.56
8.3.220.0080.01017.23
8.3.210.0130.00616.68
8.3.200.0050.00416.69
8.3.190.0100.01017.00
8.3.180.0140.00618.24
8.3.170.0160.00318.99
8.3.160.0090.00917.20
8.3.150.0140.00718.77
8.3.140.0040.01416.87
8.3.130.0100.01018.43
8.3.120.0050.00520.66
8.3.110.0030.00620.94
8.3.100.0100.00618.35
8.3.90.0040.00426.77
8.3.80.0040.00418.56
8.3.70.0140.00416.75
8.3.60.0040.01116.50
8.3.50.0140.00521.95
8.3.40.0120.00318.55
8.3.30.0030.01218.79
8.3.20.0040.00420.39
8.3.10.0030.00623.59
8.3.00.0050.00322.45
8.2.290.0100.00916.88
8.2.280.0090.00618.61
8.2.270.0110.00717.18
8.2.260.0000.00816.43
8.2.250.0100.01016.92
8.2.240.0040.00417.02
8.2.230.0100.00022.58
8.2.220.0130.00424.06
8.2.210.0070.00726.77
8.2.200.0090.00016.38
8.2.190.0150.00718.31
8.2.180.0030.01225.92
8.2.170.0110.00719.02
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0060.00320.77
8.2.110.0000.00920.33
8.2.100.0030.00918.03
8.2.90.0000.00917.91
8.2.80.0050.00519.29
8.2.70.0000.00917.75
8.2.60.0090.00017.50
8.2.50.0000.00918.10
8.2.40.0060.00321.04
8.2.30.0000.00719.21
8.2.20.0060.00317.63
8.2.10.0050.00218.18
8.2.00.0000.00717.73
8.1.330.0140.00615.96
8.1.320.0090.01216.18
8.1.310.0040.00418.33
8.1.300.0030.00615.90
8.1.290.0030.00630.84
8.1.280.0120.00625.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0060.00323.77
8.1.230.0060.00620.87
8.1.220.0030.00617.78
8.1.210.0000.00918.77
8.1.200.0000.00817.36
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0040.00418.50
8.1.160.0000.00818.82
8.1.150.0030.00618.90
8.1.140.0000.00819.57
8.1.130.0070.00017.41
8.1.120.0030.00317.36
8.1.110.0040.00417.48
8.1.100.0040.00417.44
8.1.90.0070.00017.35
8.1.80.0070.00017.46
8.1.70.0040.00417.38
8.1.60.0000.00817.62
8.1.50.0080.00017.40
8.1.40.0030.00717.55
8.1.30.0030.00617.56
8.1.20.0050.00217.67
8.1.10.0000.00817.54
8.1.00.0040.00417.44
8.0.300.0050.00521.64
8.0.290.0030.00616.75
8.0.280.0000.00718.52
8.0.270.0030.00317.25
8.0.260.0060.00016.71
8.0.250.0000.00717.00
8.0.240.0060.00016.85
8.0.230.0090.00016.92
8.0.220.0030.00516.86
8.0.210.0000.00716.94
8.0.200.0030.00316.91
8.0.190.0040.00416.94
8.0.180.0040.00416.81
8.0.170.0020.00516.81
8.0.160.0040.00416.86
8.0.150.0030.00316.84
8.0.140.0000.00816.92
8.0.130.0000.00613.32
8.0.120.0030.00616.85
8.0.110.0040.00416.79
8.0.100.0040.00416.89
8.0.90.0000.00716.89
8.0.80.0040.00716.91
8.0.70.0020.00516.74
8.0.60.0000.00716.82
8.0.50.0000.00716.67
8.0.30.0060.01016.98
8.0.20.0080.00817.25
8.0.10.0040.00416.89
8.0.00.0090.00816.80
7.4.330.0050.00016.67
7.4.320.0000.00716.60
7.4.300.0070.00016.52
7.4.290.0070.00016.58
7.4.280.0040.00416.49
7.4.270.0000.00716.62
7.4.260.0000.00816.49
7.4.250.0050.00316.46
7.4.240.0050.00316.52
7.4.230.0070.00016.63
7.4.220.0120.00216.53
7.4.210.0040.00916.65
7.4.200.0000.00716.40
7.4.190.0050.00316.70
7.4.180.0070.00016.57
7.4.160.0090.00716.54
7.4.150.0050.00817.00
7.4.140.0090.00717.42
7.4.130.0070.00816.55
7.4.120.0070.00816.49
7.4.110.0110.00516.49
7.4.100.0080.00716.40
7.4.90.0080.00916.52
7.4.80.0050.00817.40
7.4.70.0040.01016.40
7.4.60.0060.00816.62
7.4.50.0050.00916.39
7.4.40.0090.00616.34
7.4.30.0070.00616.36
7.4.20.0070.00516.47
7.4.10.0030.00916.44
7.4.00.0070.00715.58
7.3.330.0050.00013.09
7.3.320.0000.00613.27
7.3.310.0000.00716.33
7.3.300.0040.00416.37
7.3.290.0060.00716.28
7.3.280.0100.00616.25
7.3.270.0060.00616.81
7.3.260.0120.00416.25
7.3.250.0080.00816.38
7.3.240.0110.00516.36
7.3.230.0070.00716.38
7.3.220.0060.00616.40
7.3.210.0090.00716.42
7.3.200.0080.00616.30
7.3.190.0070.00816.39
7.3.180.0080.00516.31
7.3.170.0070.00616.33
7.3.160.0090.00716.32
7.3.150.0050.00716.36
7.3.140.0080.00316.22
7.3.130.0070.00416.24
7.3.120.0080.00815.58
7.3.110.0060.00815.49
7.3.100.0050.00915.46
7.3.90.0080.00515.63
7.3.80.0060.00715.62
7.3.70.0030.00915.46
7.3.60.0030.00915.60
7.3.50.0050.00615.50
7.3.40.0090.00215.51
7.3.30.0080.00415.40
7.3.20.0040.00816.61
7.3.10.0090.00516.45
7.3.00.0060.00916.43
7.2.340.0190.00216.43
7.2.330.0110.00816.43
7.2.320.0170.00416.43
7.2.310.0070.01016.54
7.2.300.0120.00816.64
7.2.290.0140.00516.54
7.2.280.0150.00416.58
7.2.270.0110.00916.48
7.2.260.0130.00716.50
7.2.250.0090.00915.70
7.2.240.0100.00915.82
7.2.230.0070.01115.71
7.2.220.0130.00315.70
7.2.210.0100.00715.57
7.2.200.0090.00815.80
7.2.190.0120.00415.69
7.2.180.0110.00615.78
7.2.170.0110.00615.70
7.2.160.0160.00316.54
7.2.150.0140.00916.52
7.2.140.0140.00716.68
7.2.130.0160.00516.70
7.2.120.0120.00616.62
7.2.110.0200.00716.58
7.2.100.0150.00416.68
7.2.90.0100.00816.60
7.2.80.0110.00616.62
7.2.70.0100.00716.66
7.2.60.0110.00816.65
7.2.50.0120.00616.58
7.2.40.0110.00616.58
7.2.30.0180.00616.66
7.2.20.0130.00616.61
7.2.10.0120.00716.59
7.2.00.0080.00917.32
7.1.330.0070.01015.68
7.1.320.0090.00915.77
7.1.310.0130.00615.80
7.1.300.0080.00715.72
7.1.290.0080.00915.75
7.1.280.0100.00615.75
7.1.270.0090.00615.64
7.1.260.0090.00915.72
7.1.250.0120.00615.47
7.1.240.0110.00815.59
7.1.230.0160.00815.63
7.1.220.0110.00715.68
7.1.210.0130.00515.70
7.1.200.0090.00715.60
7.1.190.0080.00815.63
7.1.180.0100.00715.60
7.1.170.0080.00915.61
7.1.160.0110.00515.60
7.1.150.0100.00715.67
7.1.140.0090.00615.57
7.1.130.0100.00915.59
7.1.120.0100.00715.56
7.1.110.0130.00615.60
7.1.100.0120.00715.53
7.1.90.0110.00615.66
7.1.80.0130.00415.62
7.1.70.0100.00715.97
7.1.60.0110.00716.15
7.1.50.0170.00515.93
7.1.40.0100.00715.83
7.1.30.0080.00915.84
7.1.20.0120.00715.93
7.1.10.0120.00615.86
7.1.00.0110.00715.95
7.0.330.0270.00715.10
7.0.320.0090.00815.34
7.0.310.0090.00615.31
7.0.300.0110.00515.26
7.0.290.0170.01115.24
7.0.280.0140.00515.19
7.0.270.0130.00515.35
7.0.260.0120.00815.28
7.0.250.0110.00915.45
7.0.240.0090.00615.46
7.0.230.0080.00815.51
7.0.220.0080.00615.35
7.0.210.0210.00515.20
7.0.200.0110.00615.64
7.0.190.0110.00615.76
7.0.180.0080.00915.61
7.0.170.0080.00715.61
7.0.160.0090.00715.56
7.0.150.0120.00615.64
7.0.140.0110.00615.53
7.0.130.0160.00515.68
7.0.120.0120.00615.64
7.0.110.0120.00615.58
7.0.100.0120.00715.44
7.0.90.0150.00415.55
7.0.80.0110.00515.55
7.0.70.0170.00615.61
7.0.60.0140.00515.57
7.0.50.0100.00815.61
7.0.40.0100.00514.73
7.0.30.0090.00614.76
7.0.20.0110.00514.78
7.0.10.0100.00614.78
7.0.00.0110.00714.82
5.6.400.0130.00615.91
5.6.390.0150.00415.83
5.6.380.0120.00715.47
5.6.370.0040.01215.46
5.6.360.0070.01115.32
5.6.350.0110.00615.45
5.6.340.0100.01015.29
5.6.330.0100.00915.40
5.6.320.0120.00515.45
5.6.310.0120.00515.31
5.6.300.0120.01216.76
5.6.290.0090.02416.73
5.6.280.0100.01816.99
5.6.270.0120.01616.66
5.6.260.0120.02016.80
5.6.250.0110.01516.79
5.6.240.0100.01816.74
5.6.230.0080.01716.78
5.6.220.0110.01516.87
5.6.210.0100.01816.91
5.6.200.0080.01816.78
5.6.190.0080.01716.90
5.6.180.0070.01816.85
5.6.170.0060.02116.83
5.6.160.0110.01616.92
5.6.150.0100.01716.88
5.6.140.0090.01716.82
5.6.130.0130.01416.88
5.6.120.0100.01816.82
5.6.110.0100.01716.78
5.6.100.0140.01116.81
5.6.90.0100.01716.76
5.6.80.0110.01316.63
5.6.70.0120.01316.67
5.6.60.0080.02316.63
5.6.50.0110.01416.53
5.6.40.0110.01416.70
5.6.30.0090.01516.57
5.6.20.0090.01616.66
5.6.10.0110.01516.59
5.6.00.0150.01616.70

preferences:
34.84 ms | 403 KiB | 5 Q