3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_time_limit(0); $length=3; $arr_u = array(); $arr_m = array(); $arr_d = array(); $arr_t = array(); $utf8string = ''; $charset=sprintf('%s', implode('',array_merge(range('0', '9'),range('a', 'f')))); for($i=0;$i<strlen($charset);$i++) $a[]=$charset{$i}; for($i=0,$c="",$d="chk(";$i<$length;$i++){ $c.="foreach(\$a as \$b[$i])"; $d.="\$b[$i]."; } eval($c.$d."\"\n\");"); function chk($str){ global $arr_u ,$arr_t, $arr_m, $arr_d; array_push($arr_t,"U+0$str"); } global $arr_u ,$arr_t, $arr_m, $arr_d, $utf8string; for($i=0; $i<52; $i++){ array_push($arr_u,$arr_t[rand(0,count($arr_t))]); } for($i=0; $i<40; $i++){ array_push($arr_d,$arr_t[rand(0,count($arr_t))]); } for($i=0; $i<23; $i++){ array_push($arr_m,$arr_t[rand(0,count($arr_t))]); } $utf8string = html_entity_decode(preg_replace("/U\+([0-9a-f]{4})/", "&#x\\1;", implode("",array_merge($arr_u, $arr_d, $arr_m))), ENT_NOQUOTES, 'UTF-8'); print $utf8string; /* $string = preg_replace('/%u([0-9A-F]+)/', '&#x$1;', $string); echo html_entity_decode($string, ENT_COMPAT, 'UTF-8'); * $utf8string = html_entity_decode(preg_replace("/U\+([0-9A-F]{4})/", "&#x\\1;", $string), ENT_NOQUOTES, 'UTF-8'); */

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)
7.2.00.0000.01519.74
7.1.70.0030.00917.37
7.1.60.0070.01919.31
7.1.50.0070.01717.35
7.1.00.0030.04022.46
7.0.200.0260.00315.23
7.0.140.0030.07722.02
7.0.120.0030.07722.06
7.0.70.0030.07321.70
7.0.60.0030.07721.66
7.0.50.0030.05022.10
7.0.40.0070.08720.07
7.0.30.0070.09020.13
7.0.20.0100.07720.05
7.0.10.0070.08720.09
7.0.00.0070.08320.03
5.6.280.0070.09721.86
5.6.220.0100.11021.70
5.6.210.0100.11021.80
5.6.200.0030.11021.99
5.6.190.0100.10322.04
5.6.180.0030.11022.13
5.6.170.0100.11322.07
5.6.160.0100.07022.13
5.6.150.0000.06322.13
5.6.140.0170.08722.09
5.6.130.0070.12022.13
5.6.120.0070.09722.04
5.6.110.0100.12722.12
5.6.100.0030.06022.05
5.6.90.0100.11022.20
5.6.80.0070.06321.54
5.6.70.0130.10721.45
5.6.60.0100.11021.59
5.6.50.0070.10721.49
5.6.40.0170.09321.54
5.6.30.0000.11321.44
5.6.20.0030.11721.43
5.6.10.0100.06321.54
5.6.00.0000.11021.41
5.5.360.0100.08321.38
5.5.350.0100.08321.50
5.5.340.0070.11721.91
5.5.330.0030.11721.88
5.5.320.0070.08321.89
5.5.310.0000.12021.93
5.5.300.0030.10321.96
5.5.290.0130.10021.88
5.5.280.0100.05321.69
5.5.270.0070.11321.96
5.5.260.0070.10721.94
5.5.250.0170.10721.64
5.5.240.0030.10721.35
5.5.230.0000.11321.23
5.5.220.0030.10321.31
5.5.210.0100.10721.04
5.5.200.0070.10321.23
5.5.190.0030.11321.26
5.5.180.0000.11721.31
5.5.160.0000.11721.33
5.5.150.0100.10321.27
5.5.140.0100.09721.27
5.5.130.0030.07021.17
5.5.120.0000.10321.20
5.5.110.0100.08321.28
5.5.100.0030.08321.22
5.5.90.0000.11021.13
5.5.80.0100.10321.06
5.5.70.0030.05721.11
5.5.60.0030.06321.01
5.5.50.0030.06021.20
5.5.40.0100.05721.02
5.5.30.0170.09721.20
5.5.20.0130.09721.16
5.5.10.0070.10021.07
5.5.00.0030.10321.15
5.4.450.0070.07020.53
5.4.440.0030.10320.32
5.4.430.0000.11020.41
5.4.420.0030.08720.49
5.4.410.0030.07320.05
5.4.400.0030.11319.82
5.4.390.0030.08319.93
5.4.380.0000.11019.98
5.4.370.0000.11020.05
5.4.360.0000.09320.05
5.4.350.0100.10019.85
5.4.340.0130.09720.20
5.4.320.0000.11020.05
5.4.310.0030.09020.09
5.4.300.0030.11020.19
5.4.290.0030.10719.88
5.4.280.0000.09320.02
5.4.270.0130.09719.88
5.4.260.0000.11320.04
5.4.250.0000.06319.83
5.4.240.0100.06320.01
5.4.230.0030.09020.19
5.4.220.0130.09720.00
5.4.210.0030.09720.00
5.4.200.0100.09719.93
5.4.190.0070.06019.82
5.4.180.0130.09320.06
5.4.170.0070.10020.16
5.4.160.0030.10719.96
5.4.150.0300.08719.95
5.4.140.0030.09717.38
5.4.130.0030.06017.43
5.4.120.0100.10017.38
5.4.110.0130.09717.36
5.4.100.0070.06317.42
5.4.90.0070.06717.50
5.4.80.0070.10317.34
5.4.70.0030.10317.30
5.4.60.0030.10317.45
5.4.50.0030.10017.46
5.4.40.0000.07017.28
5.4.30.0070.10317.42
5.4.20.0100.10717.45
5.4.10.0070.09717.50
5.4.00.0030.08016.85
5.3.290.0070.05715.55
5.3.280.0030.06715.44
5.3.270.0030.11015.63
5.3.260.0100.06715.55
5.3.250.0100.06315.61
5.3.240.0030.05715.61
5.3.230.0000.08715.84
5.3.220.0070.10315.40
5.3.210.0000.09315.52
5.3.200.0030.10315.57
5.3.190.0030.06015.56
5.3.180.0030.07015.57
5.3.170.0070.09315.39
5.3.160.0100.10015.59
5.3.150.0030.10715.61
5.3.140.0000.07015.53
5.3.130.0100.10715.50
5.3.120.0030.06715.48
5.3.110.0030.09315.44
5.3.100.0000.11014.97
5.3.90.0000.11014.90
5.3.80.0030.07315.11
5.3.70.0070.07715.04
5.3.60.0000.10714.89
5.3.50.0070.08314.83
5.3.40.0030.10014.88
5.3.30.0030.11014.75
5.3.20.0030.10714.58
5.3.10.0000.10014.52
5.3.00.0030.06014.57
5.2.170.0030.08312.18
5.2.160.0070.09712.18
5.2.150.0070.09712.18
5.2.140.0030.09312.18
5.2.130.0000.08712.18
5.2.120.0070.10012.18
5.2.110.0100.08712.18
5.2.100.0000.09712.18
5.2.90.0000.05712.18
5.2.80.0070.08712.18
5.2.70.0030.09712.18
5.2.60.0070.09312.18
5.2.50.0000.11312.18
5.2.40.0030.09712.18
5.2.30.0070.10312.18
5.2.20.0030.09312.18
5.2.10.0030.07712.52
5.2.00.0030.09312.52
5.1.60.0070.09012.52
5.1.50.0000.10712.52
5.1.40.0000.10012.52
5.1.30.0070.06012.52
5.1.20.0000.10012.52
5.1.10.0070.09312.52
5.1.00.0000.09012.52
5.0.50.0000.10012.52
5.0.40.0000.10012.52
5.0.30.0070.11012.55
5.0.20.0100.08012.73
5.0.10.0000.10012.95
5.0.00.0030.11012.95
4.4.90.0030.09312.18
4.4.80.0030.07712.18
4.4.70.0070.08312.18
4.4.60.0000.08312.20
4.4.50.0100.09012.29
4.4.40.0030.07312.52
4.4.30.0000.08712.52
4.4.20.0030.07312.52
4.4.10.0030.05312.52
4.4.00.0030.08712.52
4.3.110.0030.09012.52
4.3.100.0030.09312.55
4.3.90.0030.05312.73
4.3.80.0000.07712.95
4.3.70.0030.05713.17
4.3.60.0000.09013.17
4.3.50.0000.09313.17
4.3.40.0000.09013.17
4.3.30.0030.08013.17
4.3.20.0030.08713.17
4.3.10.0000.09013.17
4.3.00.0030.08713.17

preferences:
37.94 ms | 400 KiB | 5 Q