3v4l.org

run code in 300+ PHP versions simultaneously
<?php function transfer( $arr, $prefix=array(), $glue="_" ) { $res = array(); foreach( $arr as $key => $val ) { $key = array_merge( $prefix, array($key) ); if( is_array($val) ) $res = array_merge( $res, transfer( $val, $key, $glue ) ); else $res[ implode($glue, $key) ] = $val; } return $res; } $attributes = array( 'Users' => array( 'Name' => 'Name', ), 'Address' => 'Address', 'Tags' => array( 0 => array( 'Key' => 'Key', 'Value' => 'Value', ), 1 => array( 'Key' => 'Key', ), 2 => array( ) ), ); var_dump( transfer( $attributes ) );

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.3.60.0110.01118.43
8.3.50.0140.00721.99
8.3.40.0130.00318.75
8.3.30.0070.00719.23
8.3.20.0040.00420.35
8.3.10.0040.00421.72
8.3.00.0080.00019.13
8.2.180.0140.00717.93
8.2.170.0100.00722.96
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00019.66
8.2.110.0030.00620.28
8.2.100.0070.00318.34
8.2.90.0050.00318.22
8.2.80.0000.00818.16
8.2.70.0030.00718.03
8.2.60.0040.00418.07
8.2.50.0080.00018.10
8.2.40.0000.00922.38
8.2.30.0070.00019.30
8.2.20.0080.00017.67
8.2.10.0040.00418.06
8.2.00.0030.00617.82
8.1.280.0070.00725.92
8.1.270.0090.00018.77
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0000.00820.77
8.1.230.0090.00320.90
8.1.220.0040.00417.74
8.1.210.0090.00018.79
8.1.200.0040.00417.13
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0060.00318.82
8.1.160.0080.00020.38
8.1.150.0000.00718.85
8.1.140.0000.00717.50
8.1.130.0030.00317.80
8.1.120.0040.00417.39
8.1.110.0050.00317.31
8.1.100.0000.00717.47
8.1.90.0000.00717.37
8.1.80.0040.00417.53
8.1.70.0040.00417.46
8.1.60.0030.00517.47
8.1.50.0000.00817.59
8.1.40.0030.00617.50
8.1.30.0030.00517.55
8.1.20.0030.00517.62
8.1.10.0030.00517.57
8.1.00.0060.00617.53
8.0.300.0040.00419.60
8.0.290.0060.00316.63
8.0.280.0040.00418.52
8.0.270.0000.00717.14
8.0.260.0030.00317.16
8.0.250.0000.00816.86
8.0.240.0040.00416.96
8.0.230.0000.00816.96
8.0.220.0040.00416.87
8.0.210.0040.00416.91
8.0.200.0040.00417.01
8.0.190.0040.00416.98
8.0.180.0000.00716.82
8.0.170.0000.00716.89
8.0.160.0040.00417.02
8.0.150.0080.00016.68
8.0.140.0000.00716.91
8.0.130.0070.00013.38
8.0.120.0060.00316.76
8.0.110.0000.00716.93
8.0.100.0000.00816.95
8.0.90.0000.00716.70
8.0.80.0060.00916.79
8.0.70.0040.00416.84
8.0.60.0000.00816.72
8.0.50.0040.00416.78
8.0.30.0160.00317.18
8.0.20.0130.00617.44
8.0.10.0040.00417.05
8.0.00.0100.00916.83
7.4.330.0030.00315.20
7.4.320.0030.00316.51
7.4.300.0000.00616.61
7.4.290.0070.00016.47
7.4.280.0030.00516.58
7.4.270.0000.00716.54
7.4.260.0000.00816.59
7.4.250.0040.00416.37
7.4.240.0040.00316.64
7.4.230.0070.00016.43
7.4.220.0140.00716.62
7.4.210.0030.01316.53
7.4.200.0000.00816.72
7.4.160.0030.01216.32
7.4.150.0090.01317.40
7.4.140.0050.01517.86
7.4.130.0090.00816.48
7.4.120.0040.01316.48
7.4.110.0050.01516.55
7.4.100.0110.00716.64
7.4.90.0090.00916.47
7.4.80.0100.01319.39
7.4.70.0030.01316.41
7.4.60.0060.01016.48
7.4.50.0050.00316.35
7.4.40.0130.01016.26
7.4.30.0090.00916.78
7.4.00.0110.00714.80
7.3.330.0000.00613.34
7.3.320.0050.00013.41
7.3.310.0000.00716.25
7.3.300.0030.00316.27
7.3.290.0100.00616.40
7.3.280.0110.00916.41
7.3.270.0180.00717.40
7.3.260.0090.00916.56
7.3.250.0050.01416.30
7.3.240.0040.01316.66
7.3.230.0070.01716.39
7.3.210.0140.00916.70
7.3.200.0090.01219.39
7.3.190.0040.01416.50
7.3.180.0140.00916.64
7.3.170.0100.01016.43
7.3.160.0170.00016.40
7.3.10.0080.00616.49
7.3.00.0110.00716.34
7.2.330.0090.00916.77
7.2.320.0130.01016.86
7.2.310.0210.00316.68
7.2.300.0140.00316.86
7.2.290.0060.01216.72
7.2.130.0040.00616.71
7.2.120.0090.01016.64
7.2.110.0160.00616.85
7.2.100.0090.00716.65
7.2.90.0140.01017.04
7.2.80.0080.01016.80
7.2.70.0110.01216.83
7.2.60.0080.00916.76
7.2.50.0190.00316.77
7.2.40.0110.00917.01
7.2.30.0050.01216.68
7.2.20.0070.00916.66
7.2.10.0080.00816.83
7.2.00.0090.00417.73
7.1.250.0060.00715.54
7.1.240.0070.00715.48
7.1.230.0000.01715.76
7.1.220.0040.01115.39
7.1.210.0000.01115.71
7.1.200.0100.00815.68
7.1.190.0060.00615.61
7.1.180.0030.01015.81
7.1.170.0030.01015.92
7.1.160.0030.01015.39
7.1.150.0030.00515.70
7.1.140.0070.00715.80
7.1.130.0000.00915.73
7.1.120.0070.01015.63
7.1.110.0090.00015.59
7.1.100.0050.00917.07
7.1.90.0060.00915.87
7.1.80.0040.00815.74
7.1.70.0030.00816.52
7.1.60.0040.00917.64
7.1.50.0070.00716.13
7.1.40.0040.01115.70
7.1.30.0030.00515.99
7.1.20.0040.00415.95
7.1.10.0070.00715.84
7.1.00.0000.04619.04
7.0.330.0030.00615.48
7.0.320.0070.00715.44
7.0.310.0050.00515.33
7.0.300.0090.00615.36
7.0.290.0090.00315.15
7.0.280.0030.01015.33
7.0.270.0110.00315.14
7.0.260.0070.00715.30
7.0.250.0060.00915.41
7.0.240.0000.01515.18
7.0.230.0000.00815.31
7.0.220.0060.00615.50
7.0.210.0030.01315.21
7.0.200.0060.00516.07
7.0.190.0000.01015.51
7.0.180.0000.01115.50
7.0.170.0030.01315.19
7.0.160.0070.00715.41
7.0.150.0070.00315.29
7.0.140.0020.03618.55
7.0.130.0000.01215.31
7.0.120.0060.00715.59
7.0.110.0030.00715.49
7.0.100.0060.00915.10
7.0.90.0070.01015.43
7.0.80.0060.00615.12
7.0.70.0060.00615.20
7.0.60.0080.04017.72
7.0.50.0080.04016.54
7.0.40.0050.02516.76
7.0.30.0300.03216.84
7.0.20.0170.02816.69
7.0.10.0040.02516.81
7.0.00.0080.04216.93
5.6.380.0040.00713.84
5.6.370.0030.01014.32
5.6.360.0100.00314.55
5.6.350.0000.01514.56
5.6.340.0030.01014.39
5.6.330.0060.00914.36
5.6.320.0060.00314.18
5.6.310.0000.00914.59
5.6.300.0070.00714.51
5.6.290.0060.00314.52
5.6.280.0080.03717.69
5.6.270.0140.00014.31
5.6.260.0070.00714.79
5.6.250.0040.01114.54
5.6.240.0030.00614.16
5.6.230.0070.00714.36
5.6.220.0090.00614.56
5.6.210.0070.04517.40
5.6.200.0030.04816.16
5.6.190.0090.04417.56
5.6.180.0180.03617.29
5.6.170.0090.02717.26
5.6.160.0050.04617.51
5.6.150.0070.04416.18
5.6.140.0060.03716.39
5.6.130.0060.02216.24
5.6.120.0030.04817.65
5.6.110.0120.03917.65
5.6.100.0110.03117.76
5.6.90.0130.03317.72
5.6.80.0070.03717.20
5.6.70.0000.01514.52
5.6.60.0060.00914.34
5.6.50.0110.00013.88
5.6.40.0130.00014.22
5.6.30.0030.01014.28
5.6.20.0080.00014.39
5.6.10.0040.01114.29
5.6.00.0000.01614.19
5.5.380.0000.01011.16
5.5.370.0060.00611.24
5.5.360.0070.00311.20
5.5.350.0130.03115.79
5.5.340.0060.02314.81
5.5.330.0070.03315.70
5.5.320.0200.04015.68
5.5.310.0210.02315.54
5.5.300.0020.02114.39
5.5.290.0050.02214.62
5.5.280.0110.04015.72
5.5.270.0060.02316.00
5.5.260.0110.03716.01
5.5.250.0070.02015.80
5.5.240.0050.02615.58
5.5.230.0060.00611.11
5.5.220.0100.00310.92
5.5.210.0000.01111.14
5.5.200.0040.00410.84
5.5.190.0030.00611.19
5.5.180.0030.00311.28
5.5.170.0000.00811.28
5.5.160.0000.00611.13
5.5.150.0030.00911.32
5.5.140.0040.00411.21
5.5.130.0030.00311.35
5.5.120.0000.01111.01
5.5.110.0030.00711.30
5.5.100.0000.00911.14
5.5.90.0030.00311.30
5.5.80.0050.00311.05
5.5.70.0000.00710.96
5.5.60.0070.00011.20
5.5.50.0030.00610.82
5.5.40.0000.01011.19
5.5.30.0030.00711.28
5.5.20.0000.00711.00
5.5.10.0070.00311.30
5.5.00.0000.00710.93
5.4.450.0170.02715.38
5.4.440.0180.04315.14
5.4.430.0130.02615.27
5.4.420.0150.02215.16
5.4.410.0170.04015.08
5.4.400.0120.02315.30
5.4.390.0180.03815.01
5.4.380.0160.02315.08
5.4.370.0120.02315.33
5.4.360.0150.02015.20
5.4.350.0170.01815.18
5.4.340.0200.03815.30
5.4.330.0040.00411.13
5.4.320.0160.02515.33
5.4.310.0160.02415.10
5.4.300.0170.02215.31
5.4.290.0160.04314.97
5.4.280.0090.02915.11
5.4.270.0210.03115.21
5.4.260.0140.02314.96
5.4.250.0120.02515.18
5.4.240.0180.03814.89
5.4.230.0200.03515.06
5.4.220.0150.02515.20
5.4.210.0130.02215.10
5.4.200.0130.04215.14
5.4.190.0170.03214.91
5.4.180.0170.03915.21
5.4.170.0200.01915.08
5.4.160.0120.04215.04
5.4.150.0180.02615.06
5.4.140.0150.03613.71
5.4.130.0190.03613.85
5.4.120.0180.03314.03
5.4.110.0170.03413.70
5.4.100.0150.03013.67
5.4.90.0180.03313.78
5.4.80.0160.02313.97
5.4.70.0130.03313.83
5.4.60.0080.02313.75
5.4.50.0180.03813.80
5.4.40.0130.02313.66
5.4.30.0130.02513.74
5.4.20.0130.04213.91
5.4.10.0190.03513.73
5.4.00.0180.02813.65
5.3.290.0150.03813.50
5.3.280.0110.03813.49
5.3.270.0130.03113.49
5.3.260.0130.02713.50
5.3.250.0130.04013.49
5.3.240.0100.02513.49
5.3.230.0150.03313.49
5.3.220.0170.02213.49
5.3.210.0150.02513.49
5.3.200.0150.02113.49
5.3.190.0200.02213.49
5.3.180.0080.03413.49
5.3.170.0200.02613.53
5.3.160.0190.03513.51
5.3.150.0140.04013.53
5.3.140.0160.02213.54
5.3.130.0160.04113.49
5.3.120.0160.03613.49
5.3.110.0150.03413.49
5.3.100.0170.03613.49
5.3.90.0200.03513.50
5.3.80.0190.02013.49
5.3.70.0150.02513.49
5.3.60.0130.02313.49
5.3.50.0170.03313.49
5.3.40.0190.02013.49
5.3.30.0150.03813.49
5.3.20.0150.03913.49
5.3.10.0190.03213.49
5.3.00.0160.02313.49
5.2.170.0110.03513.49
5.2.160.0130.02113.49
5.2.150.0100.02713.49
5.2.140.0120.02213.49
5.2.130.0150.02813.49
5.2.120.0120.03313.49
5.2.110.0130.02513.49
5.2.100.0080.02213.49
5.2.90.0070.02113.49
5.2.80.0170.02913.49
5.2.70.0080.02313.49
5.2.60.0100.02813.49
5.2.50.0100.03413.49
5.2.40.0120.02813.49
5.2.30.0130.03013.49
5.2.20.0070.02613.49
5.2.10.0080.02013.49
5.2.00.0100.03013.49
5.1.60.0120.02213.49
5.1.50.0080.01513.49
5.1.40.0080.01813.49
5.1.30.0120.01813.49
5.1.20.0150.02013.49
5.1.10.0100.03013.49
5.1.00.0120.01813.49
5.0.50.0070.02613.49
5.0.40.0050.02513.49
5.0.30.0070.03713.49
5.0.20.0070.02313.49
5.0.10.0080.01513.49
5.0.00.0050.01713.49
4.4.90.0080.01613.49
4.4.80.0050.01013.49
4.4.70.0070.01813.49
4.4.60.0050.01313.49
4.4.50.0030.01513.49
4.4.40.0050.01513.49
4.4.30.0060.02013.49
4.4.20.0030.01313.49
4.4.10.0080.01813.49
4.4.00.0050.01313.49
4.3.110.0030.01113.49
4.3.100.0050.01213.49
4.3.90.0040.01913.49
4.3.80.0100.01713.49
4.3.70.0080.01313.49
4.3.60.0070.01213.49
4.3.50.0050.02113.49
4.3.40.0030.01913.49
4.3.30.0020.02013.49
4.3.20.0030.01313.49
4.3.10.0060.01313.49
4.3.00.0000.01313.49

preferences:
44.76 ms | 401 KiB | 5 Q