3v4l.org

run code in 300+ PHP versions simultaneously
<?php function init_vera_htmlspecialchars() { if (version_compare(PHP_VERSION, '5.4.0') >= 0) { function vera_htmlspecialchars($string, $flags = ENT_COMPAT , $encoding = 'ISO-8869-2', $doubleEncode = true) { return htmlspecialchars($string, $flags, $encoding, $doubleEncode); } } elseif (version_compare(PHP_VERSION, '5.2.3') >= 0) { function vera_htmlspecialchars($string, $flags = ENT_COMPAT, $encoding = 'ISO-8869-2', $doubleEncode = true) { return htmlspecialchars($string, $flags, $encoding, $doubleEncode); } } else { function vera_htmlspecialchars($string, $flags = ENT_COMPAT, $encoding = 'ISO-8869-2', $doubleEncode = true) { return htmlspecialchars($string, $flags, $encoding); } } }; init_vera_htmlspecialchars(); for ($i=0; $i<100000; $i++) { $str = htmlspecialchars('asdf&<>;\'"',ENT_QUOTES,'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.0070.01818.76
8.3.30.0130.01320.22
8.3.20.0070.00720.29
8.3.10.0030.01022.05
8.3.00.0030.01122.44
8.2.170.0070.01822.96
8.2.160.0060.01922.25
8.2.150.0030.01024.18
8.2.140.0110.00424.66
8.2.130.0040.01126.16
8.2.120.0070.00720.80
8.2.110.0030.01721.03
8.2.100.0060.01617.91
8.2.90.0000.01919.21
8.2.80.0060.01217.97
8.2.70.0000.01917.50
8.2.60.0000.01917.93
8.2.50.0030.01518.10
8.2.40.0000.01820.63
8.2.30.0040.01419.21
8.2.20.0030.01517.55
8.2.10.0000.01917.78
8.2.00.0040.01517.82
8.1.270.0030.01323.99
8.1.260.0040.01226.35
8.1.250.0030.01028.09
8.1.240.0040.01421.01
8.1.230.0070.01520.36
8.1.220.0030.01617.79
8.1.210.0000.01918.77
8.1.200.0030.02017.23
8.1.190.0060.01317.21
8.1.180.0030.01618.10
8.1.170.0070.01118.54
8.1.160.0030.01618.91
8.1.150.0030.01320.28
8.1.140.0030.01617.38
8.1.130.0060.01217.76
8.1.120.0030.01517.54
8.1.110.0030.01617.48
8.1.100.0060.01217.36
8.1.90.0030.01617.50
8.1.80.0000.01817.51
8.1.70.0000.01717.37
8.1.60.0000.01917.61
8.1.50.0060.01217.49
8.1.40.0070.01417.56
8.1.30.0030.01617.63
8.1.20.0070.01317.71
8.1.10.0000.01817.46
8.1.00.0060.01317.26
8.0.300.0030.01518.77
8.0.290.0070.01616.63
8.0.280.0030.01518.46
8.0.270.0000.01817.27
8.0.260.0000.01816.88
8.0.250.0030.01516.98
8.0.240.0100.01916.96
8.0.230.0030.01616.93
8.0.220.0030.01516.78
8.0.210.0030.01516.79
8.0.200.0080.01116.95
8.0.190.0060.01316.98
8.0.180.0080.01116.95
8.0.170.0060.01316.93
8.0.160.0040.01517.03
8.0.150.0030.01516.81
8.0.140.0030.01916.78
8.0.130.0000.01613.23
8.0.120.0030.01616.84
8.0.110.0040.01516.88
8.0.100.0030.01516.97
8.0.90.0030.01416.80
8.0.80.0070.03716.85
8.0.70.0030.01716.80
8.0.60.0000.01916.93
8.0.50.0060.01216.79
8.0.30.0180.02517.06
8.0.20.0120.02317.40
8.0.10.0000.01916.99
8.0.00.0090.02916.66
7.4.330.0030.01316.77
7.4.320.0000.01916.41
7.4.300.0060.01216.57
7.4.290.0030.01716.59
7.4.280.0100.01016.60
7.4.270.0000.01916.59
7.4.260.0000.01813.29
7.4.250.0030.01616.58
7.4.240.0030.01716.58
7.4.230.0000.01916.64
7.4.220.0100.02916.57
7.4.210.0070.02716.59
7.4.200.0060.01216.70
7.4.190.0030.01616.56
7.4.160.0200.03016.48
7.4.150.0060.02917.40
7.4.140.0080.03017.86
7.4.130.0060.03216.63
7.4.120.0130.02216.62
7.4.110.0070.02616.39
7.4.100.0110.04116.67
7.4.90.0070.02716.59
7.4.80.0130.03619.39
7.4.70.0100.02316.55
7.4.60.0090.02816.52
7.4.50.0000.02516.25
7.4.40.0070.02422.77
7.4.30.0040.02916.66
7.4.10.0060.03515.16
7.4.00.0070.03314.74
7.3.330.0000.01713.23
7.3.320.0000.01913.18
7.3.310.0030.01616.27
7.3.300.0000.01916.20
7.3.290.0070.04016.30
7.3.280.0030.03416.31
7.3.270.0150.01917.40
7.3.260.0160.03918.24
7.3.250.0100.02516.50
7.3.240.0150.01916.62
7.3.230.0000.03516.46
7.3.210.0090.02416.43
7.3.200.0100.03819.39
7.3.190.0030.03516.59
7.3.180.0130.02016.32
7.3.170.0040.02816.52
7.3.160.0100.03216.38
7.3.130.0100.02714.87
7.3.120.0080.02414.91
7.3.110.0060.02614.79
7.3.100.0030.04014.93
7.3.90.0070.04014.96
7.3.80.0030.02714.72
7.3.70.0060.02214.62
7.3.60.0070.02414.85
7.3.50.0030.02414.97
7.3.40.0000.02814.94
7.3.30.0130.03314.76
7.3.20.0070.02716.74
7.3.10.0100.03716.74
7.3.00.0000.02916.40
7.2.330.0000.03616.63
7.2.320.0060.02916.36
7.2.310.0100.02716.80
7.2.300.0090.02416.52
7.2.290.0130.02316.63
7.2.260.0030.04315.19
7.2.250.0030.04415.26
7.2.240.0040.02615.07
7.2.230.0070.04015.26
7.2.220.0090.02515.06
7.2.210.0000.03215.12
7.2.200.0000.03214.92
7.2.190.0090.03114.84
7.2.180.0030.03315.03
7.2.170.0060.03214.74
7.2.160.0060.02815.02
7.2.150.0100.02316.84
7.2.140.0090.01816.91
7.2.130.0100.02316.72
7.2.120.0030.02516.95
7.2.110.0090.02916.94
7.2.100.0030.03016.69
7.2.90.0110.02116.90
7.2.80.0090.03616.88
7.2.70.0000.02616.94
7.2.60.0100.02116.82
7.2.50.0070.02417.01
7.2.40.0060.02416.74
7.2.30.0100.02017.07
7.2.20.0030.02417.06
7.2.10.0060.02116.59
7.2.00.0040.02317.96
7.1.330.0100.02615.92
7.1.320.0100.03815.88
7.1.310.0000.03915.48
7.1.300.0030.03415.76
7.1.290.0070.02815.88
7.1.280.0100.03215.70
7.1.270.0060.02915.54
7.1.260.0000.03815.55
7.1.250.0070.03715.90
7.1.240.0040.03215.54
7.1.230.0060.02915.81
7.1.220.0070.02815.75
7.1.210.0000.03615.70
7.1.200.0030.03815.75
7.1.190.0070.03115.72
7.1.180.0000.02915.71
7.1.170.0070.03015.74
7.1.160.0030.03015.82
7.1.150.0070.02315.86
7.1.140.0070.02315.81
7.1.130.0070.02715.47
7.1.120.0070.03115.83
7.1.110.0030.03415.72
7.1.100.0030.02816.80
7.1.90.0040.02515.94
7.1.80.0040.03115.66
7.1.70.0030.02516.33
7.1.60.0050.02717.46
7.1.50.0080.02316.14
7.1.40.0000.03515.76
7.1.30.0100.03015.70
7.1.20.0070.02915.77
7.1.10.0100.02915.84
7.1.00.0050.05619.18
7.0.330.0070.03815.38
7.0.320.0070.02715.45
7.0.310.0070.04115.47
7.0.300.0070.03315.40
7.0.290.0070.02615.40
7.0.280.0100.02915.37
7.0.270.0120.02515.14
7.0.260.0060.02915.39
7.0.250.0030.03015.28
7.0.240.0060.02915.40
7.0.230.0100.03115.37
7.0.220.0000.02915.27
7.0.210.0030.03315.23
7.0.200.0060.02015.99
7.0.190.0030.03315.30
7.0.180.0030.03415.09
7.0.170.0030.03415.18
7.0.160.0030.03015.48
7.0.150.0100.02915.20
7.0.140.0080.05818.79
7.0.130.0030.03515.32
7.0.120.0060.04515.52
7.0.110.0060.03115.30
7.0.100.0210.05817.59
7.0.90.0050.06317.73
7.0.80.0050.06217.75
7.0.70.0030.06517.48
7.0.60.0070.06117.74
7.0.50.0160.06117.90
7.0.40.0080.04316.80
7.0.30.0100.05316.82
7.0.20.0060.05616.65
7.0.10.0080.06416.77
7.0.00.0020.06516.61
5.6.400.0070.07314.31
5.6.390.0000.06214.21
5.6.380.0060.05814.16
5.6.370.0000.06114.20
5.6.360.0030.06014.03
5.6.350.0030.05814.06
5.6.340.0000.06214.14
5.6.330.0030.05914.00
5.6.320.0030.05814.40
5.6.310.0030.06914.40
5.6.300.0030.06114.07
5.6.290.0030.05914.68
5.6.280.0050.09917.70
5.6.270.0030.07314.18
5.6.260.0060.06514.46
5.6.250.0060.08317.61
5.6.240.0020.09717.47
5.6.230.0070.08117.41
5.6.220.0080.07117.45
5.6.210.0030.08517.56
5.6.200.0050.07717.75
5.6.190.0050.09417.74
5.6.180.0080.09117.72
5.6.170.0150.08617.74
5.6.160.0120.09017.57
5.6.150.0080.08617.70
5.6.140.0070.09017.54
5.6.130.0080.09317.64
5.6.120.0100.07117.55
5.6.110.0120.09117.52
5.6.100.0050.08817.82
5.6.90.0070.09417.66
5.6.80.0000.09617.31
5.6.70.0100.09317.28
5.6.60.0070.09217.43
5.6.50.0070.08817.27
5.6.40.0030.10217.28
5.6.30.0080.09117.35
5.6.20.0030.09117.26
5.6.10.0070.07517.16
5.6.00.0030.08817.28
5.5.380.0050.07117.32
5.5.370.0070.09217.42
5.5.360.0070.07617.32
5.5.350.0100.07517.39
5.5.340.0050.08017.47
5.5.330.0030.09417.48
5.5.320.0020.09217.52
5.5.310.0030.07917.52
5.5.300.0070.07917.38
5.5.290.0100.08317.45
5.5.280.0070.11317.62
5.5.270.0100.06717.56
5.5.260.0080.06817.43
5.5.250.0070.09717.42
5.5.240.0030.07617.15
5.5.230.0030.09517.19
5.5.220.0050.09417.13
5.5.210.0080.08417.23
5.5.200.0080.07117.18
5.5.190.0070.09617.06
5.5.180.0000.07517.13
5.5.170.0070.06314.10
5.5.160.0080.08217.26
5.5.150.0120.08717.16
5.5.140.0030.08417.23
5.5.130.0030.07817.25
5.5.120.0080.08217.18
5.5.110.0050.09317.13
5.5.100.0070.07417.22
5.5.90.0030.07717.23
5.5.80.0050.08717.03
5.5.70.0050.08417.21
5.5.60.0020.09717.14
5.5.50.0020.08417.06
5.5.40.0050.08716.99
5.5.30.0100.08517.08
5.5.20.0080.08317.09
5.5.10.0070.07416.97
5.5.00.0020.08017.19
5.4.450.0070.09615.14
5.4.440.0070.09315.11
5.4.430.0070.08515.27
5.4.420.0120.07815.13
5.4.410.0050.09315.34
5.4.400.0000.09515.02
5.4.390.0030.08915.07
5.4.380.0070.10015.17
5.4.370.0120.06415.09
5.4.360.0070.08814.74
5.4.350.0070.08614.91
5.4.340.0100.08314.89
5.4.330.0000.06511.16
5.4.320.0030.08014.91
5.4.310.0050.09614.99
5.4.300.0020.08515.04
5.4.290.0080.08315.00
5.4.280.0000.09214.99
5.4.270.0030.06715.00
5.4.260.0050.09015.14
5.4.250.0070.08614.94
5.4.240.0070.08115.02
5.4.230.0030.09015.02
5.4.220.0080.09514.98
5.4.210.0020.08615.04
5.4.200.0020.07115.09
5.4.190.0070.09015.03
5.4.180.0080.07515.08
5.4.170.0050.09715.08
5.4.160.0070.09314.77
5.4.150.0070.07214.89
5.4.140.0100.08613.71
5.4.130.0030.07313.77
5.4.120.0030.08413.58
5.4.110.0070.08913.80
5.4.100.0100.05213.69
5.4.90.0020.06213.60
5.4.80.0080.05513.82
5.4.70.0030.06313.60
5.4.60.0050.06113.58
5.4.50.0050.08113.56
5.4.40.0030.06713.72
5.4.30.0030.06513.62
5.4.20.0020.06413.67
5.4.10.0080.06413.66
5.4.00.0020.07313.28
5.3.290.0070.08812.61
5.3.280.0100.08912.63
5.3.270.0070.09312.47
5.3.260.0100.11412.63
5.3.250.0030.11312.47
5.3.240.0050.10612.61
5.3.230.0000.08312.47
5.3.220.0080.09212.48
5.3.210.0030.08312.42
5.3.200.0000.08712.50
5.3.190.0020.07912.62
5.3.180.0020.07812.56
5.3.170.0050.07912.63
5.3.160.0030.07612.62
5.3.150.0100.06712.67
5.3.140.0030.07312.67
5.3.130.0020.08612.61
5.3.120.0030.07512.42
5.3.110.0050.07312.55
5.3.100.0030.07112.40
5.3.90.0070.07612.42
5.3.80.0030.07412.29
5.3.70.0020.07612.14
5.3.60.0020.07312.28
5.3.50.0070.07312.28
5.3.40.0050.08012.15
5.3.30.0000.08312.26
5.3.20.0030.07012.12
5.3.10.0020.07311.88
5.3.00.0030.07411.97
5.2.170.0000.07711.59
5.2.160.0000.07711.59
5.2.150.0070.07311.59
5.2.140.0000.07711.59
5.2.130.0030.08011.59
5.2.120.0030.07011.59
5.2.110.0030.07011.59
5.2.100.0230.06011.59
5.2.90.0000.08711.59
5.2.80.0000.07711.59
5.2.70.0070.07011.59
5.2.60.0000.07311.59
5.2.50.0030.07311.59
5.2.40.0030.08011.59
5.2.30.0000.08011.59
5.2.20.0000.07711.59
5.2.10.0070.07311.59
5.2.00.0000.07711.59
5.1.60.0030.08011.59
5.1.50.0100.12711.59
5.1.40.0000.13711.59
5.1.30.0030.14011.59
5.1.20.0130.12011.59
5.1.10.0070.12711.59
5.1.00.0070.12011.59
5.0.50.0030.13311.59
5.0.40.0000.13011.59
5.0.30.0030.08711.59
5.0.20.0070.07711.59
5.0.10.0130.13711.59
5.0.00.0000.14711.59
4.4.90.0000.08311.59
4.4.80.0030.07711.59
4.4.70.0100.07011.59
4.4.60.0070.09011.59
4.4.50.0000.08011.59
4.4.40.0000.09011.59
4.4.30.0000.12711.59
4.4.20.0000.14311.59
4.4.10.0000.13311.59
4.4.00.0030.11311.59
4.3.110.0000.12711.59
4.3.100.0000.12011.59
4.3.90.0000.08011.59
4.3.80.0030.13311.59
4.3.70.0030.13711.59
4.3.60.0000.12711.59
4.3.50.0100.14311.59
4.3.40.0000.10711.59
4.3.30.0100.11711.59
4.3.20.0030.13011.59
4.3.10.0000.03711.59
4.3.00.0000.03711.59

preferences:
63.96 ms | 400 KiB | 5 Q