3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json_data = array ('id'=>1,'name'=>"фыфыывфы",'country'=>'Russia'); function json_encode_cyr($str) { $arr_replace_utf = array('\u0410', '\u0430','\u0411','\u0431','\u0412','\u0432', '\u0413','\u0433','\u0414','\u0434','\u0415','\u0435','\u0401','\u0451','\u0416', '\u0436','\u0417','\u0437','\u0418','\u0438','\u0419','\u0439','\u041a','\u043a', '\u041b','\u043b','\u041c','\u043c','\u041d','\u043d','\u041e','\u043e','\u041f', '\u043f','\u0420','\u0440','\u0421','\u0441','\u0422','\u0442','\u0423','\u0443', '\u0424','\u0444','\u0425','\u0445','\u0426','\u0446','\u0427','\u0447','\u0428', '\u0448','\u0429','\u0449','\u042a','\u044a','\u042b','\u044b','\u042c','\u044c', '\u042d','\u044d','\u042e','\u044e','\u042f','\u044f'); $arr_replace_cyr = array('А', 'а', 'Б', 'б', 'В', 'в', 'Г', 'г', 'Д', 'д', 'Е', 'е', 'Ё', 'ё', 'Ж','ж','З','з','И','и','Й','й','К','к','Л','л','М','м','Н','н','О','о', 'П','п','Р','р','С','с','Т','т','У','у','Ф','ф','Х','х','Ц','ц','Ч','ч','Ш','ш', 'Щ','щ','Ъ','ъ','Ы','ы','Ь','ь','Э','э','Ю','ю','Я','я'); $str1 = json_encode($str); $str2 = str_replace($arr_replace_utf,$arr_replace_cyr,$str1); return $str2; } echo json_encode($json_data);?> <br /> <?php echo json_encode_cyr(json_encode($json_data)); ?><br /> <?php echo json_encode($json_data, JSON_UNESCAPED_UNICODE); ?>

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.0190.00318.27
8.3.50.0120.01022.01
8.3.40.0120.00318.71
8.3.30.0120.00318.67
8.3.20.0060.00318.77
8.3.10.0030.00620.98
8.3.00.0040.00423.48
8.2.180.0180.00316.50
8.2.170.0070.00722.96
8.2.160.0030.01020.35
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00721.03
8.2.110.0030.00920.52
8.2.100.0120.00017.84
8.2.90.0030.00619.00
8.2.80.0080.00017.97
8.2.70.0050.00817.63
8.2.60.0080.00017.93
8.2.50.0060.00318.07
8.2.40.0030.00618.28
8.2.30.0040.00421.28
8.2.20.0000.00717.75
8.2.10.0050.00217.70
8.2.00.0040.00417.63
8.1.280.0140.00725.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00322.54
8.1.230.0040.00721.04
8.1.220.0000.00818.77
8.1.210.0040.00418.92
8.1.200.0050.00517.10
8.1.190.0030.00617.41
8.1.180.0030.00518.10
8.1.170.0040.00418.58
8.1.160.0000.00718.86
8.1.150.0060.00318.65
8.1.140.0040.00417.33
8.1.130.0030.00317.71
8.1.120.0040.00317.32
8.1.110.0000.00717.48
8.1.100.0000.00817.42
8.1.90.0000.00717.36
8.1.80.0000.00717.36
8.1.70.0050.00217.32
8.1.60.0040.00417.51
8.1.50.0040.00417.40
8.1.40.0000.00717.53
8.1.30.0000.00817.57
8.1.20.0000.00817.68
8.1.10.0050.00217.53
8.1.00.0040.00417.51
8.0.300.0040.00420.03
8.0.290.0040.00417.15
8.0.280.0000.00718.48
8.0.270.0040.00417.29
8.0.260.0070.00016.78
8.0.250.0050.00216.83
8.0.240.0060.00316.99
8.0.230.0030.00316.90
8.0.220.0000.00716.84
8.0.210.0070.00016.87
8.0.200.0030.00316.99
8.0.190.0000.00716.91
8.0.180.0040.00416.88
8.0.170.0030.00616.87
8.0.160.0030.00316.75
8.0.150.0000.00716.81
8.0.140.0000.00916.72
8.0.130.0000.00713.34
8.0.120.0040.00416.75
8.0.110.0030.00516.96
8.0.100.0050.00316.75
8.0.90.0000.00716.92
8.0.80.0160.00016.75
8.0.70.0000.00716.93
8.0.60.0030.00516.73
8.0.50.0040.00416.93
8.0.30.0090.00917.15
8.0.20.0080.01017.40
8.0.10.0000.00716.92
8.0.00.0070.01116.81
7.4.330.0000.00514.77
7.4.320.0030.00316.42
7.4.300.0030.00316.51
7.4.290.0000.00816.55
7.4.280.0090.00016.51
7.4.270.0030.00316.55
7.4.260.0000.00513.20
7.4.250.0030.00516.45
7.4.240.0000.00716.61
7.4.230.0030.00416.52
7.4.220.0040.01516.56
7.4.210.0080.00816.61
7.4.200.0000.00716.42
7.4.190.0080.00016.72
7.4.160.0130.00316.64
7.4.150.0120.01217.40
7.4.140.0100.00717.86
7.4.130.0070.01216.58
7.4.120.0080.00916.41
7.4.110.0170.00016.31
7.4.100.0190.00416.28
7.4.90.0100.01616.37
7.4.80.0090.00819.39
7.4.70.0070.01016.43
7.4.60.0070.01016.30
7.4.50.0030.00616.18
7.4.40.0080.00422.77
7.4.30.0100.00716.55
7.4.00.0090.00614.88
7.3.330.0030.00313.12
7.3.320.0030.00313.11
7.3.310.0030.00316.07
7.3.300.0030.00316.26
7.3.290.0030.01116.27
7.3.280.0060.01016.27
7.3.270.0100.00717.40
7.3.260.0090.00918.24
7.3.250.0120.00616.33
7.3.240.0060.01116.44
7.3.230.0080.01316.39
7.3.210.0080.00816.34
7.3.200.0150.00319.39
7.3.190.0160.00316.23
7.3.180.0170.00416.48
7.3.170.0070.01016.49
7.3.160.0110.00616.49
7.3.120.0090.00614.55
7.2.330.0060.01216.49
7.2.320.0060.01216.74
7.2.310.0110.00816.63
7.2.300.0060.01016.72
7.2.290.0100.00716.69
7.2.00.0220.00019.02
7.1.100.0060.00617.96
7.1.70.0000.00716.74
7.1.60.0100.01419.40
7.1.50.0070.01716.98
7.1.00.0030.07722.55
7.0.200.0050.00516.62
7.0.140.0070.07022.12
7.0.90.0370.07719.94
7.0.80.0130.08019.99
7.0.70.0130.05020.00
7.0.60.0070.05719.95
7.0.50.0430.07320.30
7.0.40.0030.07720.11
7.0.30.0070.08320.14
7.0.20.0170.08720.00
7.0.10.0170.06720.10
7.0.00.0100.03720.12
5.6.280.0030.07321.16
5.6.240.0200.04020.75
5.6.230.0100.04720.55
5.6.220.0030.09020.66
5.6.210.0070.07320.80
5.6.200.0130.07321.16
5.6.190.0100.08021.09
5.6.180.0100.07321.15
5.6.170.0100.04721.07
5.6.160.0100.07021.07
5.6.150.0200.06721.21
5.6.140.0070.08721.21
5.6.130.0030.05321.15
5.6.120.0000.05021.14
5.6.110.0070.05321.04
5.6.100.0100.07721.17
5.6.90.0100.04321.07
5.6.80.0000.05320.54
5.6.70.0030.08020.47
5.6.60.0100.07320.49
5.6.50.0030.04320.54
5.6.40.0100.07020.44
5.6.30.0030.04320.44
5.6.20.0030.05020.43
5.6.10.0070.04720.34
5.6.00.0030.05320.30
5.5.380.0070.08020.39
5.5.370.0070.07720.46
5.5.360.0100.08020.40
5.5.350.0070.08020.46
5.5.340.0000.05720.84
5.5.330.0030.04320.85
5.5.320.0100.04320.93
5.5.310.0100.07320.84
5.5.300.0170.07020.93
5.5.290.0170.07020.87
5.5.280.0030.08720.64
5.5.270.0030.04720.84
5.5.260.0100.07720.95
5.5.250.0130.04020.78
5.5.240.0170.06720.16
5.5.230.0070.05020.07
5.5.220.0200.06720.33
5.5.210.0070.04020.24
5.5.200.0130.06020.13
5.5.190.0100.08020.24
5.5.180.0030.05720.26
5.5.160.0170.07320.31
5.5.150.0130.03720.25
5.5.140.0170.07720.31
5.5.130.0070.04020.30
5.5.120.0100.05020.15
5.5.110.0070.04720.14
5.5.100.0000.08020.16
5.5.90.0000.06720.11
5.5.80.0170.03719.96
5.5.70.0070.05020.03
5.5.60.0070.06720.14
5.5.50.0070.07720.13
5.5.40.0270.03020.10
5.5.30.0030.07720.10
5.5.20.0170.06320.17
5.5.10.0130.07720.09
5.5.00.0070.07720.15
5.4.450.0070.08019.54
5.4.440.0100.07319.37
5.4.430.0030.06019.44
5.4.420.0100.07719.35
5.4.410.0100.06719.06
5.4.400.0100.06719.13
5.4.390.0100.07319.09
5.4.380.0030.05719.05
5.4.370.0100.04319.13
5.4.360.0000.04319.14
5.4.350.0070.05019.10
5.4.340.0100.06019.16
5.4.320.0070.05019.25
5.4.310.0070.07719.18
5.4.300.0030.07719.16
5.4.290.0070.07719.03
5.4.280.0030.06019.16
5.4.270.0100.04019.22
5.4.260.0170.03319.23
5.4.250.0030.04019.04
5.4.240.0130.07719.20
5.4.230.0130.05318.84
5.4.220.0100.04319.17
5.4.210.0030.07319.04
5.4.200.0030.08318.90
5.4.190.0170.06719.18
5.4.180.0070.06719.19
5.4.170.0100.05719.13
5.4.160.0130.06719.16
5.4.150.0000.05019.19
5.4.140.0070.04316.44
5.4.130.0030.04316.41
5.4.120.0030.05716.43
5.4.110.0030.07316.48
5.4.100.0000.04016.54
5.4.90.0000.06716.45
5.4.80.0170.06016.40
5.4.70.0070.05316.52
5.4.60.0030.03716.46
5.4.50.0000.06016.53
5.4.40.0070.07316.51
5.4.30.0000.07716.52
5.4.20.0070.04016.42
5.4.10.0000.05716.36
5.4.00.0100.05715.88
5.3.290.0070.04314.78
5.3.280.0100.07714.59
5.3.270.0030.07014.72
5.3.260.0030.07314.66
5.3.250.0070.04314.69
5.3.240.0130.06314.61
5.3.230.0070.07714.63
5.3.220.0070.05314.74
5.3.210.0130.06714.64
5.3.200.0030.04714.55
5.3.190.0070.07014.56
5.3.180.0070.07714.55
5.3.170.0100.05314.67
5.3.160.0070.07014.75
5.3.150.0030.06714.64
5.3.140.0070.07014.59
5.3.130.0100.06014.71
5.3.120.0070.07314.74
5.3.110.0130.03314.61
5.3.100.0070.03714.14
5.3.90.0000.07713.99
5.3.80.0100.04014.14
5.3.70.0170.06714.13
5.3.60.0000.05014.05
5.3.50.0070.04014.05
5.3.40.0130.05014.04
5.3.30.0070.07714.07
5.3.20.0070.04313.65
5.3.10.0070.04313.77
5.3.00.0070.07313.59
5.2.170.0100.05711.25
5.2.160.0070.06311.09
5.2.150.0030.06311.06
5.2.140.0070.06011.29
5.2.130.0030.04011.26
5.2.120.0130.04711.27
5.2.110.0070.04011.29
5.2.100.0100.03011.16
5.2.90.0030.05711.04
5.2.80.0000.06711.14
5.2.70.0030.03711.17
5.2.60.0070.04711.00
5.2.50.0000.04011.07
5.2.40.0070.06011.07
5.2.30.0030.06311.09
5.2.20.0130.05311.07
5.2.10.0130.04711.05
5.2.00.0130.04710.79
5.1.60.0000.05010.03
5.1.50.0070.05310.01
5.1.40.0070.02310.00
5.1.30.0070.05710.22
5.1.20.0070.05310.44
5.1.10.0070.04310.09
5.1.00.0070.02710.11
5.0.50.0070.0438.56
5.0.40.0030.0238.43
5.0.30.0030.0508.32
5.0.20.0030.0408.30
5.0.10.0100.0208.19
5.0.00.0070.0578.27
4.4.90.0000.0377.08
4.4.80.0070.0307.08
4.4.70.0000.0337.08
4.4.60.0070.0207.08
4.4.50.0030.0337.08
4.4.40.0000.0537.08
4.4.30.0000.0377.08
4.4.20.0030.0177.08
4.4.10.0030.0377.08
4.4.00.0070.0477.08
4.3.110.0030.0177.08
4.3.100.0030.0307.08
4.3.90.0070.0137.08
4.3.80.0070.0507.08
4.3.70.0000.0237.08
4.3.60.0000.0277.08
4.3.50.0000.0237.08
4.3.40.0100.0307.08
4.3.30.0100.0437.08
4.3.20.0070.0337.08
4.3.10.0000.0337.08
4.3.00.0030.0307.08

preferences:
39.45 ms | 401 KiB | 5 Q