3v4l.org

run code in 300+ PHP versions simultaneously
<?php function HTMLStringify($arr, array $seen = array()) { if (is_array($arr)) { $seen[] = $arr; $html = '<ul>'; foreach ($arr as $key => $value) { $html .= '<li>' . $key; if (is_array($value)) { if (in_array($value, $seen, true)) { // Deal with recursion in your own way here $html .= ' [RECURSION]'; } else { $html .= HTMLStringify($value, $seen); } } elseif (is_numeric($value) || is_string($value) || is_null($value)) { $html .= ' = ' . $value; } else { $html .= ' [couldn\'t parse ' . gettype($value) . ']'; } $html .= '</li>'; } return $html . '</ul>'; } else { return null; } } $arr = array(1 => 'one', 2 => 'two'); $arr[3] = &$arr; echo HTMLStringify($arr);

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.20.0100.01017.64
8.4.10.0060.01017.61
8.3.140.0040.00416.72
8.3.130.0040.00416.72
8.3.120.0000.00920.85
8.3.110.0100.01020.94
8.3.100.0040.00816.74
8.3.90.0140.00426.77
8.3.80.0090.00016.63
8.3.70.0110.00416.63
8.3.60.0090.00916.63
8.3.50.0120.00822.00
8.3.40.0120.00318.68
8.3.30.0100.00719.07
8.3.20.0050.00320.39
8.3.10.0080.00023.70
8.3.00.0000.00819.38
8.2.260.0090.00916.75
8.2.250.0040.01516.64
8.2.240.0090.00019.15
8.2.230.0060.00322.58
8.2.220.0080.00024.06
8.2.210.0100.00026.77
8.2.200.0100.00016.75
8.2.190.0090.00616.58
8.2.180.0160.00316.50
8.2.170.0110.00419.14
8.2.160.0030.01122.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0090.00526.16
8.2.120.0040.00422.08
8.2.110.0070.00321.13
8.2.100.0090.00617.59
8.2.90.0050.00319.40
8.2.80.0050.00317.97
8.2.70.0050.00517.75
8.2.60.0180.00017.34
8.2.50.0040.00417.80
8.2.40.0080.00019.47
8.2.30.0030.00518.00
8.2.20.0000.00717.83
8.2.10.0000.00818.19
8.2.00.0100.00017.73
8.1.310.0130.00318.49
8.1.300.0070.01018.28
8.1.290.0120.00030.84
8.1.280.0120.00925.92
8.1.270.0040.00422.04
8.1.260.0050.00326.35
8.1.250.0020.00528.09
8.1.240.0040.00422.14
8.1.230.0110.00020.32
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0040.00418.90
8.1.150.0050.00218.69
8.1.140.0040.00417.31
8.1.130.0030.00320.14
8.1.120.0040.00317.50
8.1.110.0040.00717.50
8.1.100.0050.00317.45
8.1.90.0030.00317.44
8.1.80.0040.00417.34
8.1.70.0070.00017.34
8.1.60.0040.00417.42
8.1.50.0070.00017.50
8.1.40.0040.00417.51
8.1.30.0050.00317.61
8.1.20.0000.00817.54
8.1.10.0030.00617.37
8.1.00.0000.00917.45
8.0.300.0000.00818.77
8.0.290.0030.00616.58
8.0.280.0070.00018.43
8.0.270.0030.00316.73
8.0.260.0060.00020.27
8.0.250.0000.00716.93
8.0.240.0070.00016.92
8.0.230.0030.00317.02
8.0.220.0030.00316.78
8.0.210.0040.00416.89
8.0.200.0060.00016.91
8.0.190.0000.00716.97
8.0.180.0000.00716.88
8.0.170.0080.00016.87
8.0.160.0050.00317.00
8.0.150.0070.00016.88
8.0.140.0060.00316.84
8.0.130.0000.00813.33
8.0.120.0040.00416.84
8.0.110.0000.00716.90
8.0.100.0040.00416.86
8.0.90.0040.00416.81
8.0.80.0150.00016.88
8.0.70.0030.00516.77
8.0.60.0040.00416.86
8.0.50.0000.00716.75
8.0.30.0080.01517.20
8.0.20.0120.00717.40
8.0.10.0040.00417.08
8.0.00.0050.01216.82
7.4.330.0030.00315.00
7.4.320.0030.00316.41
7.4.300.0060.00016.62
7.4.290.0040.00416.59
7.4.280.0050.00316.48
7.4.270.0070.00016.61
7.4.260.0000.00716.61
7.4.250.0030.00616.54
7.4.240.0050.00316.51
7.4.230.0000.00716.53
7.4.220.0070.01016.71
7.4.210.0060.00716.46
7.4.200.0030.00316.42
7.4.190.0030.00616.73
7.4.160.0000.01516.47
7.4.150.0070.01117.40
7.4.140.0110.01217.86
7.4.130.0080.01016.49
7.4.120.0130.00516.49
7.4.110.0090.00916.56
7.4.100.0080.01116.40
7.4.90.0130.00316.50
7.4.80.0100.01019.39
7.4.70.0120.00616.53
7.4.60.0070.01016.42
7.4.50.0040.00416.38
7.4.40.0030.01222.77
7.4.30.0060.00916.32
7.4.00.0070.01115.03
7.3.330.0030.00313.30
7.3.320.0000.00513.37
7.3.310.0040.00416.40
7.3.300.0040.00416.34
7.3.290.0070.00716.37
7.3.280.0060.01116.43
7.3.270.0090.00917.40
7.3.260.0110.00616.30
7.3.250.0160.00616.59
7.3.240.0090.01016.40
7.3.230.0090.00916.39
7.3.210.0120.00616.61
7.3.200.0060.01219.39
7.3.190.0070.01416.64
7.3.180.0070.01416.41
7.3.170.0110.00516.46
7.3.160.0090.01216.54
7.3.120.0050.01314.90
7.3.110.0090.00714.90
7.3.100.0050.00814.83
7.3.90.0060.01014.66
7.3.80.0080.00815.00
7.3.70.0080.00714.91
7.3.60.0030.01014.71
7.3.50.0050.01014.86
7.3.40.0050.00514.79
7.3.30.0080.00614.55
7.3.20.0030.01016.56
7.3.10.0090.00716.77
7.3.00.0030.01016.61
7.2.330.0100.00716.86
7.2.320.0100.00616.80
7.2.310.0100.00716.71
7.2.300.0080.00816.60
7.2.290.0100.01016.85
7.2.250.0060.01114.84
7.2.240.0040.00615.01
7.2.230.0080.00815.11
7.2.220.0040.01115.08
7.2.210.0050.00914.99
7.2.200.0050.00615.11
7.2.190.0060.00714.97
7.2.180.0040.01115.16
7.2.170.0040.00915.07
7.2.160.0060.00814.97
7.2.150.0080.00716.61
7.2.140.0070.00916.75
7.2.130.0020.00917.00
7.2.120.0070.00616.86
7.2.110.0050.00516.83
7.2.100.0040.00916.79
7.2.90.0070.00916.89
7.2.80.0000.01416.96
7.2.70.0080.00516.80
7.2.60.0050.01116.65
7.2.50.0040.01316.55
7.2.40.0030.01216.98
7.2.30.0080.01116.81
7.2.20.0080.00916.89
7.2.10.0020.01016.81
7.2.00.0050.00916.75
7.1.330.0090.00515.96
7.1.320.0020.01415.86
7.1.310.0070.00815.68
7.1.300.0090.00515.81
7.1.290.0070.00815.89
7.1.280.0090.00515.74
7.1.270.0050.01015.78
7.1.260.0080.00515.85
7.1.250.0050.00715.73
7.1.240.0030.00615.81
7.1.230.0030.00715.30
7.1.220.0030.00915.61
7.1.210.0090.00615.83
7.1.200.0090.00215.64
7.1.190.0030.00915.52
7.1.180.0030.01015.25
7.1.170.0070.00715.75
7.1.160.0070.00715.61
7.1.150.0030.00615.46
7.1.140.0040.00815.36
7.1.130.0030.00615.73
7.1.120.0130.00315.46
7.1.110.0090.00615.80
7.1.100.0060.00616.00
7.1.90.0080.00515.87
7.1.80.0140.00315.69
7.1.70.0070.00316.56
7.1.60.0050.01317.47
7.1.50.0060.01016.36
7.1.40.0060.00615.67
7.1.30.0070.00715.66
7.1.20.0040.00715.73
7.1.10.0070.01015.70
7.1.00.0100.03819.03
7.0.330.0070.00715.11
7.0.320.0080.00415.30
7.0.310.0040.00415.14
7.0.300.0060.00615.02
7.0.290.0090.00315.32
7.0.280.0000.01015.03
7.0.270.0070.00715.34
7.0.260.0040.01214.89
7.0.250.0030.00615.40
7.0.240.0030.01215.49
7.0.230.0030.01415.39
7.0.220.0040.01115.45
7.0.210.0000.01515.48
7.0.200.0040.00515.99
7.0.190.0070.00415.21
7.0.180.0030.00615.22
7.0.170.0050.00315.43
7.0.160.0030.00615.53
7.0.150.0000.01115.40
7.0.140.0000.04518.75
7.0.130.0030.01015.29
7.0.120.0030.01314.87
7.0.110.0120.00315.23
7.0.100.0050.00515.11
7.0.90.0060.00915.24
7.0.80.0070.00415.41
7.0.70.0030.00615.49
7.0.60.0050.04617.60
7.0.50.0100.04116.57
7.0.40.0080.03616.72
7.0.30.0100.02716.87
7.0.20.0180.04216.82
7.0.10.0030.02616.57
7.0.00.0050.04816.58
5.6.400.0030.00614.21
5.6.390.0090.00613.85
5.6.380.0090.00314.65
5.6.370.0040.00814.18
5.6.360.0110.00714.48
5.6.350.0030.01314.46
5.6.340.0060.00614.19
5.6.330.0030.01314.67
5.6.320.0000.01714.25
5.6.310.0040.01214.31
5.6.300.0000.01314.13
5.6.290.0030.01214.34
5.6.280.0080.03817.71
5.6.270.0080.00814.31
5.6.260.0030.00614.13
5.6.250.0030.00714.07
5.6.240.0130.00314.07
5.6.230.0100.00314.11
5.6.220.0100.00314.12
5.6.210.0000.04517.51
5.6.200.0100.04216.22
5.6.190.0060.04717.29
5.6.180.0200.03517.31
5.6.170.0150.04817.38
5.6.160.0070.03317.46
5.6.150.0060.02316.06
5.6.140.0050.02416.03
5.6.130.0050.04716.15
5.6.120.0050.02317.60
5.6.110.0120.04117.64
5.6.100.0060.04317.62
5.6.90.0050.03617.68
5.6.80.0030.04617.21
5.6.70.2360.01917.27
5.6.60.0030.00714.37
5.6.50.0100.00614.38
5.6.40.0100.00314.19
5.6.30.0060.00914.19
5.6.20.0100.00614.30
5.6.10.0060.00614.57
5.6.00.0070.00714.28
5.5.380.0070.00714.09
5.5.370.0060.00314.27
5.5.360.0040.00814.22
5.5.350.0080.04317.27
5.5.340.0030.03716.24
5.5.330.0050.04317.50
5.5.320.0030.02817.12
5.5.310.0180.03017.40
5.5.300.0090.04316.11
5.5.290.0060.03316.30
5.5.280.0050.04717.77
5.5.270.0020.05217.66
5.5.260.0030.04517.68
5.5.250.0070.02517.43
5.5.240.0150.02117.13
5.5.230.0000.01414.44
5.5.220.0040.00713.91
5.5.210.0000.01314.08
5.5.200.0000.00814.09
5.5.190.0100.00313.92
5.5.180.0050.01214.38
5.5.170.0180.00014.15
5.5.160.0100.00714.40
5.5.150.0170.00314.48
5.5.140.0130.00814.39
5.5.130.0070.00713.92
5.5.120.0000.01313.92
5.5.110.0040.01114.41
5.5.100.0090.00614.20
5.5.90.0090.00314.23
5.5.80.0120.00614.23
5.5.70.0030.01013.96
5.5.60.0030.00914.09
5.5.50.0070.00413.86
5.5.40.0100.00314.32
5.5.30.0100.00713.97
5.5.20.0040.01114.38
5.5.10.0060.00614.11
5.5.00.0060.00614.27
5.4.450.0180.04815.26
5.4.440.0350.03615.21
5.4.430.0330.03515.22
5.4.420.0380.02815.38
5.4.410.0230.03415.08
5.4.400.0150.02614.92
5.4.390.0150.03015.05
5.4.380.0150.03214.88
5.4.370.0200.02714.86
5.4.360.0170.04215.00
5.4.350.0170.03014.76
5.4.340.0130.03214.90
5.4.330.0090.00311.39
5.4.320.0050.02311.80
5.4.310.0060.02111.73
5.4.300.0040.02611.92
5.4.290.0050.02211.79
5.4.280.0070.03211.68
5.4.270.0060.02211.67
5.4.260.0020.03111.69
5.4.250.0070.03111.73
5.4.240.0080.03211.72
5.4.230.0120.03211.84
5.4.220.0100.04011.80
5.4.210.0100.03811.68
5.4.200.0070.03611.70
5.4.190.0090.03411.78
5.4.180.0110.03011.69
5.4.170.0150.03811.78
5.4.160.0100.05111.72
5.4.150.0200.05111.71
5.4.140.0080.02711.72
5.4.130.0110.03111.49
5.4.120.0120.03511.62
5.4.110.0110.03811.47
5.4.100.0090.03511.53
5.4.90.0120.03411.55
5.4.80.0090.02511.61
5.4.70.0100.03311.51
5.4.60.0120.03811.47
5.4.50.0100.03211.47
5.4.40.0090.03311.57
5.4.30.0080.02611.64
5.4.20.0070.03211.63
5.4.10.0120.03611.53
5.4.00.0100.04811.44
5.3.290.0070.02611.88
5.3.280.0100.03911.83
5.3.270.0100.06011.84
5.3.260.0110.05411.84
5.3.250.0070.04011.84
5.3.240.0110.03511.84
5.3.230.0130.04511.83
5.3.220.0110.05311.82
5.3.210.0110.04911.82
5.3.200.0080.02811.82
5.3.190.0090.03711.82
5.3.180.0140.06611.81
5.3.170.0080.03611.81
5.3.160.0090.03411.81
5.3.150.0080.03311.81
5.3.140.0110.02811.81
5.3.130.0080.03011.81
5.3.120.0120.02911.81
5.3.110.0090.03011.80
5.3.100.0070.04011.54
5.3.90.0150.02911.52
5.3.80.0070.05311.52
5.3.70.0090.05411.52
5.3.60.0110.06911.51
5.3.50.0090.03311.48
5.3.40.0090.03411.48
5.3.30.0160.06411.46
5.3.20.0160.05311.35
5.3.10.0100.05411.33
5.3.00.0170.04511.33
5.2.170.0180.0979.19
5.2.160.0100.0899.19
5.2.150.0110.0619.19
5.2.140.0100.0819.18
5.2.130.0110.0849.14
5.2.120.0140.0819.14
5.2.110.0130.0869.15
5.2.100.0100.0499.15
5.2.90.0090.0599.14
5.2.80.0160.0879.15
5.2.70.0190.0589.14
5.2.60.0180.0789.09
5.2.50.0190.0699.07
5.2.40.0140.0529.04
5.2.30.0200.0599.02
5.2.20.0230.0859.00
5.2.10.0150.0668.92
5.2.00.0180.0498.79
5.1.60.0100.0398.07
5.1.50.0100.0318.07
5.1.40.0100.0388.05
5.1.30.0080.0408.40
5.1.20.0130.0558.42
5.1.10.0090.0548.15
5.1.00.0140.0478.15
5.0.50.0080.0446.61
5.0.40.0270.0516.48
5.0.30.0130.0646.29
5.0.20.0120.0436.26
5.0.10.0140.0436.23
5.0.00.0140.0576.22
4.4.90.0100.0334.78
4.4.80.0150.0424.76
4.4.70.0110.0574.75
4.4.60.0110.0234.75
4.4.50.0040.0284.77
4.4.40.0070.0434.71
4.4.30.0110.0584.76
4.4.20.0080.0664.85
4.4.10.0080.0444.84
4.4.00.0100.0554.75
4.3.110.0050.0544.66
4.3.100.0060.0404.67
4.3.90.0100.0394.63
4.3.80.0080.0454.59
4.3.70.0320.0354.63
4.3.60.0020.0284.63
4.3.50.0140.0404.63
4.3.40.0090.0594.54
4.3.30.0100.0473.29
4.3.20.0080.0423.27
4.3.10.0080.0363.23
4.3.00.0300.03010.37

preferences:
53.35 ms | 403 KiB | 5 Q