3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-Type: text/html; charset=UTF-8'); $str = "<h1>He'llü & Wor&#39;ldÆØÅÅÅ!</h1>" . "\tcafé\n"; if ('UTF-8' !== mb_detect_encoding($str)) { $str = utf8_encode($str); } var_dump($str); $str = html_entity_decode($str, ENT_QUOTES | ENT_XML1, 'UTF-8'); var_dump($str); $str = filter_var(html_entity_decode($str, ENT_QUOTES | ENT_XML1, 'UTF-8'), FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_NO_ENCODE_QUOTES); var_dump($str); #$newstr = preg_replace('/\s[\s]+/', ' ', $str); // Strip off multiple spaces $newstr = preg_replace('/[^\000-\128]+/', '', $str); // Strip off non-alpha-numeric #$newstr = preg_replace('/[\s\W]+/', '-', $newstr); // Strip off spaces and non-alpha-numeric #$newstr = preg_replace('/[^A-Za-z0-9_-]+/', '', $newstr); var_dump($newstr);

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.0120.00319.00
8.3.30.0110.00418.79
8.3.20.0000.00821.91
8.3.10.0000.00723.65
8.3.00.0040.00422.10
8.2.170.0140.00322.96
8.2.160.0080.00622.20
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0050.00226.16
8.2.120.0080.00419.06
8.2.110.0060.00321.23
8.2.100.0040.00818.03
8.2.90.0060.00317.97
8.2.80.0000.00819.10
8.2.70.0050.00317.89
8.2.60.0040.00418.03
8.2.50.0060.00318.10
8.2.40.0000.00820.46
8.2.30.0040.00419.37
8.2.20.0050.00218.03
8.2.10.0040.00418.21
8.2.00.0040.00418.01
8.1.270.0080.00023.79
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0090.00022.08
8.1.230.0070.00320.97
8.1.220.0080.00017.74
8.1.210.0040.00418.81
8.1.200.0060.00317.47
8.1.190.0090.00017.38
8.1.180.0030.00618.10
8.1.170.0060.00319.09
8.1.160.0040.00418.94
8.1.150.0040.00421.95
8.1.140.0040.00419.61
8.1.130.0050.00318.95
8.1.120.0000.00717.61
8.1.110.0040.00417.70
8.1.100.0070.00017.64
8.1.90.0040.00417.66
8.1.80.0050.00217.66
8.1.70.0000.00817.71
8.1.60.0000.00817.75
8.1.50.0000.00817.71
8.1.40.0080.00017.64
8.1.30.0030.00617.79
8.1.20.0040.00417.90
8.1.10.0050.00317.64
8.1.00.0000.00917.65
8.0.300.0000.00720.04
8.0.290.0000.00816.88
8.0.280.0030.00318.51
8.0.270.0030.00317.20
8.0.260.0030.00317.20
8.0.250.0030.00317.16
8.0.240.0030.00317.07
8.0.230.0000.00717.11
8.0.220.0070.00017.03
8.0.210.0000.00716.95
8.0.200.0030.00617.11
8.0.190.0040.00417.05
8.0.180.0000.00817.09
8.0.170.0080.00017.06
8.0.160.0000.00817.09
8.0.150.0110.00016.96
8.0.140.0000.00716.99
8.0.130.0030.00313.42
8.0.120.0040.00416.91
8.0.110.0000.00717.10
8.0.100.0040.00416.91
8.0.90.0080.00017.07
8.0.80.0060.00917.01
8.0.70.0030.00516.97
8.0.60.0050.00216.94
8.0.50.0040.00416.98
8.0.30.0080.01217.07
8.0.20.0110.00717.42
8.0.10.0050.00217.10
8.0.00.0040.01417.05
7.4.330.0050.00015.55
7.4.320.0030.00316.84
7.4.300.0030.00316.67
7.4.290.0000.00716.89
7.4.280.0040.00316.78
7.4.270.0030.00316.85
7.4.260.0070.00016.83
7.4.250.0040.00416.75
7.4.240.0000.00716.90
7.4.230.0040.00416.91
7.4.220.0140.01016.90
7.4.210.0100.00516.85
7.4.200.0040.00416.97
7.4.160.0170.00016.83
7.4.150.0120.00817.40
7.4.140.0100.01117.86
7.4.130.0120.00516.60
7.4.120.0090.01016.67
7.4.110.0110.00716.71
7.4.100.0180.00516.64
7.4.90.0070.01016.79
7.4.80.0060.01019.39
7.4.70.0070.01016.54
7.4.60.0100.00716.93
7.4.50.0060.00916.54
7.4.40.0140.00316.71
7.4.30.0030.01316.68
7.4.10.0100.01016.64
7.4.00.0120.00515.94
7.3.330.0000.00713.16
7.3.320.0000.00513.36
7.3.310.0080.00016.41
7.3.300.0050.00216.32
7.3.290.0100.00716.44
7.3.280.0120.01016.39
7.3.270.0070.01017.40
7.3.260.0120.00916.54
7.3.250.0070.01016.70
7.3.240.0090.01316.55
7.3.230.0060.01216.38
7.3.210.0090.00916.30
7.3.200.0100.00716.68
7.3.190.0060.00916.61
7.3.180.0060.01016.25
7.3.170.0040.01416.60
7.3.160.0080.00816.30
7.3.130.0090.00516.36
7.3.120.0070.01116.32
7.3.110.0070.00716.35
7.3.100.0070.01016.48
7.3.90.0100.00716.30
7.3.80.0040.01216.55
7.3.70.0040.01116.40
7.3.60.0070.01116.33
7.3.50.0030.00716.35
7.3.40.0040.00716.41
7.3.30.0100.01016.41
7.3.20.0040.01318.12
7.3.10.0130.00018.41
7.3.00.0040.01118.18
7.2.330.0110.00616.80
7.2.320.0090.01216.74
7.2.310.0030.01516.70
7.2.300.0100.01016.62
7.2.290.0140.00916.76
7.2.260.0070.01316.72
7.2.250.0100.01016.69
7.2.240.0060.01316.59
7.2.230.0070.01016.68
7.2.220.0040.01116.79
7.2.210.0130.00316.81
7.2.200.0040.00816.53
7.2.190.0000.01216.62
7.2.180.0000.01116.49
7.2.170.0130.00616.71
7.2.160.0020.01116.49
7.2.150.0000.01818.45
7.2.140.0090.00018.60
7.2.130.0100.00718.49
7.2.120.0040.01118.50
7.2.110.0060.00918.41
7.2.100.0040.00718.34
7.2.90.0070.01118.50
7.2.80.0080.00418.51
7.2.70.0110.00318.36
7.2.60.0120.00617.74
7.2.50.0110.00717.67
7.2.40.0060.01218.44
7.2.30.0100.00318.58
7.2.20.0060.01218.45
7.2.10.0070.01018.49
7.2.00.0100.00718.44
7.1.330.0030.01417.59
7.1.320.0060.00917.43
7.1.310.0070.00717.45
7.1.300.0120.00317.53
7.1.290.0070.00717.43
7.1.280.0090.00917.60
7.1.270.0070.01117.48
7.1.260.0040.00817.12
7.1.250.0090.00417.63
7.1.240.0040.01217.24
7.1.230.0060.00617.51
7.1.220.0110.00417.31
7.1.210.0080.00517.31
7.1.200.0070.00716.76
7.1.190.0100.00317.42
7.1.180.0060.00317.57
7.1.170.0030.00617.47
7.1.160.0060.00617.38
7.1.150.0030.01017.54
7.1.140.0070.00717.53
7.1.130.0110.00317.48
7.1.120.0090.00617.43
7.1.110.0030.00917.38
7.1.100.0060.01117.51
7.1.90.0060.00917.43
7.1.80.0030.00717.30
7.1.70.0050.01117.38
7.1.60.0060.00817.35
7.1.50.0100.00317.42
7.1.40.0070.00717.50
7.1.30.0040.01117.48
7.1.20.0040.01117.36
7.1.10.0130.03119.81
7.1.00.0130.03019.82
7.0.330.0060.00616.95
7.0.320.0000.01117.16
7.0.310.0030.01017.17
7.0.300.0100.00717.11
7.0.290.0030.00717.23
7.0.280.0060.00617.23
7.0.270.0030.00917.23
7.0.260.0080.00817.34
7.0.250.0030.00617.01
7.0.240.0080.00817.05
7.0.230.0110.00316.99
7.0.220.0100.00317.24
7.0.210.0040.01217.17
7.0.200.0030.01317.02
7.0.190.0070.00717.09
7.0.180.0090.00317.18
7.0.170.0100.00316.97
7.0.160.0110.00417.26
7.0.150.0090.03219.54
7.0.140.0080.03319.43
7.0.130.0120.03519.59
7.0.120.0130.02919.47
7.0.110.0030.03919.49
7.0.100.0100.03019.51
7.0.90.0000.04219.48
7.0.80.0050.03719.50
7.0.70.0090.03219.53
7.0.60.0050.03519.51
7.0.50.0150.02419.46
7.0.40.0070.03418.46
7.0.30.0050.03518.52
7.0.20.0080.03318.56
7.0.10.0100.03018.39
7.0.00.0100.02818.44
5.6.400.0040.01116.10
5.6.390.0100.00716.05
5.6.380.0060.00616.00
5.6.370.0130.00316.01
5.6.360.0090.00616.11
5.6.350.0000.01216.16
5.6.340.0070.00715.73
5.6.330.0100.00316.05
5.6.320.0060.00615.94
5.6.310.0040.01115.80
5.6.300.0120.00316.22
5.6.290.0040.00715.73
5.6.280.0130.00315.85
5.6.270.0060.01016.06
5.6.260.0030.01315.86
5.6.250.0030.01016.19
5.6.240.0040.01115.82
5.6.230.0000.00916.24
5.6.220.0040.01215.78
5.6.210.0040.01116.11
5.6.200.0080.00815.78
5.6.190.0090.00615.95
5.6.180.0110.00415.87
5.6.170.0070.00315.85
5.6.160.0000.01115.87
5.6.150.0030.00915.96
5.6.140.0030.01015.91
5.6.130.0030.00916.27
5.6.120.0060.00615.79
5.6.110.0060.00615.77
5.6.100.0030.00615.83
5.6.90.0040.00715.88
5.6.80.0070.00716.03
5.6.70.0070.00415.94
5.6.60.0080.00615.97
5.6.50.0060.00915.75
5.6.40.0090.00316.01
5.6.30.0030.00615.74
5.6.20.0090.00315.73
5.6.10.0060.00615.85
5.6.00.0090.00315.83

preferences:
60.47 ms | 400 KiB | 5 Q