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)); } 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)
5.4.160.0170.06718.94
5.4.150.0100.06319.02
5.4.140.0100.05716.39
5.4.130.0030.07016.29
5.4.120.0100.06016.45
5.4.110.0100.07316.49
5.4.100.0100.06016.32
5.4.90.0030.03716.43
5.4.80.0030.04716.46
5.4.70.0000.07016.42
5.4.60.0070.07316.57
5.4.50.0100.04016.45
5.4.40.0070.07316.38
5.4.30.0030.06016.43
5.4.20.0130.06716.56
5.4.10.0000.05016.20
5.4.00.0070.07015.88
5.3.260.0030.06314.53
5.3.250.0130.06714.54
5.3.240.0130.05714.52
5.3.230.0070.06714.42
5.3.220.0100.07014.52
5.3.210.0100.05014.53
5.3.200.0000.08314.48
5.3.190.0170.06014.54
5.3.180.0130.05014.55
5.3.170.0070.07714.42
5.3.160.0130.06714.48
5.3.150.0000.06714.53
5.3.140.0030.05014.50
5.3.130.0100.07014.50
5.3.120.0070.05014.51
5.3.110.0030.04314.51
5.3.100.0170.05313.87
5.3.90.0100.03013.99
5.3.80.0100.06713.89
5.3.70.0070.05013.99
5.3.60.0070.04313.86
5.3.50.0030.03713.86
5.3.40.0100.06313.94
5.3.30.0030.07713.86
5.3.20.0070.05313.65
5.3.10.0100.07013.58
5.3.00.0070.05013.60

preferences:
153.43 ms | 1394 KiB | 7 Q