3v4l.org

run code in 300+ PHP versions simultaneously
<?php $User = array( 'Name' => "Hans-Peterµµ", 'Contacts' => array(1, 2, 3, 4, 5, 6, 7, 42), 'Active' => 1 ); $J = json_encode(array_utf8_encode($User)); echo $J; function array_utf8_encode($Array) { foreach($Array as &$Val) { if(is_array($Val)) { $Val = array_utf8_encode($Val); } elseif(is_string($Val)) { $Val = mb_convert_encoding($Val, 'UTF-8', 'HTML-ENTITIES'); } } return $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.3.70.0070.01116.63
8.3.60.0140.00718.20
8.3.50.0120.00721.20
8.3.40.0150.00618.71
8.3.30.0100.01018.96
8.3.20.0030.00320.21
8.3.10.0090.00020.54
8.3.00.0040.00419.38
8.2.180.0160.00918.41
8.2.170.0110.00422.96
8.2.160.0060.01120.16
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0030.00526.16
8.2.120.0070.00020.95
8.2.110.0030.00620.91
8.2.100.0060.00617.91
8.2.90.0000.00819.34
8.2.80.0060.00317.97
8.2.70.0080.00017.63
8.2.60.0090.00018.04
8.2.50.0030.00618.10
8.2.40.0000.00918.22
8.2.30.0070.00019.35
8.2.20.0000.00717.66
8.2.10.0030.00518.25
8.2.00.0040.00417.80
8.1.280.0050.01425.92
8.1.270.0070.00323.77
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0070.00421.24
8.1.230.0120.00017.70
8.1.220.0000.00917.74
8.1.210.0000.00918.77
8.1.200.0060.00317.35
8.1.190.0080.00017.48
8.1.180.0000.00818.10
8.1.170.0050.00318.43
8.1.160.0030.00522.05
8.1.150.0040.00419.01
8.1.140.0030.00717.48
8.1.130.0030.00317.88
8.1.120.0040.00417.52
8.1.110.0030.00617.52
8.1.100.0070.00017.43
8.1.90.0080.00017.48
8.1.80.0040.00417.43
8.1.70.0000.00817.45
8.1.60.0080.00017.62
8.1.50.0030.00617.57
8.1.40.0000.00717.55
8.1.30.0080.00017.56
8.1.20.0040.00417.64
8.1.10.0080.00017.48
8.1.00.0000.00817.49
8.0.300.0060.00318.77
8.0.290.0050.00516.58
8.0.280.0030.00318.52
8.0.270.0030.00317.32
8.0.260.0000.00617.37
8.0.250.0000.00716.99
8.0.240.0040.00417.05
8.0.230.0050.00216.91
8.0.220.0070.00017.02
8.0.210.0000.00816.96
8.0.200.0000.00717.04
8.0.190.0060.00316.94
8.0.180.0030.00316.88
8.0.170.0080.00017.05
8.0.160.0000.00917.00
8.0.150.0030.00316.91
8.0.140.0040.00416.93
8.0.130.0000.00513.35
8.0.120.0030.00616.86
8.0.110.0040.00416.94
8.0.100.0030.00416.79
8.0.90.0000.00817.04
8.0.80.0070.01416.97
8.0.70.0040.00416.86
8.0.60.0000.00716.91
8.0.50.0070.00016.96
8.0.30.0120.00717.11
8.0.20.0080.01017.40
8.0.10.0000.00816.98
8.0.00.0140.00416.79
7.4.330.0050.00015.00
7.4.320.0000.00616.60
7.4.300.0000.00716.68
7.4.290.0000.00716.50
7.4.280.0000.00716.65
7.4.270.0030.00316.73
7.4.260.0030.00316.59
7.4.250.0060.00316.59
7.4.240.0040.00416.66
7.4.230.0030.00316.55
7.4.220.0060.02016.70
7.4.210.0100.00716.47
7.4.200.0040.00416.47
7.4.160.0150.00616.77
7.4.150.0180.00717.40
7.4.140.0110.01017.86
7.4.130.0090.00816.51
7.4.120.0100.00716.71
7.4.110.0110.00516.55
7.4.100.0120.00416.54
7.4.90.0100.00616.67
7.4.80.0080.00919.39
7.4.70.0170.00316.66
7.4.60.0040.01216.48
7.4.50.0030.00516.43
7.4.40.0090.01116.70
7.4.30.0060.01516.69
7.3.330.0050.00013.32
7.3.320.0000.00513.35
7.3.310.0000.00716.32
7.3.300.0000.00716.36
7.3.290.0100.00616.33
7.3.280.0040.01116.36
7.3.270.0130.00617.40
7.3.260.0090.00916.43
7.3.250.0050.01116.45
7.3.240.0070.01316.55
7.3.230.0130.00316.44
7.3.210.0090.00916.34
7.3.200.0150.00419.39
7.3.190.0080.00916.40
7.3.180.0060.00916.49
7.3.170.0060.01016.52
7.3.160.0090.00616.61
7.2.330.0090.00916.49
7.2.320.0160.00316.74
7.2.310.0060.01216.77
7.2.300.0100.00616.95
7.2.290.0000.01616.77
7.2.110.0150.01116.55
7.2.100.0140.00916.62
7.2.90.0220.00316.70
7.2.80.0180.01016.76
7.2.70.0220.00616.88
7.2.60.0080.01316.93
7.2.50.0120.01917.07
7.2.40.0230.00817.01
7.2.30.0180.01216.76
7.2.20.0170.01217.15
7.2.10.0080.02016.93
7.2.00.0080.00818.18
7.1.230.0140.00715.65
7.1.220.0170.00615.91
7.1.210.0090.01815.66
7.1.200.0090.01115.62
7.1.190.0180.00716.05
7.1.180.0140.01215.91
7.1.170.0100.01215.67
7.1.160.0100.01515.91
7.1.150.0190.00615.51
7.1.140.0120.00915.80
7.1.130.0180.00615.90
7.1.120.0230.00015.62
7.1.110.0100.01015.61
7.1.100.0100.00617.13
7.1.90.0190.00716.01
7.1.80.0180.00615.70
7.1.70.0100.00616.52
7.1.60.0130.01317.81
7.1.50.0190.00916.48
7.1.40.0030.01315.87
7.1.30.4880.01315.98
7.1.20.0260.00815.95
7.1.10.0170.00915.80
7.1.00.0090.04319.16
7.0.310.0130.01315.54
7.0.300.0190.00315.47
7.0.290.0180.00715.43
7.0.280.0150.00715.44
7.0.270.0170.00615.29
7.0.260.0180.00515.13
7.0.250.0080.01315.20
7.0.240.0120.01215.43
7.0.230.0170.00815.62
7.0.220.0190.00515.66
7.0.210.0120.01215.35
7.0.200.0110.00915.07
7.0.190.0190.00515.26
7.0.180.0100.01015.60
7.0.170.0250.00515.48
7.0.160.0130.01315.52
7.0.150.0180.00715.32
7.0.140.0090.04018.64
7.0.130.0190.00715.59
7.0.120.0140.01115.43
7.0.110.0200.01415.38
7.0.100.0270.00415.32
7.0.90.0220.03817.76
7.0.80.0170.04517.58
7.0.70.0230.04217.76
7.0.60.0160.04017.69
7.0.50.0220.04417.76
7.0.40.0100.05116.78
7.0.30.0150.03816.74
7.0.20.0060.05016.82
7.0.10.0120.03416.87
7.0.00.0100.03116.80
5.6.380.0130.01314.27
5.6.370.0120.01214.46
5.6.360.0160.00914.39
5.6.350.0170.00414.57
5.6.340.0180.00714.30
5.6.330.0160.00914.34
5.6.320.0170.00814.62
5.6.310.0170.00914.32
5.6.300.0120.01414.50
5.6.290.0130.01114.27
5.6.280.0110.04017.77
5.6.270.0160.01014.19
5.6.260.0270.00014.30
5.6.250.0220.00314.56
5.6.240.0200.03417.58
5.6.230.0170.03617.41
5.6.220.0170.02817.29
5.6.210.0150.03517.46
5.6.200.0120.02917.70
5.6.190.0210.03517.59
5.6.180.0140.04017.62
5.6.170.0130.04317.79
5.6.160.0110.04817.76
5.6.150.0160.04117.69
5.6.140.0140.04017.80
5.6.130.0100.04617.69
5.6.120.0100.04917.62
5.6.110.0130.03317.51
5.6.100.0110.03417.69
5.6.90.0090.02917.63
5.6.80.0070.02717.28
5.6.70.0120.02417.37
5.6.60.0110.02617.34
5.6.50.0080.02917.28
5.6.40.0080.02717.32
5.6.30.0080.02617.26
5.6.20.0100.02217.30
5.6.10.0140.01917.20
5.6.00.0100.02617.35
5.5.380.0090.04015.72
5.5.370.0090.03415.88
5.5.360.0040.04115.65
5.5.350.0120.03915.68
5.5.340.0110.04116.06
5.5.330.0200.02215.95
5.5.320.0080.03516.00
5.5.310.0100.04715.86
5.5.300.0100.04016.08
5.5.290.0130.04116.10
5.5.280.0100.04315.96
5.5.270.0120.02816.05
5.5.260.0080.03815.89
5.5.250.0070.03915.96
5.5.240.0090.02315.60
5.5.230.0040.02415.57
5.5.220.0090.02315.66
5.5.210.0030.02615.66
5.5.200.0080.03015.51
5.5.190.0000.02615.58
5.5.180.0090.03415.63
5.5.170.0080.01314.21
5.5.160.0040.02415.55
5.5.150.0060.02915.64
5.5.140.0040.02415.64
5.5.130.0060.02115.28
5.5.120.0070.02315.66
5.5.110.0090.03215.62
5.5.100.0110.01915.70
5.5.90.0130.03115.59
5.5.80.0080.02315.72
5.5.70.0090.01715.63
5.5.60.0080.02115.59
5.5.50.0110.01515.48
5.5.40.0040.03715.51
5.5.30.0040.02615.51
5.5.20.0100.02015.52
5.5.10.0120.01815.61
5.5.00.0080.02215.58
5.4.450.0110.04215.23
5.4.440.0120.02815.37
5.4.430.0120.04215.09
5.4.420.0090.03115.28
5.4.410.0080.02315.27
5.4.400.0080.02515.10
5.4.390.0070.02415.10
5.4.380.0060.02515.13
5.4.370.0070.03515.00
5.4.360.0060.02515.13
5.4.350.0110.01815.06
5.4.340.0030.02815.08
5.4.330.0090.00210.91
5.4.320.0020.02814.91
5.4.310.0070.02315.10
5.4.300.0080.02014.97
5.4.290.0070.02314.92
5.4.280.0110.01714.95
5.4.270.0100.02014.98
5.4.260.0100.01815.12
5.4.250.0050.02614.97
5.4.240.0050.02315.01
5.4.230.0110.01714.96
5.4.220.0080.02715.14
5.4.210.0070.02314.98
5.4.200.0110.01615.16
5.4.190.0070.01914.98
5.4.180.0070.02214.74
5.4.170.0090.02015.12
5.4.160.0060.02014.94
5.4.150.0100.02615.03
5.4.140.0040.02113.75
5.4.130.0090.01913.66
5.4.120.0100.01813.71
5.4.110.0090.04113.69
5.4.100.0090.02713.81
5.4.90.0040.03513.72
5.4.80.0050.02113.80
5.4.70.0050.02413.83
5.4.60.0050.02213.72
5.4.50.0070.02213.85
5.4.40.0040.02413.66
5.4.30.0070.02013.60
5.4.20.0070.01813.60
5.4.10.0040.03113.86
5.4.00.0100.02913.36
5.3.290.0060.02212.70
5.3.280.0030.02712.62
5.3.270.0050.02212.56
5.3.260.0060.02012.60
5.3.250.0050.02912.65
5.3.240.0030.02212.65
5.3.230.0080.02312.63
5.3.220.0090.03212.66
5.3.210.0060.02112.65
5.3.200.0060.02212.57
5.3.190.0060.02312.64
5.3.180.0080.02112.49
5.3.170.0030.01812.55
5.3.160.0070.02112.57
5.3.150.0040.02412.65
5.3.140.0100.02412.58
5.3.130.0070.01612.60
5.3.120.0080.02012.58
5.3.110.0070.04212.58
5.3.100.0080.03512.39
5.3.90.0100.02512.21
5.3.80.0090.03912.26
5.3.70.0070.03812.31
5.3.60.0110.03512.27
5.3.50.0060.02712.23
5.3.40.0070.04012.16
5.3.30.0110.03912.27
5.3.20.0100.03712.14
5.3.10.0110.02112.03
5.3.00.0040.02612.02
5.2.170.0070.03710.71
5.2.160.0030.02810.67
5.2.150.0050.03310.77
5.2.140.0070.02010.73
5.2.130.0090.02010.67
5.2.120.0030.02510.77
5.2.110.0070.03310.71
5.2.100.0070.01810.73
5.2.90.0110.03010.81
5.2.80.0120.02010.81
5.2.70.0030.03510.70
5.2.60.0060.03510.74
5.2.50.0020.03310.76
5.2.40.0020.03110.72
5.2.30.0080.02610.71
5.2.20.0100.02510.67
5.2.10.0030.03310.63
5.2.00.0070.02210.53
5.1.60.0080.02710.53
5.1.50.0100.02310.53
5.1.40.0070.03010.53
5.1.30.0070.02510.53
5.1.20.0050.03010.53
5.1.10.0050.02910.53
5.1.00.0030.03310.53
5.0.50.0030.02810.53
5.0.40.0020.02610.53
5.0.30.0060.02810.53
5.0.20.0030.02510.53
5.0.10.0040.02510.53
5.0.00.0050.02510.53
4.4.90.0070.01210.53
4.4.80.0060.01510.53
4.4.70.0020.01210.53
4.4.60.0030.01910.53
4.4.50.0030.02010.53
4.4.40.0030.03010.53
4.4.30.0000.02210.53
4.4.20.0050.01710.53
4.4.10.0030.01810.53
4.4.00.0050.01910.53
4.3.110.0070.01210.53
4.3.100.0050.01710.53
4.3.90.0020.01610.53
4.3.80.0030.02010.53
4.3.70.0040.01710.53
4.3.60.0040.01810.53
4.3.50.0020.02210.53
4.3.40.0120.01710.53
4.3.30.0000.01510.53
4.3.20.0020.02010.53
4.3.10.0020.02010.53
4.3.00.0040.01310.53

preferences:
48.53 ms | 401 KiB | 5 Q