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)); */ //$v = array('hey' => 'yo', 'bad' => 'guy ' . chr(160)); //$v = array('hey' => 'yo', 'bad' => 'Audio Pass: Get live NFL game audio while you’re on the road with Audio Pass.'); $v = new stdClass(); $v->hey = 'yo'; //$v->bad = 'guy ' . chr(160); $v->bad = 'Audio Pass: Get live NFL game audio while you’re on the road with Audio Pass.'; $json1 = json_encode($v); var_dump($v, $json1, json_decode($json1, false)); /* $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.40.0060.00918.46
8.3.30.0070.01419.09
8.3.20.0080.00020.34
8.3.10.0080.00023.65
8.3.00.0060.00319.25
8.2.170.0110.00322.96
8.2.160.0140.00020.39
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0070.00019.82
8.2.110.0050.00320.52
8.2.100.0040.00817.80
8.2.90.0080.00019.13
8.2.80.0050.00317.97
8.2.70.0050.00317.50
8.2.60.0080.00017.68
8.2.50.0040.00418.07
8.2.40.0080.00019.82
8.2.30.0000.00718.00
8.2.20.0040.00417.69
8.2.10.0040.00417.98
8.2.00.0000.00717.55
8.1.270.0040.00423.95
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0100.00022.16
8.1.230.0110.00019.00
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0050.00417.35
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0070.00018.66
8.1.160.0080.00021.95
8.1.150.0070.00018.82
8.1.140.0070.00017.27
8.1.130.0030.00517.71
8.1.120.0000.00717.32
8.1.110.0040.00417.46
8.1.100.0000.00717.34
8.1.90.0000.00717.41
8.1.80.0030.00517.40
8.1.70.0030.00317.36
8.1.60.0000.00817.62
8.1.50.0040.00417.46
8.1.40.0040.00417.44
8.1.30.0030.00617.52
8.1.20.0040.00417.50
8.1.10.0040.00417.55
8.1.00.0040.00417.50
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0000.00818.30
8.0.270.0000.00717.24
8.0.260.0050.00317.13
8.0.250.0070.00016.95
8.0.240.0050.00316.86
8.0.230.0000.00716.88
8.0.220.0030.00316.89
8.0.210.0030.00316.81
8.0.200.0060.00016.77
8.0.190.0030.00316.89
8.0.180.0030.00516.92
8.0.170.0050.00316.92
8.0.160.0000.00716.75
8.0.150.0040.00416.85
8.0.140.0000.00716.81
8.0.130.0000.00613.21
8.0.120.0050.00316.77
8.0.110.0000.00716.83
8.0.100.0030.00616.70
8.0.90.0000.00716.64
8.0.80.0060.01016.73
8.0.70.0070.00016.65
8.0.60.0030.00616.79
8.0.50.0000.00716.90
8.0.30.0150.00717.15
8.0.20.0090.01317.40
8.0.10.0040.00416.95
8.0.00.0060.01216.58
7.4.330.0050.00015.07
7.4.320.0000.00616.47
7.4.300.0060.00316.34
7.4.290.0000.00716.41
7.4.280.0040.00416.46
7.4.270.0050.00316.36
7.4.260.0030.00316.52
7.4.250.0050.00216.42
7.4.240.0030.00416.47
7.4.230.0000.00716.58
7.4.220.0030.02016.65
7.4.210.0100.00316.63
7.4.200.0030.00316.63
7.4.160.0130.00716.28
7.4.150.0070.01717.40
7.4.140.0060.01117.86
7.4.130.0120.00916.43
7.4.120.0070.01016.40
7.4.110.0120.00616.46
7.4.100.0230.00016.35
7.4.90.0080.01216.36
7.4.80.0120.00919.39
7.4.70.0150.00316.50
7.4.60.0120.00616.05
7.4.50.0000.00816.26
7.4.40.0170.00016.52
7.4.30.0090.00816.59
7.4.00.0050.01314.62
7.3.330.0000.00712.96
7.3.320.0000.00513.04
7.3.310.0050.00216.35
7.3.300.0030.00316.10
7.3.290.0100.00716.30
7.3.280.0120.00616.18
7.3.270.0080.01117.40
7.3.260.0070.01316.23
7.3.250.0080.00916.27
7.3.240.0140.00316.25
7.3.230.0100.00716.39
7.3.210.0140.01116.32
7.3.200.0040.01219.39
7.3.190.0140.00916.27
7.3.180.0080.00816.18
7.3.170.0100.00516.27
7.3.160.0080.00816.24
7.3.120.0060.01214.68
7.3.110.0040.01114.98
7.3.100.0060.00614.70
7.3.90.0030.00615.00
7.3.80.0100.00614.72
7.3.70.0080.00414.86
7.3.60.0030.01214.75
7.3.50.0030.00614.75
7.3.40.0070.00714.75
7.3.30.0060.00614.70
7.3.20.0090.00316.43
7.3.10.0070.00716.57
7.3.00.0090.00616.57
7.2.330.0080.00816.31
7.2.320.0090.00916.42
7.2.310.0000.01716.59
7.2.300.0090.00916.34
7.2.290.0040.01216.66
7.2.250.0090.00915.09
7.2.240.0060.01214.88
7.2.230.0100.00614.88
7.2.220.0100.00314.75
7.2.210.0000.00915.16
7.2.200.0060.00314.86
7.2.190.0110.00314.82
7.2.180.0030.01014.81
7.2.170.0090.00314.61
7.2.60.0070.00716.56
7.2.00.0170.00719.28
7.1.330.0060.00615.86
7.1.320.0090.00015.62
7.1.310.0100.00315.64
7.1.300.0120.00315.61
7.1.290.0000.01415.80
7.1.280.0140.00015.86
7.1.270.0060.00915.72
7.1.260.0030.00715.64
7.1.200.0100.00315.73
7.1.100.0110.00017.83
7.1.70.0070.00416.77
7.1.60.0170.00719.46
7.1.50.0030.00917.02
7.1.00.0070.07322.31
7.0.200.0040.00416.79
7.0.140.0030.07322.10
7.0.90.0030.06720.14
7.0.80.0000.04319.98
7.0.70.0330.05020.00
7.0.60.0430.04020.03
7.0.50.0500.05320.25
7.0.40.0070.04020.14
7.0.30.0100.04020.04
7.0.20.0230.07020.11
7.0.10.0070.08720.09
7.0.00.0000.09320.11
5.6.280.0030.07020.81
5.6.240.0070.03720.69
5.6.230.0030.04020.78
5.6.220.0130.02720.58
5.6.210.0000.04320.66
5.6.200.0000.05321.08
5.6.190.0030.04721.02
5.6.180.0000.04321.16
5.6.170.0130.05321.10
5.6.160.0070.05021.03
5.6.150.0130.04721.03
5.6.140.0200.05721.04
5.6.130.0070.06721.08
5.6.120.0070.05021.02
5.6.110.0100.06320.95
5.6.100.0200.07021.00
5.6.90.0170.07320.91
5.6.80.0030.08720.33
5.6.70.0170.06020.39
5.6.60.0030.08320.50
5.6.50.0100.07020.46
5.6.40.0100.06720.43
5.6.30.0100.08020.38
5.6.20.0130.06720.29
5.6.10.0030.04320.27
5.6.00.0070.08020.26
5.5.380.0130.03020.54
5.5.370.0100.06320.52
5.5.360.0070.03320.44
5.5.350.0030.05020.36
5.5.340.0070.05020.64
5.5.330.0030.05020.90
5.5.320.0100.03320.92
5.5.310.0100.05020.87
5.5.300.0100.08320.88
5.5.290.0070.04720.91
5.5.280.0100.08020.77
5.5.270.0000.09320.78
5.5.260.0070.05320.71
5.5.250.0070.08720.72
5.5.240.0130.05320.00
5.5.230.0230.06320.17
5.5.220.0030.08320.29
5.5.210.0100.07320.25
5.5.200.0100.07720.08
5.5.190.0070.08320.23
5.5.180.0070.08020.24
5.5.160.0030.05320.08
5.5.150.0030.06720.13
5.5.140.0130.07320.22
5.5.130.0070.07020.17
5.5.120.0030.05020.10
5.5.110.0200.06720.24
5.5.100.0100.07320.05
5.5.90.0070.06720.12
5.5.80.0070.05320.10
5.5.70.0030.04320.05
5.5.60.0100.07019.93
5.5.50.0070.07320.05
5.5.40.0030.07720.16
5.5.30.0070.08020.13
5.5.20.0030.08720.14
5.5.10.0170.07019.94
5.5.00.0100.05719.96
5.4.450.0070.08319.24
5.4.440.0070.07719.21
5.4.430.0100.08019.31
5.4.420.0030.08719.48
5.4.410.0030.08319.18
5.4.400.0030.08719.12
5.4.390.0070.08018.93
5.4.380.0030.05319.09
5.4.370.0070.07318.97
5.4.360.0030.07718.96
5.4.350.0200.06318.93
5.4.340.0000.08318.96
5.4.320.0100.07718.96
5.4.310.0030.06318.89
5.4.300.0030.05719.23
5.4.290.0030.07718.96
5.4.280.0070.04718.89
5.4.270.0000.08018.81
5.4.260.0100.04718.89
5.4.250.0030.05718.79
5.4.240.0070.04019.06
5.4.230.0130.07019.21
5.4.220.0200.06318.93
5.4.210.0100.07318.79
5.4.200.0070.07718.97
5.4.190.0130.06318.88
5.4.180.0100.07019.23
5.4.170.0130.06719.09
5.4.160.0100.07719.07
5.4.150.0000.05718.88
5.4.140.0070.03316.02
5.4.130.0070.07716.23
5.4.120.0030.05316.28
5.4.110.0070.08016.22
5.4.100.0130.04316.26
5.4.90.0170.06716.34
5.4.80.0130.03716.32
5.4.70.0230.06016.25
5.4.60.0030.07716.21
5.4.50.0100.04316.23
5.4.40.0070.06716.25
5.4.30.0100.04316.31
5.4.20.0070.07716.36
5.4.10.0100.06316.20
5.4.00.0100.07015.52
5.3.290.0100.06714.63
5.3.280.0030.07714.58
5.3.270.0100.07714.60
5.3.260.0070.06314.46
5.3.250.0030.05714.44
5.3.240.0100.06714.42
5.3.230.0070.06714.42
5.3.220.0100.06714.53
5.3.210.0030.05014.44
5.3.200.0070.07714.39
5.3.190.0070.05314.51
5.3.180.0070.06314.38
5.3.170.0100.04014.42
5.3.160.0070.04014.55
5.3.150.0030.04714.57
5.3.140.0000.08014.54
5.3.130.0000.07714.54
5.3.120.0030.05014.51
5.3.110.0000.08314.41
5.3.100.0070.07714.05
5.3.90.0070.07314.00
5.3.80.0130.07013.84
5.3.70.0030.06714.00
5.3.60.0030.05713.86
5.3.50.0070.07013.80
5.3.40.0000.05013.81
5.3.30.0000.06013.84
5.3.20.0170.06313.66
5.3.10.0030.05313.51
5.3.00.0070.07713.63
5.2.170.0070.04311.00
5.2.160.0030.04711.10
5.2.150.0070.05711.00
5.2.140.0070.06711.13
5.2.130.0100.04711.09
5.2.120.0030.05310.91
5.2.110.0170.05011.02
5.2.100.0030.06011.15
5.2.90.0030.04310.94
5.2.80.0030.06311.18
5.2.70.0070.06310.91
5.2.60.0070.05711.12
5.2.50.0030.06311.02
5.2.40.0070.05010.85
5.2.30.0070.05310.76
5.2.20.0070.04710.92
5.2.10.0070.05310.76
5.2.00.0070.03710.77
5.1.60.0000.05010.02
5.1.50.0030.0309.99
5.1.40.0030.0509.98
5.1.30.0070.05010.34
5.1.20.0030.05710.28
5.1.10.0070.04010.05
5.1.00.0130.0479.91
5.0.50.0070.0438.59
5.0.40.0070.0378.29
5.0.30.0000.0708.21
5.0.20.0000.0338.20
5.0.10.0030.0338.21
5.0.00.0000.0508.21
4.4.90.0000.0377.51
4.4.80.0030.0377.51
4.4.70.0000.0277.51
4.4.60.0070.0277.51
4.4.50.0000.0377.51
4.4.40.0030.0507.51
4.4.30.0100.0307.51
4.4.20.0000.0377.51
4.4.10.0030.0337.51
4.4.00.0070.0507.51
4.3.110.0070.0337.51
4.3.100.0130.0207.51
4.3.90.0000.0407.51
4.3.80.0000.0537.51
4.3.70.0030.0237.51
4.3.60.0070.0337.51
4.3.50.0000.0377.51
4.3.40.0000.0507.51
4.3.30.0000.0237.51
4.3.20.0000.0377.51
4.3.10.0030.0277.51
4.3.00.0000.0307.51

preferences:
42.89 ms | 400 KiB | 5 Q