3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Issue 1, empty associative arrays (dictionaries) become regular arrays. $dictionary = array('key' => 'value'); var_dump(json_encode($dictionary)); // gives '{"key":"value"}'; unset($dictionary['key']); var_dump(json_encode($dictionary)); // Gives '[]' -> json dictionary turned into array var_dump(json_encode((Object)$dictionary)); // Gives '{}' -> json dictionary stays dictionary // Issue 2, array manipulations that involve the array indexes, turn numeric arrays into dictionaries. $fruits = array("apples", "oranges"); var_dump(json_encode($fruits)); // Gives ["apples", "oranges"] unset($fruits[0]); // Don't like apples. var_dump(json_encode($fruits)); // Gives '{"1":"oranges"}' -> wow, array turned into dictionary.

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.0130.00316.63
8.3.50.0180.01022.83
8.3.40.0120.00318.70
8.3.30.0060.00918.95
8.3.20.0000.00720.34
8.3.10.0040.00423.47
8.3.00.0040.00417.63
8.2.180.0120.00616.88
8.2.170.0040.01122.96
8.2.160.0070.00720.29
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00321.03
8.2.110.0100.00022.14
8.2.100.0000.01117.91
8.2.90.0030.00618.99
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0040.00419.95
8.2.30.0040.00417.95
8.2.20.0000.00817.57
8.2.10.0050.00317.98
8.2.00.0000.00717.56
8.1.280.0120.00625.92
8.1.270.0050.00323.97
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.82
8.1.230.0070.00419.16
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0050.00517.22
8.1.190.0000.00817.10
8.1.180.0050.00318.10
8.1.170.0040.00418.46
8.1.160.0000.00722.00
8.1.150.0000.00818.89
8.1.140.0000.00717.30
8.1.130.0030.00317.83
8.1.120.0050.00217.41
8.1.110.0030.00617.43
8.1.100.0040.00417.44
8.1.90.0000.00717.42
8.1.80.0000.00717.41
8.1.70.0070.00017.42
8.1.60.0040.00417.59
8.1.50.0000.00817.38
8.1.40.0000.00817.42
8.1.30.0030.00617.53
8.1.20.0090.00017.63
8.1.10.0000.00717.47
8.1.00.0030.00617.43
8.0.300.0040.00418.77
8.0.290.0000.00916.63
8.0.280.0000.00718.30
8.0.270.0030.00317.12
8.0.260.0000.00617.13
8.0.250.0030.00316.90
8.0.240.0000.00816.85
8.0.230.0000.00716.76
8.0.220.0030.00316.74
8.0.210.0030.00316.84
8.0.200.0040.00416.96
8.0.190.0090.00016.81
8.0.180.0000.00716.91
8.0.170.0030.00516.88
8.0.160.0040.00316.73
8.0.150.0000.00716.80
8.0.140.0000.00716.76
8.0.130.0000.00613.17
8.0.120.0050.00316.73
8.0.110.0000.00716.86
8.0.100.0040.00416.66
8.0.90.0080.00016.82
8.0.80.0040.01416.77
8.0.70.0040.00416.81
8.0.60.0040.00416.88
8.0.50.0000.00716.66
8.0.30.0110.01116.83
8.0.20.0080.01017.40
8.0.10.0040.00416.91
8.0.00.0080.01116.72
7.4.330.0050.00015.09
7.4.320.0070.00016.52
7.4.300.0040.00416.65
7.4.290.0000.00716.51
7.4.280.0050.00616.55
7.4.270.0040.00416.66
7.4.260.0030.00316.59
7.4.250.0070.00016.56
7.4.240.0030.00516.56
7.4.230.0070.00016.35
7.4.220.0130.00916.63
7.4.210.0090.00516.55
7.4.200.0000.00816.63
7.4.160.0060.01016.52
7.4.150.0090.00917.40
7.4.140.0090.01117.86
7.4.130.0100.00716.63
7.4.120.0020.01416.57
7.4.110.0070.01016.62
7.4.100.0070.01016.45
7.4.90.0100.01016.59
7.4.80.0070.01319.39
7.4.70.0090.00916.59
7.4.60.0090.00616.44
7.4.50.0000.00516.05
7.4.40.0060.00916.31
7.4.30.0100.01016.41
7.4.10.0110.00715.48
7.4.00.0100.00415.39
7.3.330.0050.00012.91
7.3.320.0000.00612.92
7.3.310.0000.00716.29
7.3.300.0000.00716.21
7.3.290.0000.01716.23
7.3.280.0060.01216.20
7.3.270.0070.01017.40
7.3.260.0140.00316.19
7.3.250.0120.00516.38
7.3.240.0170.00716.50
7.3.230.0130.01016.39
7.3.210.0100.00716.19
7.3.200.0060.01319.39
7.3.190.0070.01016.19
7.3.180.0080.00816.26
7.3.170.0060.01516.27
7.3.160.0190.00316.46
7.3.130.0090.00815.56
7.3.120.0050.01115.24
7.3.110.0060.01015.22
7.3.100.0030.01015.10
7.3.90.0040.01015.35
7.3.80.0050.00515.34
7.3.70.0030.01215.30
7.3.60.0060.01115.07
7.3.50.0070.01015.15
7.3.40.0050.00715.13
7.3.30.0050.01015.24
7.3.20.0080.00517.12
7.3.10.0040.00917.08
7.3.00.0030.01117.07
7.2.330.0070.01116.58
7.2.320.0080.00816.48
7.2.310.0140.01016.49
7.2.300.0100.00716.66
7.2.290.0030.01516.27
7.2.260.0090.00915.71
7.2.250.0090.00915.61
7.2.240.0050.00915.51
7.2.230.0070.00915.38
7.2.220.0100.00615.37
7.2.210.0040.01015.29
7.2.200.0060.01015.43
7.2.190.0070.01115.47
7.2.180.0040.01015.46
7.2.170.0060.01015.31
7.2.160.0070.00615.33
7.2.150.0030.01017.27
7.2.140.0020.00917.36
7.2.130.0040.00917.39
7.2.120.0040.01017.10
7.2.110.0030.00817.04
7.2.100.0070.00817.15
7.2.90.0060.00817.04
7.2.80.0090.00617.20
7.2.70.0050.00817.08
7.2.60.0070.00817.15
7.2.50.0060.01117.09
7.2.40.0050.00717.13
7.2.30.0070.00717.13
7.2.20.0030.01117.15
7.2.10.0080.00817.13
7.2.00.0050.00817.60
7.1.330.0060.00816.28
7.1.320.0050.00716.34
7.1.310.0090.00416.21
7.1.300.0080.00816.35
7.1.290.0040.00916.23
7.1.280.0030.01116.29
7.1.270.0080.00616.24
7.1.260.0050.00916.28
7.1.250.0050.00816.18
7.1.240.0070.00716.25
7.1.230.0040.00916.23
7.1.220.0030.00916.22
7.1.210.0030.00816.22
7.1.200.0090.00516.16
7.1.190.0050.00816.18
7.1.180.0040.01116.24
7.1.170.0090.00716.21
7.1.160.0090.00516.25
7.1.150.0050.00716.21
7.1.140.0100.00516.27
7.1.130.0060.00716.28
7.1.120.0060.00916.15
7.1.110.0080.00616.29
7.1.100.0060.00716.67
7.1.90.0030.01016.13
7.1.80.0040.00716.36
7.1.70.0060.00516.29
7.1.60.0050.00917.03
7.1.50.0040.01216.44
7.1.40.0110.00216.26
7.1.30.0070.00616.41
7.1.20.0010.01016.11
7.1.10.0030.00916.35
7.1.00.0050.02417.77
7.0.330.0030.00816.03
7.0.320.0050.00415.93
7.0.310.0040.00715.79
7.0.300.0050.00715.92
7.0.290.0040.00915.98
7.0.280.0060.00815.87
7.0.270.0080.00515.87
7.0.260.0050.00515.90
7.0.250.0090.00615.93
7.0.240.0090.00415.86
7.0.230.0050.00515.78
7.0.220.0050.00815.92
7.0.210.0050.00716.02
7.0.200.0060.00615.99
7.0.190.0050.00715.97
7.0.180.0050.00715.86
7.0.170.0060.00715.96
7.0.160.0050.00915.91
7.0.150.0050.00715.92
7.0.140.0070.02017.46
7.0.130.0050.00915.87
7.0.120.0040.00516.00
7.0.110.0060.00415.86
7.0.100.0040.00915.88
7.0.90.0140.03016.96
7.0.80.0170.01716.93
7.0.70.0170.02716.81
7.0.60.0150.02116.89
7.0.50.0130.02417.08
7.0.40.0080.02415.55
7.0.30.0080.01615.46
7.0.20.0040.02615.43
7.0.10.0030.02015.52
7.0.00.0090.02315.51
5.6.400.0050.00815.16
5.6.390.0040.00815.00
5.6.380.0060.00714.78
5.6.370.0050.00714.87
5.6.360.0040.00914.88
5.6.350.0070.00714.96
5.6.340.0050.00814.89
5.6.330.0060.00814.84
5.6.320.0030.00914.90
5.6.310.0050.01014.81
5.6.300.0070.00514.65
5.6.290.0050.00814.81
5.6.280.0070.02016.37
5.6.270.0040.00914.71
5.6.260.0040.00714.90
5.6.250.0070.00614.82
5.6.240.0050.01916.29
5.6.230.0090.02616.27
5.6.220.0070.02116.33
5.6.210.0080.02716.38
5.6.200.0080.02316.48
5.6.190.0040.02916.25
5.6.180.0040.02416.49
5.6.170.0060.02616.35
5.6.160.0080.02516.38
5.6.150.0090.02316.40
5.6.140.0080.01816.21
5.6.130.0070.02116.42
5.6.120.0070.02516.30
5.6.110.0070.02916.36
5.6.100.0040.02416.30
5.6.90.0080.02016.27
5.6.80.0050.02516.21
5.6.70.0070.02216.11
5.6.60.0080.02216.12
5.6.50.0100.02216.06
5.6.40.0080.02316.04
5.6.30.0100.02116.25
5.6.20.0080.02216.11
5.6.10.0080.02316.09
5.6.00.0060.02716.11
5.5.380.0030.02715.35
5.5.370.0080.01615.44
5.5.360.0080.02515.45
5.5.350.0030.02515.35
5.5.340.0080.01315.46
5.5.330.0040.02615.51
5.5.320.0040.02615.42
5.5.310.0050.02715.50
5.5.300.0050.02315.51
5.5.290.0060.02515.52
5.5.280.0060.02515.57
5.5.270.0050.01815.56
5.5.260.0050.02115.60
5.5.250.0030.02615.44
5.5.240.0070.01815.32
5.5.230.0060.01915.22
5.5.220.0060.02515.31
5.5.210.0090.02015.24
5.5.200.0060.02315.42
5.5.190.0070.02415.41
5.5.180.0070.01715.34
5.5.170.0030.00914.67
5.5.160.0030.02315.34
5.5.150.0080.01715.32
5.5.140.0070.02315.38
5.5.130.0030.02515.28
5.5.120.0080.02115.30
5.5.110.0080.02215.15
5.5.100.0060.02515.31
5.5.90.0050.02515.20
5.5.80.0060.02215.30
5.5.70.0050.02215.30
5.5.60.0060.02415.32
5.5.50.0090.02315.22
5.5.40.0050.01815.34
5.5.30.0080.02415.27
5.5.20.0050.02115.26
5.5.10.0080.01415.34
5.5.00.0070.01315.27
5.4.450.0060.02313.47
5.4.440.0060.02413.59
5.4.430.0050.02413.44
5.4.420.0020.01913.41
5.4.410.0040.02413.43
5.4.400.0040.02113.31
5.4.390.0040.02413.47
5.4.380.0060.02313.32
5.4.370.0050.01613.42
5.4.360.0040.01813.48
5.4.350.0060.02313.47
5.4.340.0070.02113.37
5.4.330.0030.00811.55
5.4.320.0070.02013.39
5.4.310.0050.02513.29
5.4.300.0030.02313.37
5.4.290.0080.01813.41
5.4.280.0070.02213.29
5.4.270.0060.02213.42
5.4.260.0050.02213.47
5.4.250.0100.01113.42
5.4.240.0020.01613.47
5.4.230.0050.02013.43
5.4.220.0040.02113.30
5.4.210.0100.01713.40
5.4.200.0060.02313.42
5.4.190.0070.01913.31
5.4.180.0050.02313.39
5.4.170.0090.02013.42
5.4.160.0050.02213.45
5.4.150.0050.01613.25
5.4.140.0060.02312.75
5.4.130.0080.02012.71
5.4.120.0080.02012.72
5.4.110.0050.02312.69
5.4.100.0060.02012.72
5.4.90.0050.02112.71
5.4.80.0050.01612.62
5.4.70.0060.02212.68
5.4.60.0060.01812.76
5.4.50.0060.01812.75
5.4.40.0040.02412.73
5.4.30.0030.02412.69
5.4.20.0020.02012.76
5.4.10.0080.02112.74
5.4.00.0050.01712.63
5.3.290.0070.04412.89
5.3.280.0040.03712.88
5.3.270.0020.03012.89
5.3.260.0100.02312.89
5.3.250.0080.03912.89
5.3.240.0090.03812.87
5.3.230.0020.03212.87
5.3.220.0050.03812.85
5.3.210.0030.04512.84
5.3.200.0100.03312.90
5.3.190.0030.04012.89
5.3.180.0080.03312.91
5.3.170.0040.04412.91
5.3.160.0080.03712.90
5.3.150.0090.03812.89
5.3.140.0070.02612.82
5.3.130.0070.02312.92
5.3.120.0070.04012.84
5.3.110.0050.02812.91
5.3.100.0050.02212.64
5.3.90.0050.03612.57
5.3.80.0060.03812.64
5.3.70.0030.02712.60
5.3.60.0150.02812.63
5.3.50.0030.03712.61
5.3.40.0060.02212.58
5.3.30.0040.02212.57
5.3.20.0050.03312.48
5.3.10.0010.02112.44
5.3.00.0050.01712.43
5.2.170.0040.03411.24
5.2.160.0050.03111.17
5.2.150.0060.01611.22
5.2.140.0030.01811.24
5.2.130.0060.02611.10
5.2.120.0000.01611.11
5.2.110.0030.01511.16
5.2.100.0050.02911.18
5.2.90.0020.02811.18
5.2.80.0000.02511.09
5.2.70.0030.01611.18
5.2.60.0020.01611.18
5.2.50.0050.01511.05
5.2.40.0060.01311.09
5.2.30.0060.01311.05
5.2.20.0050.02511.01
5.2.10.0040.01511.06
5.2.00.0030.01511.00
5.1.60.0030.01310.65
5.1.50.0030.01310.65
5.1.40.0040.01510.66
5.1.30.0020.01510.83
5.1.20.0040.02710.83
5.1.10.0020.01310.68
5.1.00.0040.01210.68
5.0.50.0070.01810.09
5.0.40.0030.00810.09
5.0.30.0050.03310.09
5.0.20.0050.01710.09
5.0.10.0000.01810.09
5.0.00.0000.02010.09
4.4.90.0030.01210.09
4.4.80.0030.01110.09
4.4.70.0020.00810.09
4.4.60.0000.01110.09
4.4.50.0030.01010.09
4.4.40.0000.01510.09
4.4.30.0020.01210.09
4.4.20.0010.01610.09
4.4.10.0000.01710.09
4.4.00.0020.01310.09
4.3.110.0000.02110.09
4.3.100.0020.02110.09
4.3.90.0030.01010.09
4.3.80.0020.01310.09
4.3.70.0020.00710.09
4.3.60.0030.00810.09
4.3.50.0030.00810.09
4.3.40.0020.01210.09
4.3.30.0010.02010.09
4.3.20.0000.02010.09
4.3.10.0000.01210.09
4.3.00.0000.01210.09

preferences:
59.01 ms | 401 KiB | 5 Q