3v4l.org

run code in 300+ PHP versions simultaneously
<?php //if (version_compare(PHP_VERSION, '5.2', '<')) { // exit 'no json_encode() support'; //} $array = array('text' => "<h1>Кириллический URL</h1>\n<p>This is Cyrillic URL example. Try <a class=js-as dir=rtl href=עברית>RTL עברית</a>.</p>\n"); if (version_compare(PHP_VERSION, '5.4', '>=')) { $data = json_encode($array, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); } else { //$data = str_replace('\\/', '/', json_encode($array)); $data = preg_replace('/\\\\u([a-f0-9]{4})/e', "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode($array)); $data = preg_replace('\\/', '/', json_encode($array)); } echo $data;

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.00718.43
8.3.50.0090.00721.99
8.3.40.0110.00418.77
8.3.30.0140.00318.96
8.3.20.0040.00420.35
8.3.10.0050.00322.00
8.3.00.0080.00022.38
8.2.180.0090.00616.38
8.2.170.0040.01422.96
8.2.160.0090.00621.00
8.2.150.0070.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00017.50
8.2.110.0030.00622.25
8.2.100.0080.00319.45
8.2.90.0050.00319.08
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0040.00417.93
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0040.00418.00
8.2.20.0060.00317.69
8.2.10.0070.00017.64
8.2.00.0060.00317.88
8.1.280.0110.00325.92
8.1.270.0040.00422.11
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0030.00623.91
8.1.230.0040.00719.01
8.1.220.0030.00517.74
8.1.210.0000.00918.77
8.1.200.0070.00317.10
8.1.190.0070.00017.41
8.1.180.0060.00318.10
8.1.170.0030.00518.49
8.1.160.0000.01021.96
8.1.150.0040.00418.64
8.1.140.0050.00217.32
8.1.130.0070.00017.71
8.1.120.0040.00417.46
8.1.110.0000.00817.39
8.1.100.0040.00417.44
8.1.90.0070.00017.43
8.1.80.0050.00217.45
8.1.70.0070.00017.25
8.1.60.0050.00317.57
8.1.50.0000.00717.47
8.1.40.0040.00417.35
8.1.30.0070.00017.65
8.1.20.0030.00617.51
8.1.10.0050.00217.52
8.1.00.0000.00717.38
8.0.300.0080.00018.77
8.0.290.0050.00217.16
8.0.280.0000.00818.39
8.0.270.0030.00317.33
8.0.260.0030.00316.83
8.0.250.0030.00316.84
8.0.240.0040.00417.02
8.0.230.0000.00616.93
8.0.220.0030.00316.75
8.0.210.0050.00316.75
8.0.200.0040.00416.92
8.0.190.0070.00016.91
8.0.180.0040.00416.88
8.0.170.0000.00816.79
8.0.160.0000.00716.69
8.0.150.0040.00416.84
8.0.140.0070.00016.71
8.0.130.0000.00613.22
8.0.120.0050.00316.82
8.0.110.0040.00416.83
8.0.100.0050.00316.75
8.0.90.0000.00816.79
8.0.80.0170.00316.83
8.0.70.0060.00316.91
8.0.60.0040.00416.71
8.0.50.0070.00016.70
8.0.30.0080.01117.01
8.0.20.0140.00617.40
8.0.10.0000.00716.84
8.0.00.0070.01316.61
7.4.330.0050.00015.00
7.4.320.0000.00616.55
7.4.300.0000.00716.50
7.4.290.0070.00016.54
7.4.280.0070.00316.36
7.4.270.0000.00716.46
7.4.260.0000.00816.45
7.4.250.0030.00516.57
7.4.240.0030.00316.44
7.4.230.0030.00316.55
7.4.220.0120.00616.38
7.4.210.0110.00516.50
7.4.200.0040.00416.30
7.4.190.0000.00716.42
7.4.160.0060.01616.36
7.4.150.0070.01017.40
7.4.140.0100.01017.86
7.4.130.0090.00916.49
7.4.120.0110.00816.48
7.4.110.0110.01116.44
7.4.100.0030.01416.45
7.4.90.0060.01216.32
7.4.80.0030.01319.39
7.4.70.0040.01216.45
7.4.60.0080.00916.50
7.4.50.0000.00816.38
7.4.40.0120.00322.77
7.4.30.0060.01016.51
7.4.00.0070.01014.93
7.3.330.0000.00613.08
7.3.320.0000.00513.17
7.3.310.0070.00016.29
7.3.300.0030.00316.23
7.3.290.0090.00616.21
7.3.280.0050.01116.18
7.3.270.0130.00317.40
7.3.260.0100.00716.55
7.3.250.0080.01016.41
7.3.240.0070.01416.20
7.3.230.0070.01616.39
7.3.210.0090.00616.21
7.3.200.0110.00519.39
7.3.190.0120.00916.27
7.3.180.0100.00616.46
7.3.170.0040.01116.43
7.3.160.0090.00616.19
7.3.120.0030.01214.67
7.2.330.0040.01216.59
7.2.320.0100.01016.64
7.2.310.0070.01016.31
7.2.300.0120.00916.57
7.2.290.0120.00316.43
7.1.70.0000.00717.12
7.1.60.0070.00317.09
7.1.50.0080.01516.63
7.1.00.0000.08022.27
7.0.200.0070.00416.67
7.0.140.0000.07721.99
7.0.90.0730.07719.92
7.0.80.0730.07719.91
7.0.70.0330.07019.88
7.0.60.0400.04320.02
7.0.50.0370.04320.33
7.0.40.0070.04020.01
7.0.30.0030.05320.13
7.0.20.0100.03720.10
7.0.10.0100.05020.12
7.0.00.0100.06320.04
5.6.280.0030.07321.10
5.6.240.0070.08020.60
5.6.230.0100.08320.68
5.6.220.0030.05320.58
5.6.210.0170.03320.55
5.6.200.0070.04020.94
5.6.190.0030.06320.96
5.6.180.0130.07721.03
5.6.170.0130.04721.04
5.6.160.0170.05720.92
5.6.150.0130.03721.00
5.6.140.0000.04721.02
5.6.130.0030.05020.99
5.6.120.0000.04721.04
5.6.110.0070.08321.04
5.6.100.0030.05321.01
5.6.90.0030.04720.91
5.6.80.0030.04320.26
5.6.70.0100.03720.41
5.6.60.0200.04320.41
5.6.50.0070.05320.42
5.6.40.0070.04720.38
5.6.30.0100.05020.29
5.6.20.0100.06320.41
5.6.10.0030.04020.27
5.6.00.0070.03720.30
5.5.380.0170.04720.42
5.5.370.0100.08020.42
5.5.360.0070.07020.37
5.5.350.0030.04320.43
5.5.340.0070.04020.78
5.5.330.0070.04720.76
5.5.320.0000.04720.79
5.5.310.0070.04020.82
5.5.300.0030.04720.86
5.5.290.0030.03720.79
5.5.280.0130.03720.91
5.5.270.0000.05320.77
5.5.260.0030.04720.72
5.5.250.0030.04320.63
5.5.240.0070.04020.14
5.5.230.0000.04320.27
5.5.220.0030.04020.23
5.5.210.0030.03320.24
5.5.200.0130.04020.17
5.5.190.0030.04020.07
5.5.180.0030.04020.23
5.5.160.0030.04320.07
5.5.150.0100.07320.10
5.5.140.0130.07020.24
5.5.130.0100.07320.21
5.5.120.0000.05020.21
5.5.110.0070.06720.16
5.5.100.0100.07320.07
5.5.90.0000.07020.08
5.5.80.0170.07319.97
5.5.70.0000.07320.10
5.5.60.0070.08020.14
5.5.50.0130.06320.03
5.5.40.0170.06320.07
5.5.30.0030.06019.95
5.5.20.0000.04720.05
5.5.10.0130.04720.12
5.5.00.0070.07720.12
5.4.450.0000.04719.11
5.4.440.0070.03719.37
5.4.430.0070.03719.13
5.4.420.0070.05719.26
5.4.410.0100.05319.31
5.4.400.0100.03319.10
5.4.390.0100.03319.12
5.4.380.0070.03319.06
5.4.370.0030.07019.01
5.4.360.0000.04018.90
5.4.350.0030.03719.05
5.4.340.0030.04019.07
5.4.320.0000.04019.07
5.4.310.0130.07018.93
5.4.300.0070.07319.04
5.4.290.0130.06718.78
5.4.280.0130.07018.96
5.4.270.0100.06719.20
5.4.260.0130.06018.97
5.4.250.0000.07719.22
5.4.240.0200.06018.96
5.4.230.0070.07018.96
5.4.220.0030.05019.02
5.4.210.0170.06719.11
5.4.200.0130.05719.02
5.4.190.0030.05019.04
5.4.180.0000.04019.05
5.4.170.0030.05718.77
5.4.160.0030.04319.06
5.4.150.0070.08019.05
5.4.140.0030.07016.24
5.4.130.0000.04716.28
5.4.120.0030.04716.31
5.4.110.0130.07016.45
5.4.100.0070.07716.25
5.4.90.0070.04316.38
5.4.80.0000.07016.20
5.4.70.0130.06716.29
5.4.60.0170.05316.22
5.4.50.0130.03016.30
5.4.40.0000.07016.29
5.4.30.0070.04016.23
5.4.20.0070.07016.18
5.4.10.0030.06716.18
5.4.00.0100.07015.46
5.3.290.0070.08314.69
5.3.280.0000.04314.62
5.3.270.0030.06314.77
5.3.260.0070.08014.59
5.3.250.0100.03314.64
5.3.240.0100.07314.72
5.3.230.0170.04314.72
5.3.220.0070.08314.56
5.3.210.0130.05014.70
5.3.200.0030.05314.68
5.3.190.0130.06314.70
5.3.180.0070.07714.68
5.3.170.0170.07014.68
5.3.160.0030.05314.70
5.3.150.0070.07714.64
5.3.140.0030.04014.57
5.3.130.0070.07714.68
5.3.120.0130.07014.66
5.3.110.0130.07714.56
5.3.100.0070.07714.16
5.3.90.0070.08014.08
5.3.80.0130.07314.16
5.3.70.0030.06014.03
5.3.60.0000.08314.14
5.3.50.0100.06714.01
5.3.40.0130.06313.97
5.3.30.0100.06014.04
5.3.20.0130.06713.86
5.3.10.0170.05313.67
5.3.00.0070.07713.71
5.2.170.0070.06711.34
5.2.160.0030.05311.16
5.2.150.0000.05711.37
5.2.140.0030.06311.14
5.2.130.0000.04711.25
5.2.120.0170.04711.20
5.2.110.0100.05711.10
5.2.100.0070.06011.13
5.2.90.0070.06011.27
5.2.80.0130.05711.29
5.2.70.0070.06011.27
5.2.60.0070.05711.14
5.2.50.0070.06011.19
5.2.40.0100.06011.11
5.2.30.0070.06011.13
5.2.20.0070.06311.17
5.2.10.0100.05310.94
5.2.00.0030.04310.79
5.1.60.0000.05710.01
5.1.50.0030.05710.07
5.1.40.0030.05310.00
5.1.30.0100.03310.38
5.1.20.0030.04310.25
5.1.10.0000.04010.08
5.1.00.0100.05010.10
5.0.50.0100.0309.75
5.0.40.0130.0379.75
5.0.30.0030.0639.75
5.0.20.0000.0309.75
5.0.10.0000.0239.75
5.0.00.0070.0479.75
4.4.90.0070.0339.75
4.4.80.0000.0239.75
4.4.70.0030.0309.75
4.4.60.0100.0309.75
4.4.50.0030.0379.75
4.4.40.0000.0539.75
4.4.30.0030.0309.75
4.4.20.0000.0379.75
4.4.10.0130.0239.75
4.4.00.0030.0539.75
4.3.110.0000.0379.75
4.3.100.0070.0209.75
4.3.90.0000.0179.75
4.3.80.0030.0539.75
4.3.70.0000.0239.75
4.3.60.0000.0379.75
4.3.50.0000.0309.75
4.3.40.0070.0509.75
4.3.30.0030.0339.75
4.3.20.0030.0339.75
4.3.10.0000.0279.75
4.3.00.0000.0309.75

preferences:
43 ms | 401 KiB | 5 Q