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.0100.01016.75
8.3.50.0080.00921.99
8.3.40.0070.00718.85
8.3.30.0170.00018.79
8.3.20.0040.00420.30
8.3.10.0030.00523.56
8.3.00.0050.00319.25
8.2.180.0130.01018.25
8.2.170.0130.00722.96
8.2.160.0200.00020.31
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0070.01126.16
8.2.120.0000.00722.23
8.2.110.0060.00320.89
8.2.100.0090.00317.78
8.2.90.0040.00419.11
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0090.00318.04
8.2.50.0030.00818.10
8.2.40.0000.00918.16
8.2.30.0000.00817.96
8.2.20.0000.00717.82
8.2.10.0080.00018.11
8.2.00.0040.00817.71
8.1.280.0070.01325.92
8.1.270.0090.00023.86
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0070.00321.06
8.1.230.0160.00017.70
8.1.220.0040.00417.76
8.1.210.0060.00318.77
8.1.200.0060.00317.22
8.1.190.0000.00817.22
8.1.180.0030.00518.10
8.1.170.0070.00418.59
8.1.160.0050.00321.93
8.1.150.0000.00718.61
8.1.140.0080.00017.31
8.1.130.0040.00417.88
8.1.120.0050.00217.48
8.1.110.0020.00517.31
8.1.100.0070.00017.39
8.1.90.0000.00717.32
8.1.80.0000.00817.47
8.1.70.0040.00417.44
8.1.60.0060.00317.61
8.1.50.0000.00717.44
8.1.40.0000.00817.47
8.1.30.0030.00517.55
8.1.20.0000.00717.68
8.1.10.0000.00717.41
8.1.00.0000.00817.47
8.0.300.0040.00418.77
8.0.290.0050.00316.74
8.0.280.0040.00418.48
8.0.270.0000.00817.21
8.0.260.0030.00316.81
8.0.250.0030.00316.87
8.0.240.0080.00016.97
8.0.230.0070.00016.82
8.0.220.0030.00516.78
8.0.210.0040.00416.77
8.0.200.0000.00716.91
8.0.190.0000.00816.81
8.0.180.0000.00816.79
8.0.170.0060.00316.88
8.0.160.0040.00416.75
8.0.150.0030.00316.76
8.0.140.0000.00816.71
8.0.130.0030.00313.27
8.0.120.0050.00316.89
8.0.110.0000.00716.80
8.0.100.0000.00716.89
8.0.90.0030.00516.97
8.0.80.0070.01316.80
8.0.70.0040.00416.93
8.0.60.0050.00216.90
8.0.50.0040.00416.71
8.0.30.0100.01017.20
8.0.20.0080.01017.40
8.0.10.0000.00816.92
8.0.00.0110.00616.67
7.4.330.0000.00515.07
7.4.320.0040.00416.51
7.4.300.0070.00016.63
7.4.290.0030.00316.51
7.4.280.0000.00816.54
7.4.270.0030.00316.61
7.4.260.0000.00716.43
7.4.250.0040.00416.49
7.4.240.0040.00316.49
7.4.230.0030.00316.50
7.4.220.0060.01216.53
7.4.210.0080.00816.60
7.4.200.0040.00416.42
7.4.190.0050.00316.76
7.4.160.0120.00316.39
7.4.150.0100.00717.40
7.4.140.0130.00617.86
7.4.130.0090.00816.52
7.4.120.0100.00816.53
7.4.110.0030.01416.64
7.4.100.0120.00616.34
7.4.90.0070.01016.50
7.4.80.0110.01119.39
7.4.70.0040.01616.46
7.4.60.0030.01716.52
7.4.50.0080.00016.38
7.4.40.0060.00922.77
7.4.30.0090.00616.56
7.4.10.0030.01314.77
7.4.00.0060.01015.07
7.3.330.0050.00013.26
7.3.320.0030.00313.21
7.3.310.0040.00416.35
7.3.300.0030.00316.12
7.3.290.0120.00316.30
7.3.280.0080.01016.21
7.3.270.0080.00917.40
7.3.260.0130.01016.41
7.3.250.0090.00816.33
7.3.240.0120.00616.33
7.3.230.0040.01216.66
7.3.210.0110.00616.34
7.3.200.0120.00919.39
7.3.190.0090.01216.51
7.3.180.0120.00316.63
7.3.170.0090.00916.61
7.3.160.0160.00016.44
7.3.130.0070.01014.91
7.3.120.0060.00914.92
7.3.110.0130.00614.78
7.3.100.0090.00614.82
7.3.90.0030.01014.79
7.3.80.0060.00614.71
7.3.70.0040.00714.75
7.3.60.0000.01014.76
7.3.50.0000.00914.82
7.3.40.0080.00014.56
7.3.30.0080.00414.56
7.3.20.0070.00316.68
7.3.10.0060.00316.66
7.3.00.0030.00616.75
7.2.330.0100.00716.57
7.2.320.0030.01316.43
7.2.310.0140.00316.57
7.2.300.0090.00916.42
7.2.290.0070.01316.82
7.2.260.0070.01115.28
7.2.250.0040.01414.73
7.2.240.0040.01115.29
7.2.230.0030.01315.32
7.2.220.0080.00415.25
7.2.210.0090.00315.16
7.2.200.0070.00714.94
7.2.190.0060.00915.07
7.2.180.0090.00615.14
7.2.170.0060.00914.92
7.2.160.0030.01014.70
7.2.150.0000.00916.77
7.2.140.0030.00716.64
7.2.130.0030.00816.96
7.2.120.0040.01217.03
7.2.110.0030.00717.00
7.2.100.0030.00616.86
7.2.90.0000.01016.90
7.2.80.0000.01516.59
7.2.70.0070.00716.89
7.2.60.0030.01016.85
7.2.50.0090.00616.79
7.2.40.0030.00916.50
7.2.30.0120.00616.70
7.2.20.0030.01017.00
7.2.10.0110.00016.96
7.2.00.0070.01316.94
7.1.330.0040.01215.96
7.1.320.0030.00715.88
7.1.310.0090.00315.47
7.1.300.0070.00415.70
7.1.290.0060.00615.77
7.1.280.0080.00315.61
7.1.270.0060.00615.71
7.1.260.0090.00015.80
7.1.250.0000.00815.54
7.1.240.0030.01415.73
7.1.230.0040.00715.76
7.1.220.0060.01015.63
7.1.210.0030.00915.83
7.1.200.0000.01115.51
7.1.190.0040.00715.72
7.1.180.0070.00715.56
7.1.170.0030.00715.75
7.1.160.0040.01215.79
7.1.150.0040.01115.86
7.1.140.0090.00315.57
7.1.130.0070.00715.79
7.1.120.0060.00915.43
7.1.110.0070.00715.70
7.1.100.0000.02015.62
7.1.90.0000.00915.43
7.1.80.0040.00815.77
7.1.70.0030.00816.25
7.1.60.0090.00817.54
7.1.50.0070.00316.17
7.1.40.0040.00715.48
7.1.30.0110.00015.72
7.1.20.0030.00915.72
7.1.10.0070.00715.86
7.1.00.0060.04118.90
7.0.330.0030.01015.36
7.0.320.0040.01215.09
7.0.310.0100.00315.32
7.0.300.0060.00615.20
7.0.290.0000.01315.14
7.0.280.0030.00815.10
7.0.270.0070.00715.45
7.0.260.0050.00515.03
7.0.250.0070.00715.36
7.0.240.0030.01015.51
7.0.230.0140.00015.29
7.0.220.0070.00715.29
7.0.210.0030.00715.52
7.0.200.0100.00015.97
7.0.190.0060.00615.02
7.0.180.0060.00915.43
7.0.170.0000.01415.25
7.0.160.0090.00615.41
7.0.150.0070.00715.30
7.0.140.0050.03718.65
7.0.130.0040.00815.50
7.0.120.0070.00715.36
7.0.110.0030.01015.27
7.0.100.0110.00315.24
7.0.90.0100.03817.69
7.0.80.0050.04417.60
7.0.70.0050.04217.71
7.0.60.0120.04217.51
7.0.50.0040.04717.82
7.0.40.0100.03816.81
7.0.30.0040.03416.67
7.0.20.0100.02516.72
7.0.10.0090.04216.63
7.0.00.0090.02216.71
5.6.400.0060.00314.47
5.6.390.0000.01314.47
5.6.380.0060.01214.35
5.6.370.0030.01314.45
5.6.360.0040.01214.34
5.6.350.0060.01114.39
5.6.340.0110.00314.15
5.6.330.0040.01114.14
5.6.320.0090.00914.41
5.6.310.0030.00914.59
5.6.300.0060.00314.58
5.6.290.0060.00614.70
5.6.280.0040.03917.73
5.6.270.0030.00914.34
5.6.260.0110.00314.73
5.6.250.0060.00314.44
5.6.240.0080.03217.63
5.6.230.0090.04517.61
5.6.220.0040.04417.43
5.6.210.0050.04717.48
5.6.200.0050.04617.63
5.6.190.0100.03617.83
5.6.180.0100.04017.72
5.6.170.0030.05017.69
5.6.160.0060.04317.62
5.6.150.0050.02717.68
5.6.140.0130.02817.68
5.6.130.0120.03917.84
5.6.120.0080.04317.62
5.6.110.0100.04317.79
5.6.100.0020.05117.59
5.6.90.0040.04417.60
5.6.80.0050.04617.32
5.6.70.0100.02817.30
5.6.60.0090.02317.33
5.6.50.0030.04317.53
5.6.40.0070.04117.33
5.6.30.0070.04217.21
5.6.20.0070.02617.28
5.6.10.0100.04017.34
5.6.00.0030.03517.50
5.5.380.0100.04317.47
5.5.370.0100.02717.54
5.5.360.0050.04517.43
5.5.350.0070.02917.43
5.5.340.0060.04317.65
5.5.330.0060.04617.66
5.5.320.0110.02317.73
5.5.310.0070.02817.67
5.5.300.0030.04817.44
5.5.290.0080.04117.74
5.5.280.0080.04217.61
5.5.270.0080.03217.43
5.5.260.0070.03717.54
5.5.250.0030.03317.45
5.5.240.0030.03017.35
5.5.230.0050.04017.37
5.5.220.0050.04617.22
5.5.210.0020.04417.31
5.5.200.0100.03617.15
5.5.190.0100.02717.27
5.5.180.0050.02517.20
5.5.170.0000.01314.10
5.5.160.0070.03817.23
5.5.150.0060.03617.20
5.5.140.0050.04717.28
5.5.130.0060.04317.30
5.5.120.0050.04317.41
5.5.110.0050.04717.23
5.5.100.0050.04317.22
5.5.90.0080.04217.17
5.5.80.0070.02517.07
5.5.70.0060.04217.03
5.5.60.0070.03417.13
5.5.50.0050.04417.24
5.5.40.0050.02917.19
5.5.30.0110.03017.24
5.5.20.0020.03617.08
5.5.10.0100.03817.14
5.5.00.0030.02917.04
5.4.450.0050.02815.75
5.4.440.0070.02315.87
5.4.430.0070.03815.87
5.4.420.0050.03315.74
5.4.410.0060.04315.76
5.4.400.0040.02715.58
5.4.390.0080.02515.62
5.4.380.0070.02315.67
5.4.370.0020.03815.73
5.4.360.0050.04315.69
5.4.350.0080.04315.69
5.4.340.0070.04015.66
5.4.330.0060.00612.29
5.4.320.0050.04015.66
5.4.310.0070.04215.61
5.4.300.0050.04215.77
5.4.290.0070.04015.57
5.4.280.0050.03915.71
5.4.270.0040.03515.76
5.4.260.0060.04415.65
5.4.250.0050.02515.56
5.4.240.0050.03315.58
5.4.230.0100.03015.65
5.4.220.0070.02315.73
5.4.210.0030.02315.66
5.4.200.0030.04015.74
5.4.190.0040.04415.73
5.4.180.0070.03915.65
5.4.170.0110.03615.61
5.4.160.0100.03915.75
5.4.150.0100.04015.56
5.4.140.0050.04214.38
5.4.130.0030.03914.36
5.4.120.0100.02814.37
5.4.110.0050.04114.35
5.4.100.0050.02914.29
5.4.90.0030.03514.38
5.4.80.0050.04114.34
5.4.70.0030.03714.36
5.4.60.0070.03714.39
5.4.50.0040.04114.37
5.4.40.0020.04214.41
5.4.30.0030.03614.32
5.4.20.0060.03814.33
5.4.10.0060.01814.40
5.4.00.0060.01714.07
5.3.290.0160.03213.50
5.3.280.0030.03513.46
5.3.270.0050.04013.50
5.3.260.0050.03013.52
5.3.250.0070.04213.45
5.3.240.0100.03813.53
5.3.230.0030.04213.52
5.3.220.0010.03413.47
5.3.210.0040.04213.46
5.3.200.0070.01813.51
5.3.190.0020.03213.42
5.3.180.0050.03113.50
5.3.170.0040.02713.50
5.3.160.0090.02913.43
5.3.150.0070.02513.49
5.3.140.0080.03813.50
5.3.130.0080.03413.45
5.3.120.0100.03313.42
5.3.110.0020.03613.45
5.3.100.0050.03813.13
5.3.90.0060.02313.18
5.3.80.0070.03413.14
5.3.70.0080.02513.18
5.3.60.0060.03813.16
5.3.50.0070.03313.09
5.3.40.0080.04013.20
5.3.30.0080.03413.11
5.3.20.0010.04413.04
5.3.10.0100.03513.04
5.3.00.0090.03912.95
5.2.170.0100.05711.18
5.2.160.0130.05011.19
5.2.150.0070.04711.19
5.2.140.0000.06711.08
5.2.130.0030.06011.26
5.2.120.0000.06011.21
5.2.110.0030.05711.18
5.2.100.0000.04311.26
5.2.90.0070.06011.05
5.2.80.0070.06011.06
5.2.70.0030.06011.06
5.2.60.0070.05711.20
5.2.50.0070.06011.09
5.2.40.0030.06711.07
5.2.30.0070.05711.08
5.2.20.0070.03710.87
5.2.10.0030.06311.02
5.2.00.0030.05010.68
5.1.60.0030.05010.11
5.1.50.0000.0409.86
5.1.40.0070.0439.85
5.1.30.0100.04710.48
5.1.20.0070.05310.43
5.1.10.0030.05710.17
5.1.00.0030.05710.21
5.0.50.0070.0438.57
5.0.40.0000.0478.55
5.0.30.0100.0578.24
5.0.20.0030.0238.08
5.0.10.0030.0208.19
5.0.00.0030.0408.30
4.4.90.0030.0377.08
4.4.80.0000.0277.08
4.4.70.0030.0377.08
4.4.60.0000.0337.08
4.4.50.0030.0337.08
4.4.40.0000.0537.08
4.4.30.0000.0377.08
4.4.20.0030.0337.08
4.4.10.0070.0307.08
4.4.00.0000.0577.08
4.3.110.0030.0337.08
4.3.100.0070.0277.08
4.3.90.0000.0177.08
4.3.80.0070.0507.08
4.3.70.0070.0337.08
4.3.60.0000.0277.08
4.3.50.0000.0237.08
4.3.40.0000.0477.08
4.3.30.0000.0377.08
4.3.20.0000.0407.08
4.3.10.0000.0377.08
4.3.00.0030.0207.08

preferences:
42.14 ms | 401 KiB | 5 Q