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,JSON_UNESCAPED_UNICODE); $utfjson = json_encode($utfarr,JSON_UNESCAPED_UNICODE); 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.0040.01116.88
8.3.50.0100.01022.86
8.3.40.0170.00018.84
8.3.30.0070.00719.04
8.3.20.0050.00320.33
8.3.10.0070.00023.48
8.3.00.0000.00919.26
8.2.180.0080.00818.66
8.2.170.0100.00722.96
8.2.160.0070.01420.32
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00420.95
8.2.110.0060.00319.31
8.2.100.0060.00917.91
8.2.90.0080.00019.17
8.2.80.0000.00817.97
8.2.70.0090.00017.63
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0000.00718.34
8.2.30.0000.00717.94
8.2.20.0000.00717.73
8.2.10.0040.00417.94
8.2.00.0040.00417.68
8.1.280.0070.00725.92
8.1.270.0060.00323.83
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00619.42
8.1.230.0040.00720.89
8.1.220.0000.00818.56
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0000.00917.09
8.1.180.0030.00518.10
8.1.170.0040.00418.54
8.1.160.0040.00421.83
8.1.150.0060.00318.73
8.1.140.0000.00717.38
8.1.130.0030.00317.74
8.1.120.0040.00417.40
8.1.110.0040.00417.40
8.1.100.0030.00617.41
8.1.90.0050.00217.30
8.1.80.0000.00917.39
8.1.70.0000.00717.37
8.1.60.0000.01017.40
8.1.50.0040.00417.43
8.1.40.0060.00317.46
8.1.30.0070.00017.54
8.1.20.0020.00517.63
8.1.10.0000.00717.38
8.1.00.0060.00317.45
8.0.300.0000.00718.77
8.0.290.0050.00216.75
8.0.280.0070.00018.23
8.0.270.0050.00317.16
8.0.260.0060.00017.13
8.0.250.0000.00716.77
8.0.240.0000.00816.88
8.0.230.0000.00716.91
8.0.220.0000.00716.80
8.0.210.0040.00416.82
8.0.200.0030.00516.91
8.0.190.0050.00216.78
8.0.180.0000.00816.87
8.0.170.0080.00016.76
8.0.160.0030.00316.72
8.0.150.0030.00316.70
8.0.140.0070.00016.79
8.0.130.0030.00313.19
8.0.120.0040.00416.79
8.0.110.0030.00616.77
8.0.100.0000.00816.80
8.0.90.0040.00416.87
8.0.80.0090.00616.71
8.0.70.0080.00016.77
8.0.60.0000.00716.70
8.0.50.0000.00716.71
8.0.30.0100.01017.04
8.0.20.0090.01017.40
8.0.10.0040.00416.91
8.0.00.0080.01116.59
7.4.330.0040.00315.00
7.4.320.0030.00316.52
7.4.300.0060.00016.56
7.4.290.0070.00016.57
7.4.280.0070.00016.35
7.4.270.0040.00416.48
7.4.260.0000.00616.57
7.4.250.0070.00016.51
7.4.240.0000.00816.57
7.4.230.0000.00716.55
7.4.220.0100.00716.56
7.4.210.0040.01116.36
7.4.200.0040.00416.36
7.4.160.0090.00616.28
7.4.150.0090.01217.40
7.4.140.0080.01017.86
7.4.130.0090.00916.52
7.4.120.0110.00516.31
7.4.110.0100.00716.34
7.4.100.0110.00616.64
7.4.90.0100.00716.50
7.4.80.0130.01019.39
7.4.70.0100.00616.55
7.4.60.0000.01616.21
7.4.50.0050.00316.45
7.4.40.0160.00616.36
7.4.30.0100.00716.42
7.4.00.0030.01114.88
7.3.330.0000.00513.14
7.3.320.0050.00212.91
7.3.310.0030.00516.28
7.3.300.0000.00716.19
7.3.290.0060.00916.16
7.3.280.0060.00916.19
7.3.270.0060.01217.40
7.3.260.0160.00316.47
7.3.250.0090.01416.37
7.3.240.0090.01216.19
7.3.230.0030.01316.39
7.3.210.0120.01016.21
7.3.200.0110.00619.39
7.3.190.0130.00916.21
7.3.180.0070.01416.33
7.3.170.0090.00916.57
7.3.160.0000.01516.43
7.3.120.0000.01414.59
7.3.110.0060.00914.50
7.3.100.0100.00714.45
7.3.90.0030.01014.81
7.3.80.0030.01214.89
7.3.70.0060.00914.66
7.3.60.0060.00614.79
7.3.50.0030.01314.64
7.3.40.0030.01314.90
7.3.30.0040.00714.49
7.3.20.0070.01016.74
7.3.10.0030.01016.58
7.3.00.0070.01016.39
7.2.330.0110.00816.54
7.2.320.0070.01016.54
7.2.310.0180.00616.37
7.2.300.0090.00916.64
7.2.290.0000.01516.59
7.2.240.0000.01115.09
7.2.230.0090.00914.86
7.2.220.0000.01214.98
7.2.210.0040.01215.18
7.2.200.0070.00414.82
7.2.190.0060.01214.61
7.2.180.0000.01414.65
7.2.170.0030.01214.87
7.2.160.0040.01114.91
7.2.150.0120.00316.88
7.2.140.0030.00616.91
7.2.130.0030.01316.81
7.2.120.0060.00617.02
7.2.110.0070.01016.81
7.2.100.0070.01116.85
7.2.90.0040.01116.91
7.2.80.0030.01017.03
7.2.70.0030.01217.09
7.2.60.0080.00616.75
7.2.50.0030.01116.93
7.2.40.0030.01316.75
7.2.30.0070.00716.47
7.2.20.0100.00617.05
7.2.10.0060.00917.04
7.2.00.0030.01017.84
7.1.330.0000.01515.75
7.1.320.0040.01115.56
7.1.310.0040.01115.88
7.1.300.0030.00715.82
7.1.290.0120.00015.69
7.1.280.0070.00715.55
7.1.270.0090.00015.75
7.1.260.0100.00715.83
7.1.250.0090.00615.75
7.1.200.0050.00815.65
7.1.100.0380.00817.93
7.1.70.0000.00917.02
7.1.60.0110.01519.46
7.1.50.0090.01616.95
7.1.00.0000.08022.45
7.0.200.0030.00616.66
7.0.140.0100.06722.08
7.0.90.0100.07719.93
7.0.80.0000.07319.90
7.0.70.0070.08319.95
7.0.60.0130.07319.91
7.0.50.0070.08320.23
7.0.40.0070.05320.01
7.0.30.0070.08320.11
7.0.20.0100.07020.11
7.0.10.0100.08020.17
7.0.00.0100.06720.03
5.6.280.0030.07021.14
5.6.240.0030.05320.66
5.6.230.0100.08020.74
5.6.220.0070.07720.67
5.6.210.0030.09020.64
5.6.200.0070.05721.03
5.6.190.0000.07721.03
5.6.180.0070.08321.03
5.6.170.0070.05020.94
5.6.160.0030.06721.05
5.6.150.0100.03721.13
5.6.140.0030.08321.05
5.6.130.0100.07321.04
5.6.120.0130.08721.09
5.6.110.0030.06021.02
5.6.100.0070.05020.94
5.6.90.0070.08320.93
5.6.80.0030.05720.45
5.6.70.0030.04020.41
5.6.60.0170.07020.39
5.6.50.0070.08020.42
5.6.40.0070.08020.42
5.6.30.0070.08320.37
5.6.20.0030.05720.30
5.6.10.0070.07320.43
5.6.00.0100.07020.36
5.5.380.0130.07320.54
5.5.370.0070.08720.38
5.5.360.0030.08320.43
5.5.350.0000.05720.41
5.5.340.0070.08320.63
5.5.330.0100.08320.89
5.5.320.0100.07720.85
5.5.310.0070.08020.91
5.5.300.0030.08020.75
5.5.290.0130.07320.88
5.5.280.0030.05320.75
5.5.270.0070.04020.84
5.5.260.0170.07320.85
5.5.250.0030.05020.69
5.5.240.0030.05020.00
5.5.230.0130.07020.27
5.5.220.0070.07720.20
5.5.210.0100.07320.27
5.5.200.0030.08320.10
5.5.190.0070.05020.26
5.5.180.0070.07720.26
5.5.160.0100.08020.10
5.5.150.0100.05020.24
5.5.140.0100.06320.22
5.5.130.0070.07020.16
5.5.120.0070.04320.24
5.5.110.0030.04020.19
5.5.100.0170.05320.17
5.5.90.0130.06320.15
5.5.80.0130.07320.06
5.5.70.0100.08020.05
5.5.60.0200.07020.10
5.5.50.0070.04719.92
5.5.40.0070.07320.04
5.5.30.0000.07720.08
5.5.20.0130.04020.14
5.5.10.0070.04320.10
5.5.00.0170.07020.09
5.4.450.0070.08019.45
5.4.440.0000.04319.11
5.4.430.0100.07019.35
5.4.420.0100.08019.11
5.4.410.0030.06319.18
5.4.400.0100.06718.82
5.4.390.0230.06018.78
5.4.380.0070.07319.12
5.4.370.0130.07018.79
5.4.360.0070.04018.81
5.4.350.0070.07018.90
5.4.340.0130.04718.98
5.4.320.0070.07318.96
5.4.310.0170.06319.12
5.4.300.0100.06319.04
5.4.290.0100.07318.96
5.4.280.0070.08018.97
5.4.270.0030.04019.04
5.4.260.0070.07319.23
5.4.250.0070.04318.93
5.4.240.0130.06318.97
5.4.230.0100.06319.14
5.4.220.0070.08019.04
5.4.210.0030.08019.22
5.4.200.0000.08019.09
5.4.190.0070.04319.02
5.4.180.0070.07318.88
5.4.170.0130.04319.07
5.4.160.0100.06018.94
5.4.150.0100.06719.12
5.4.140.0100.07016.23
5.4.130.0030.03716.01
5.4.120.0100.06716.31
5.4.110.0100.06016.28
5.4.100.0030.07016.44
5.4.90.0100.07016.41
5.4.80.0100.07316.20
5.4.70.0200.06016.39
5.4.60.0030.07316.28
5.4.50.0070.06316.30
5.4.40.0070.04716.26
5.4.30.0100.07016.29
5.4.20.0100.04016.32
5.4.10.0130.06316.39
5.4.00.0070.07015.78
5.3.290.0000.05314.57
5.3.280.0200.06014.55
5.3.270.0030.04014.59
5.3.260.0030.04714.58
5.3.250.0030.04014.56
5.3.240.0000.04314.48
5.3.230.0170.06314.46
5.3.220.0030.05714.57
5.3.210.0070.07714.57
5.3.200.0070.07014.52
5.3.190.0130.07014.52
5.3.180.0070.07314.55
5.3.170.0070.07014.42
5.3.160.0070.07314.43
5.3.150.0200.06314.55
5.3.140.0070.06014.41
5.3.130.0100.07314.45
5.3.120.0030.08314.49
5.3.110.0030.07014.52
5.3.100.0030.05313.89
5.3.90.0030.07314.01
5.3.80.0070.07714.00
5.3.70.0000.05014.01
5.3.60.0100.04713.93
5.3.50.0070.07013.89
5.3.40.0130.06313.80
5.3.30.0070.07013.89
5.3.20.0100.06713.67
5.3.10.0000.07313.64
5.3.00.0000.06713.64
5.2.170.0130.05711.06
5.2.160.0130.05310.99
5.2.150.0100.05710.93
5.2.140.0000.06711.00
5.2.130.0070.06011.06
5.2.120.0030.03710.85
5.2.110.0030.06010.93
5.2.100.0100.05311.10
5.2.90.0030.06311.02
5.2.80.0030.04011.02
5.2.70.0030.06711.12
5.2.60.0030.04711.07
5.2.50.0100.05711.06
5.2.40.0100.05710.96
5.2.30.0070.05310.89
5.2.20.0030.04011.01
5.2.10.0030.04010.88
5.2.00.0130.03710.77
5.1.60.0030.0439.83
5.1.50.0000.03710.02
5.1.40.0100.0439.80
5.1.30.0030.04010.42
5.1.20.0030.05710.21
5.1.10.0030.04710.07
5.1.00.0030.0539.96
5.0.50.0000.0308.63
5.0.40.0000.0308.45
5.0.30.0030.0578.21
5.0.20.0070.0378.31
5.0.10.0030.0338.25
5.0.00.0070.0478.14
4.4.90.0000.0377.13
4.4.80.0000.0377.13
4.4.70.0100.0277.13
4.4.60.0000.0377.13
4.4.50.0070.0277.13
4.4.40.0100.0207.13
4.4.30.0030.0337.13
4.4.20.0030.0207.13
4.4.10.0030.0377.13
4.4.00.0000.0477.13
4.3.110.0070.0307.13
4.3.100.0030.0337.13
4.3.90.0000.0377.13
4.3.80.0100.0407.13
4.3.70.0000.0307.13
4.3.60.0030.0307.13
4.3.50.0030.0237.13
4.3.40.0000.0537.13
4.3.30.0000.0377.13
4.3.20.0070.0177.13
4.3.10.0000.0177.13
4.3.00.0000.0177.13

preferences:
48.37 ms | 401 KiB | 5 Q