3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Source: https://bugs.php.net/bug.php?id=63898 /* $key = utf8_encode("Foo " . chr(163)); $array = array($key => ""); var_dump($array); $json = json_encode($array); var_dump($json); $array2 = array($key); var_dump($array2, json_encode($array2)); var_dump(json_encode(utf8_encode('hey now ' . chr(180) . ' you’re dumb'))); var_dump(json_encode('hey now ' . chr(180) . ' you’re dumb')); */ $text = 'hey ' . chr(160); $arr = array('damnit' => $text); $utf = utf8_encode($text); $utfarr = array('damnit' => $utf); $json = json_encode($arr); $utfjson = json_encode($utfarr); var_dump($json, $utfjson); var_dump(json_decode($json), json_decode($utfjson)); /* $x = 'Audio Pass: Get live NFL game audio while you’re on the road with Audio Pass.'; var_dump(htmlentities($x)); var_dump(htmlentities($x, ENT_COMPAT | ENT_SUBSTITUTE, 'ISO-8859-1')); var_dump(htmlentities($x, ENT_COMPAT | ENT_SUBSTITUTE, '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)
8.3.60.0110.00416.63
8.3.50.0090.00922.85
8.3.40.0040.01118.99
8.3.30.0120.00319.02
8.3.20.0050.00320.16
8.3.10.0080.00023.48
8.3.00.0080.00019.13
8.2.180.0150.00018.29
8.2.170.0060.01222.96
8.2.160.0110.00420.39
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0050.00219.91
8.2.110.0060.00320.52
8.2.100.0080.00418.22
8.2.90.0040.00419.05
8.2.80.0000.00917.97
8.2.70.0070.00317.75
8.2.60.0060.00318.04
8.2.50.0000.00818.07
8.2.40.0050.00318.22
8.2.30.0000.00818.16
8.2.20.0050.00217.77
8.2.10.0030.00617.92
8.2.00.0040.00417.74
8.1.280.0070.00725.92
8.1.270.0040.00423.97
8.1.260.0040.00426.35
8.1.250.0020.00528.09
8.1.240.0000.00923.91
8.1.230.0110.00019.16
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0030.00617.22
8.1.180.0000.00818.10
8.1.170.0040.00418.59
8.1.160.0070.00021.93
8.1.150.0020.00518.73
8.1.140.0000.00717.39
8.1.130.0030.00317.69
8.1.120.0050.00317.30
8.1.110.0000.00717.35
8.1.100.0030.00517.40
8.1.90.0040.00417.35
8.1.80.0050.00517.41
8.1.70.0030.00317.32
8.1.60.0070.00717.51
8.1.50.0000.00817.43
8.1.40.0030.00517.41
8.1.30.0000.00817.51
8.1.20.0040.00417.54
8.1.10.0000.00717.52
8.1.00.0000.00817.30
8.0.300.0050.00318.77
8.0.290.0040.00416.58
8.0.280.0040.00418.38
8.0.270.0050.00317.24
8.0.260.0000.00617.12
8.0.250.0040.00416.90
8.0.240.0000.00716.75
8.0.230.0060.00316.72
8.0.220.0040.00416.78
8.0.210.0040.00416.85
8.0.200.0030.00316.88
8.0.190.0070.00016.75
8.0.180.0040.00416.81
8.0.170.0030.00516.88
8.0.160.0040.00416.69
8.0.150.0030.00516.74
8.0.140.0070.00016.81
8.0.130.0060.00013.18
8.0.120.0080.00016.70
8.0.110.0000.00716.73
8.0.100.0040.00416.86
8.0.90.0030.00316.78
8.0.80.0040.01416.77
8.0.70.0000.00716.93
8.0.60.0000.00716.73
8.0.50.0040.00416.59
8.0.30.0070.01216.89
8.0.20.0130.01017.40
8.0.10.0000.00717.00
8.0.00.0090.00816.82
7.4.330.0000.00715.08
7.4.320.0000.00716.48
7.4.300.0000.00616.47
7.4.290.0030.00316.38
7.4.280.0070.00016.40
7.4.270.0000.00716.34
7.4.260.0070.00016.39
7.4.250.0070.00016.32
7.4.240.0020.00516.43
7.4.230.0030.00316.64
7.4.220.0150.00316.44
7.4.210.0080.00516.58
7.4.200.0000.00716.34
7.4.160.0080.00816.38
7.4.150.0120.01217.40
7.4.140.0080.00917.86
7.4.130.0090.01216.42
7.4.120.0120.00516.40
7.4.110.0080.00816.43
7.4.100.0100.01016.32
7.4.90.0130.00416.25
7.4.80.0040.01219.39
7.4.70.0090.00916.18
7.4.60.0090.00616.31
7.4.50.0080.00016.50
7.4.40.0090.01316.35
7.4.30.0120.00416.42
7.4.00.0030.01314.96
7.3.330.0020.00212.94
7.3.320.0030.00313.02
7.3.310.0000.00716.23
7.3.300.0070.00016.22
7.3.290.0040.01116.14
7.3.280.0060.00916.21
7.3.270.0060.01217.40
7.3.260.0140.00816.36
7.3.250.0070.01016.32
7.3.240.0190.00316.52
7.3.230.0100.00616.39
7.3.210.0130.00416.29
7.3.200.0060.01219.39
7.3.190.0120.00916.29
7.3.180.0110.00716.10
7.3.170.0100.00616.27
7.3.160.0090.00616.16
7.3.10.0060.00616.59
7.3.00.0120.00016.35
7.2.330.0120.00916.77
7.2.320.0100.00716.52
7.2.310.0130.00316.27
7.2.300.0100.00716.59
7.2.290.0100.00716.52
7.2.130.0070.00716.71
7.2.120.0030.01016.91
7.2.110.0100.00716.75
7.2.100.0080.00816.55
7.2.90.0030.01016.82
7.2.80.0060.00916.91
7.2.70.0080.00616.81
7.2.60.0000.01416.89
7.2.50.0070.00716.95
7.2.40.0040.01216.88
7.2.30.0090.00616.72
7.2.20.0040.01416.49
7.2.10.0000.01816.79
7.2.00.0050.01018.05
7.1.250.0100.00315.66
7.1.200.0100.00715.77
7.1.100.0280.00918.06
7.1.70.0040.00717.22
7.1.60.0140.01119.46
7.1.50.0070.01616.79
7.1.00.0070.07322.43
7.0.200.0000.00916.72
7.0.140.0070.07322.08
7.0.90.0170.07319.98
7.0.80.0000.08019.95
7.0.70.0070.05719.92
7.0.60.0100.07020.05
7.0.50.0130.08020.32
7.0.40.0000.08020.11
7.0.30.0070.08020.19
7.0.20.0330.03320.05
7.0.10.0100.07320.14
7.0.00.0000.06720.07
5.6.280.0100.06720.90
5.6.240.0070.05020.57
5.6.230.0130.03320.59
5.6.220.0070.07720.67
5.6.210.0030.04320.75
5.6.200.0100.04321.17
5.6.190.0170.07020.95
5.6.180.0030.08720.95
5.6.170.0100.07720.91
5.6.160.0100.08021.11
5.6.150.0030.07021.02
5.6.140.0070.07321.04
5.6.130.0100.08020.98
5.6.120.0030.08721.01
5.6.110.0130.06321.07
5.6.100.0100.03721.09
5.6.90.0030.04720.93
5.6.80.0070.03720.31
5.6.70.0000.05020.32
5.6.60.0170.07320.35
5.6.50.0130.04020.41
5.6.40.0070.08020.30
5.6.30.0130.07320.39
5.6.20.0100.06320.35
5.6.10.0170.05720.43
5.6.00.0000.08020.50
5.5.380.0130.08020.44
5.5.370.0130.07320.44
5.5.360.0030.04720.47
5.5.350.0030.05020.32
5.5.340.0070.06320.89
5.5.330.0100.07320.89
5.5.320.0030.07720.82
5.5.310.0170.08020.75
5.5.300.0070.08320.85
5.5.290.0100.08020.88
5.5.280.0070.08320.92
5.5.270.0070.05020.80
5.5.260.0100.07320.74
5.5.250.0100.08020.56
5.5.240.0130.07320.30
5.5.230.0030.07020.20
5.5.220.0070.07720.29
5.5.210.0030.04020.15
5.5.200.0070.04720.24
5.5.190.0070.08020.23
5.5.180.0070.07019.98
5.5.160.0130.06020.07
5.5.150.0130.06020.09
5.5.140.0130.07320.27
5.5.130.0070.04720.25
5.5.120.0070.06019.96
5.5.110.0030.05020.23
5.5.100.0070.06720.09
5.5.90.0030.04320.09
5.5.80.0100.07320.10
5.5.70.0030.07720.09
5.5.60.0100.07019.93
5.5.50.0170.07320.04
5.5.40.0100.07719.95
5.5.30.0070.07320.13
5.5.20.0070.05720.08
5.5.10.0070.08019.96
5.5.00.0030.07320.04
5.4.450.0000.05319.38
5.4.440.0100.04719.38
5.4.430.0070.08019.24
5.4.420.0070.07319.34
5.4.410.0030.03719.25
5.4.400.0030.05019.07
5.4.390.0130.04719.14
5.4.380.0030.04318.96
5.4.370.0070.03719.14
5.4.360.0070.06719.10
5.4.350.0100.04019.06
5.4.340.0070.06318.90
5.4.320.0100.07319.22
5.4.310.0100.06318.79
5.4.300.0070.04019.22
5.4.290.0030.07719.09
5.4.280.0100.05018.78
5.4.270.0000.07319.11
5.4.260.0070.04318.80
5.4.250.0000.06018.77
5.4.240.0070.07318.82
5.4.230.0200.06318.80
5.4.220.0100.07019.02
5.4.210.0000.05719.02
5.4.200.0030.05318.97
5.4.190.0130.05019.13
5.4.180.0070.05719.21
5.4.170.0100.07318.94
5.4.160.0100.05019.20
5.4.150.0000.05718.85
5.4.140.0030.03716.23
5.4.130.0100.03716.34
5.4.120.0070.03316.28
5.4.110.0030.03716.21
5.4.100.0070.03316.30
5.4.90.0070.03316.22
5.4.80.0030.04016.29
5.4.70.0000.04016.41
5.4.60.0070.03316.37
5.4.50.0000.04016.35
5.4.40.0000.04716.51
5.4.30.0070.04316.18
5.4.20.0100.04716.35
5.4.10.0030.03016.35
5.4.00.0130.05315.64
5.3.290.0070.05314.64
5.3.280.0070.07014.59
5.3.270.0100.07714.52
5.3.260.0070.04314.57
5.3.250.0100.04314.44
5.3.240.0000.04314.59
5.3.230.0070.04314.45
5.3.220.0000.04014.57
5.3.210.0070.02714.41
5.3.200.0000.04014.54
5.3.190.0170.02314.48
5.3.180.0070.03314.42
5.3.170.0070.03014.57
5.3.160.0030.03714.42
5.3.150.0070.03314.39
5.3.140.0000.03314.39
5.3.130.0070.06014.46
5.3.120.0030.03314.50
5.3.110.0070.07014.37
5.3.100.0000.03713.90
5.3.90.0100.06714.01
5.3.80.0070.06313.79
5.3.70.0070.05713.87
5.3.60.0000.03713.95
5.3.50.0130.06713.91
5.3.40.0070.06713.80
5.3.30.0000.04013.91
5.3.20.0070.03713.54
5.3.10.0000.03713.51
5.3.00.0000.03713.64
5.2.170.0030.03711.19
5.2.160.0030.03011.00
5.2.150.0030.03310.99
5.2.140.0000.03011.13
5.2.130.0070.02711.14
5.2.120.0030.02711.02
5.2.110.0000.03011.04
5.2.100.0000.03011.09
5.2.90.0070.02311.13
5.2.80.0000.03311.16
5.2.70.0000.03010.88
5.2.60.0070.02311.09
5.2.50.0000.03710.96
5.2.40.0070.02310.84
5.2.30.0000.03010.96
5.2.20.0000.03010.99
5.2.10.0030.02710.92
5.2.00.0000.03010.61
5.1.60.0000.0239.82
5.1.50.0030.0239.82
5.1.40.0030.0209.97
5.1.30.0000.03010.28
5.1.20.0000.02710.35
5.1.10.0030.02710.13
5.1.00.0100.01710.05
5.0.50.0030.0308.56
5.0.40.0030.0308.45
5.0.30.0000.0408.30
5.0.20.0000.0208.18
5.0.10.0000.0238.23
5.0.00.0030.0308.02
4.4.90.0000.0177.32
4.4.80.0000.0137.32
4.4.70.0000.0207.32
4.4.60.0030.0177.32
4.4.50.0000.0177.32
4.4.40.0000.0237.32
4.4.30.0030.0177.32
4.4.20.0000.0177.32
4.4.10.0000.0177.32
4.4.00.0000.0277.32
4.3.110.0000.0137.32
4.3.100.0000.0177.32
4.3.90.0030.0137.32
4.3.80.0000.0237.32
4.3.70.0000.0207.32
4.3.60.0000.0177.32
4.3.50.0030.0277.32
4.3.40.0030.0237.32
4.3.30.0030.0137.32
4.3.20.0070.0107.32
4.3.10.0000.0177.32
4.3.00.0000.0177.32

preferences:
50.08 ms | 401 KiB | 5 Q