3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('json_encode')) { function json_encode($it) { if (!($assoc = is_object($it)) && !is_array($it)) { return _js_enc_value($it); } $i = 0; $it = (array)$it; if (!$assoc) { foreach ($it as $k => $v) { if ($k !== $i) { $assoc = true; break; } $i++; } } $data = array(); foreach ($it as $k => $v) { $v = _js_enc_value($v); if ($assoc) { $k = '"'. addcslashes($k, '"\\') . '"'; $data[] = $k . ':' . $v; } else { $data[] = $v; } } if ($assoc) { $spl = '{'; $spr = '}'; } else { $spl = '['; $spr = ']'; } return $spl . implode(',', $data) . $spr; } function _js_enc_value($value) { switch (true) { case is_array($value): case is_object($value): return json_encode($value); case is_bool($value): return $value ? 'true' : 'false'; case $value === null: case is_resource($value) && _js_error(): return 'null'; case is_string($value): return '"' . _js_uc_esc($value) . '"'; default: return $value; } } function _js_error() { return trigger_error('json_encode(): type is unsupported, encoded as null', E_USER_WARNING); } function _js_uc_esc($value) { $pattern = "@[\r\n\"'/]|([^\x09\x0A\x0D\x20-\x7E]{3})+@"; return preg_replace_callback($pattern, '_js_uc_esc_cb', $value); } function _js_uc_esc_cb($matches) { switch (true) { case isset($matches[1]): $char = mb_convert_encoding($matches[0], 'UTF-16', 'UTF-8'); $str = ''; $len = strlen($char); for ($i = 0; $i < $len; $i += 2) { $str .= sprintf('\\u%02x%02x', ord($char[$i]), ord($char[$i + 1])); } return $str; default: return addcslashes($matches[0], "\r\n/"); } } } echo json_encode(array('"/'));

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.0090.01218.47
8.3.50.0100.00921.96
8.3.40.0040.01118.84
8.3.30.0030.01218.92
8.3.20.0060.00320.33
8.3.10.0080.00023.53
8.3.00.0040.00420.84
8.2.180.0090.01216.75
8.2.170.0070.00722.96
8.2.160.0090.00620.44
8.2.150.0120.00624.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0040.00420.76
8.2.110.0070.00322.14
8.2.100.0000.01217.72
8.2.90.0040.00419.05
8.2.80.0050.00317.97
8.2.70.0050.00317.50
8.2.60.0000.00818.04
8.2.50.0030.00618.10
8.2.40.0000.00821.00
8.2.30.0040.00418.12
8.2.20.0000.00917.68
8.2.10.0040.00417.95
8.2.00.0030.00617.58
8.1.280.0110.00425.92
8.1.270.0030.01723.77
8.1.260.0140.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00322.40
8.1.230.0090.00317.77
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00717.25
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0080.00021.98
8.1.150.0040.00418.62
8.1.140.0070.00017.49
8.1.130.0000.00717.44
8.1.120.0000.00717.52
8.1.110.0040.00417.45
8.1.100.0030.00517.34
8.1.90.0030.00517.52
8.1.80.0040.00417.42
8.1.70.0000.00817.34
8.1.60.0090.00017.43
8.1.50.0030.00617.45
8.1.40.0030.00617.55
8.1.30.0090.00017.59
8.1.20.0040.00417.53
8.1.10.0000.00817.53
8.1.00.0000.00817.43
8.0.300.0030.00519.96
8.0.290.0030.00516.58
8.0.280.0080.00018.45
8.0.270.0070.00017.27
8.0.260.0030.00316.82
8.0.250.0070.00016.86
8.0.240.0070.00016.87
8.0.230.0000.00716.89
8.0.220.0070.00016.87
8.0.210.0000.00716.78
8.0.200.0000.00816.95
8.0.190.0040.00416.85
8.0.180.0040.00416.82
8.0.170.0030.00516.88
8.0.160.0040.00416.89
8.0.150.0000.00716.83
8.0.140.0040.00416.88
8.0.130.0000.00613.39
8.0.120.0000.00816.77
8.0.110.0040.00416.80
8.0.100.0040.00416.88
8.0.90.0050.00316.68
8.0.80.0090.00616.95
8.0.70.0000.00716.81
8.0.60.0080.00016.86
8.0.50.0000.00716.79
8.0.30.0150.00517.26
8.0.20.0150.00517.40
8.0.10.0040.00416.93
8.0.00.0090.01016.66
7.4.330.0050.00015.00
7.4.320.0020.00516.50
7.4.300.0000.00616.36
7.4.290.0030.00316.55
7.4.280.0040.00416.39
7.4.270.0050.00216.52
7.4.260.0000.00716.61
7.4.250.0040.00416.50
7.4.240.0020.00516.42
7.4.230.0030.00516.68
7.4.220.0090.00916.61
7.4.210.0050.00916.52
7.4.200.0040.00416.52
7.4.190.0080.00016.67
7.4.160.0080.00816.38
7.4.150.0140.00717.40
7.4.140.0120.01217.86
7.4.130.0120.00616.53
7.4.120.0110.00816.52
7.4.110.0140.00316.54
7.4.100.0030.01316.40
7.4.90.0120.00616.40
7.4.80.0090.01219.39
7.4.70.0030.01416.61
7.4.60.0100.00716.36
7.4.50.0000.00616.46
7.4.40.0070.01016.38
7.4.30.0150.00616.72
7.4.00.0070.00414.93
7.3.330.0030.00313.07
7.3.320.0000.00513.15
7.3.310.0070.00016.09
7.3.300.0000.00716.10
7.3.290.0110.00716.22
7.3.280.0070.01116.21
7.3.270.0130.00617.40
7.3.260.0140.00316.42
7.3.250.0120.00616.39
7.3.240.0110.00716.34
7.3.230.0070.01016.55
7.3.210.0060.01216.43
7.3.200.0080.00819.39
7.3.190.0140.00316.38
7.3.180.0070.01016.46
7.3.170.0090.00916.58
7.3.160.0140.00416.47
7.3.120.0100.00714.70
7.2.330.0140.01116.31
7.2.320.0090.01016.55
7.2.310.0130.00916.26
7.2.300.0180.00016.62
7.2.290.0170.00016.60
7.1.70.0000.00716.73
7.1.60.0070.01819.46
7.1.50.0040.00816.76
7.1.00.0070.07322.37
7.0.200.0000.00816.63
7.0.140.0000.07721.95
7.0.110.0070.06721.71
7.0.100.0130.07021.63
7.0.90.0130.04321.60
7.0.80.0100.06721.59
7.0.70.0000.07021.76
7.0.60.0070.06021.55
7.0.50.0130.05722.15
7.0.40.0100.07320.23
7.0.30.0070.06720.05
7.0.20.0130.05320.20
7.0.10.0030.04720.16
7.0.00.0070.04320.16
5.6.280.0000.07721.14
5.6.260.0100.05720.59
5.6.250.0070.04720.86
5.6.240.0030.05720.64
5.6.230.0070.08320.82
5.6.220.0070.04320.62
5.6.210.0100.03720.61
5.6.200.0100.07021.19
5.6.190.0000.04720.95
5.6.180.0070.04321.08
5.6.170.0130.06021.12
5.6.160.0030.08721.22
5.6.150.0100.05321.25
5.6.140.0070.03721.10
5.6.130.0070.08020.99
5.6.120.0100.07721.08
5.6.110.0030.06320.90
5.6.100.0030.06321.04
5.6.90.0000.03721.01
5.6.80.0000.03720.29
5.6.70.0000.08320.63
5.6.60.0000.04720.46
5.6.50.0000.07720.54
5.6.40.0070.06720.46
5.6.30.0000.04020.28
5.6.20.0000.03720.34
5.6.10.0030.08020.44
5.6.00.0030.03320.30
5.5.380.0030.08320.29
5.5.370.0130.07320.54
5.5.360.0030.07320.20
5.5.350.0070.09020.41
5.5.340.0100.07020.98
5.5.330.0070.06720.84
5.5.320.0030.07320.75
5.5.310.0070.04720.75
5.5.300.0030.05720.79
5.5.290.0000.07320.89
5.5.280.0100.08320.92
5.5.270.0030.09020.90
5.5.260.0000.04320.95
5.5.250.0030.03320.52
5.5.240.0000.07320.25
5.5.230.0000.07720.21
5.5.220.0000.04020.34
5.5.210.0030.07720.24
5.5.200.0100.07020.29
5.5.190.0000.04320.28
5.5.180.0070.03020.11
5.5.160.0000.04720.13
5.5.150.0130.02720.33
5.5.140.0030.03020.21
5.5.130.0030.03320.27
5.5.120.0100.02720.08
5.5.110.0000.08020.13
5.5.100.0000.08020.02
5.5.90.0030.06720.21
5.5.80.0100.06320.05
5.5.70.0030.07720.00
5.5.60.0030.05020.23
5.5.50.0030.04020.20
5.5.40.0030.03720.20
5.5.30.0030.03320.12
5.5.20.0100.06720.21
5.5.10.0030.03320.18
5.5.00.0030.07719.98
5.4.450.0000.04719.27
5.4.440.0030.04019.37
5.4.430.0070.07719.26
5.4.420.0100.04019.34
5.4.410.0030.03719.25
5.4.400.0030.06019.12
5.4.390.0030.03019.29
5.4.380.0070.03018.93
5.4.370.0100.03019.12
5.4.360.0000.07719.13
5.4.350.0000.05018.95
5.4.340.0030.03018.93
5.4.320.0030.03019.29
5.4.310.0000.07719.12
5.4.300.0100.07318.97
5.4.290.0030.03019.09
5.4.280.0000.07019.18
5.4.270.0000.03319.04
5.4.260.0000.04718.95
5.4.250.0000.03319.13
5.4.240.0030.03018.93
5.4.230.0030.05718.96
5.4.220.0070.05719.26
5.4.210.0070.04318.98
5.4.200.0070.06719.10
5.4.190.0070.06718.97
5.4.180.0000.03318.89
5.4.170.0000.08018.94
5.4.160.0000.07718.94
5.4.150.0000.07319.16
5.4.140.0030.07016.56
5.4.130.0000.06316.35
5.4.120.0030.07316.47
5.4.110.0000.03716.57
5.4.100.0000.03316.50
5.4.90.0030.07716.66
5.4.80.0070.06716.35
5.4.70.0070.05016.34
5.4.60.0000.03716.58
5.4.50.0030.06716.40
5.4.40.0030.04716.45
5.4.30.0000.03316.50
5.4.20.0070.07316.41
5.4.10.0000.07316.44
5.4.00.0070.06315.94
5.3.290.0070.07014.73
5.3.280.0130.06314.63
5.3.270.0130.02714.50
5.3.260.0000.06314.59
5.3.250.0070.05714.71
5.3.240.0000.07314.73
5.3.230.0030.03314.63
5.3.220.0000.03314.82
5.3.210.0070.03014.82
5.3.200.0100.02714.59
5.3.190.0030.08014.57
5.3.180.0030.03314.60
5.3.170.0030.07314.57
5.3.160.0000.06714.62
5.3.150.0030.05314.67
5.3.140.0030.03314.66
5.3.130.0030.06014.57
5.3.120.0130.02314.63
5.3.110.0070.03014.72
5.3.100.0000.05014.11
5.3.90.0030.04314.18
5.3.80.0000.04314.07
5.3.70.0100.03314.18
5.3.60.0030.03314.04
5.3.50.0070.06713.98
5.3.40.0070.07313.95
5.3.30.0070.02714.02
5.3.20.0030.06313.96
5.3.10.0070.02713.70
5.3.00.0000.07013.64
5.2.170.0000.06313.46
5.2.160.0000.02713.46
5.2.150.0000.04713.46
5.2.140.0030.06013.46
5.2.130.0030.05313.46
5.2.120.0000.05013.46
5.2.110.0030.05013.46
5.2.100.0070.05713.46
5.2.90.0000.04013.46
5.2.80.0000.05713.46
5.2.70.0000.02713.46
5.2.60.0100.01713.46
5.2.50.0030.05013.46
5.2.40.0070.03313.46
5.2.30.0030.05313.46
5.2.20.0100.05313.46
5.2.10.0030.02313.46
5.2.00.0070.05013.46
5.1.60.0100.04713.46
5.1.50.0070.05013.46
5.1.40.0030.04713.46
5.1.30.0070.02013.46
5.1.20.0030.02313.46
5.1.10.0100.04713.41
5.1.00.0000.04013.41
5.0.50.0230.02313.41
5.0.40.0000.04713.35
5.0.30.0000.05313.44
5.0.20.0030.04313.44
5.0.10.0030.04013.44
5.0.00.0000.03313.44
4.4.90.0000.03313.46
4.4.80.0000.01713.46
4.4.70.0030.01013.46
4.4.60.0000.02713.46
4.4.50.0000.02313.46
4.4.40.0000.02313.46
4.4.30.0000.03313.46
4.4.20.0000.02013.41
4.4.10.0030.03713.41
4.4.00.0300.02713.41
4.3.110.0100.01713.44
4.3.100.0030.03013.44
4.3.90.0000.02013.44
4.3.80.0070.05013.44
4.3.70.0000.03013.44
4.3.60.0070.02313.44
4.3.50.0030.02713.44
4.3.40.0030.05013.44
4.3.30.0030.01713.44
4.3.20.0030.03013.44
4.3.10.0030.03013.44
4.3.00.0000.02313.44

preferences:
44.25 ms | 401 KiB | 5 Q