3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clean($string) { $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. $string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. return strtolower(preg_replace('/-+/', '-', $string)); // Replaces multiple hyphens with single one. } echo clean("title---of-the-page");

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.70.0140.00416.75
8.3.60.0130.01016.88
8.3.50.0110.01118.33
8.3.40.0090.00919.11
8.3.30.0150.00318.83
8.3.20.0090.00020.20
8.3.10.0060.00320.26
8.3.00.0080.00023.51
8.2.190.0060.01016.63
8.2.180.0070.01416.63
8.2.170.0110.00422.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0110.00324.66
8.2.130.0040.00420.35
8.2.120.0110.00726.35
8.2.110.0000.01019.18
8.2.100.0080.00417.91
8.2.90.0080.00019.19
8.2.80.0050.00317.97
8.2.70.0040.00417.75
8.2.60.0040.00417.93
8.2.50.0090.00018.22
8.2.40.0030.00522.51
8.2.30.0020.00519.15
8.2.20.0000.00818.20
8.2.10.0060.00317.99
8.2.00.0030.00617.90
8.1.280.0070.01425.92
8.1.270.0090.00020.43
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0070.00424.04
8.1.230.0040.00820.39
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0040.00417.13
8.1.180.0040.00418.10
8.1.170.0050.00318.73
8.1.160.0040.00418.90
8.1.150.0000.00719.98
8.1.140.0040.00417.59
8.1.130.0000.00719.01
8.1.120.0020.00517.59
8.1.110.0060.00317.53
8.1.100.0000.00717.57
8.1.90.0060.00317.58
8.1.80.0000.00717.44
8.1.70.0080.00017.56
8.1.60.0040.00417.75
8.1.50.0000.00817.65
8.1.40.0040.00417.52
8.1.30.0080.00017.68
8.1.20.0080.00017.77
8.1.10.0040.00417.60
8.1.00.0080.00317.50
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0100.00018.37
8.0.270.0000.00717.29
8.0.260.0000.00718.59
8.0.250.0060.00017.10
8.0.240.0000.00817.11
8.0.230.0080.00016.93
8.0.220.0000.00716.98
8.0.210.0000.00816.87
8.0.200.0040.00416.93
8.0.190.0050.00617.08
8.0.180.0000.00717.02
8.0.170.0050.00216.93
8.0.160.0000.00716.98
8.0.150.0100.00016.94
8.0.140.0040.00416.96
8.0.130.0000.00513.38
8.0.120.0040.00417.03
8.0.110.0070.00016.82
8.0.100.0000.00816.93
8.0.90.0000.00716.96
8.0.80.0070.01417.01
8.0.70.0040.00416.91
8.0.60.0020.00516.87
8.0.50.0040.00416.97
8.0.30.0120.00917.20
8.0.20.0110.00717.44
8.0.10.0000.00716.91
8.0.00.0070.01117.02
7.4.330.0020.00215.55
7.4.320.0080.00016.70
7.4.300.0060.00016.73
7.4.290.0000.00716.57
7.4.280.0070.00016.68
7.4.270.0000.00716.79
7.4.260.0040.00416.81
7.4.250.0000.00716.79
7.4.240.0030.00316.83
7.4.230.0030.00516.70
7.4.220.0060.01216.74
7.4.210.0030.01116.72
7.4.200.0000.00816.82
7.4.160.0070.01016.65
7.4.150.0140.00317.40
7.4.140.0110.00817.86
7.4.130.0150.00616.61
7.4.120.0100.01016.64
7.4.110.0070.01016.88
7.4.100.0130.00316.68
7.4.90.0070.01116.84
7.4.80.0140.00319.39
7.4.70.0080.00816.50
7.4.60.0090.00916.69
7.4.50.0080.00316.73
7.4.40.0030.01716.79
7.4.30.0100.00716.67
7.4.00.0050.01015.03
7.3.330.0030.00313.38
7.3.320.0000.00513.39
7.3.310.0000.00716.41
7.3.300.0030.00316.38
7.3.290.0000.00716.27
7.3.280.0090.00816.35
7.3.270.0180.00617.40
7.3.260.0110.01016.53
7.3.250.0080.01016.58
7.3.240.0080.01116.44
7.3.230.0120.00616.50
7.3.210.0100.00716.79
7.3.200.0080.00816.38
7.3.190.0100.00616.27
7.3.180.0170.00716.71
7.3.170.0060.01516.46
7.3.160.0150.00316.63
7.3.120.0080.01114.77
7.3.110.0070.01115.09
7.3.100.0060.00915.12
7.3.90.0100.00714.91
7.3.80.0100.00615.07
7.3.70.0080.00415.02
7.3.60.0030.00914.90
7.3.50.0000.00915.05
7.3.40.0000.01114.76
7.3.30.0060.00614.88
7.3.20.0060.00616.88
7.3.10.0020.01216.79
7.3.00.0080.00716.77
7.2.330.0000.01716.79
7.2.320.0120.00916.81
7.2.310.0170.00016.77
7.2.300.0070.01416.79
7.2.290.0040.01216.82
7.2.250.0100.01014.99
7.2.240.0100.01015.13
7.2.230.0060.00914.79
7.2.220.0060.01015.07
7.2.210.0090.00315.08
7.2.200.0080.00815.20
7.2.190.0030.00915.25
7.2.180.0030.01315.21
7.2.170.0070.01015.04
7.2.130.0130.00317.04
7.2.120.0070.00317.20
7.2.110.0060.00616.99
7.2.100.0080.00817.09
7.2.90.0120.00017.18
7.2.80.0070.00317.11
7.2.70.0030.01017.26
7.2.60.0100.00517.21
7.2.50.0030.00717.04
7.2.40.0040.00717.00
7.2.30.0050.00517.10
7.2.20.0060.00316.86
7.2.10.0090.00316.96
7.2.00.0030.00717.04
7.1.330.0030.01315.85
7.1.320.0030.00615.91
7.1.310.0000.01415.89
7.1.300.0030.00716.04
7.1.290.0110.00315.61
7.1.280.0080.00815.95
7.1.270.0000.01315.84
7.1.260.0110.00315.73
7.1.250.0050.00515.91
7.1.200.0030.01115.69
7.1.100.3270.00316.46
7.1.90.5070.01216.51
7.1.80.0130.01316.38
7.1.70.2790.01315.61
7.1.60.0320.01633.63
7.1.50.0350.01332.89
7.1.40.0350.01032.85
7.1.30.0240.01232.93
7.1.20.0290.01432.94
7.1.10.0120.00914.98
7.1.00.0550.01015.01
7.0.240.3640.00716.01
7.0.230.0100.01116.20
7.0.220.0160.01316.10
7.0.210.0090.01214.67
7.0.200.0250.00714.88
7.0.190.0490.01014.91
7.0.180.0120.01214.44
7.0.170.0120.01614.63
7.0.160.0140.00914.29
7.0.150.0490.01014.64
7.0.140.0110.00714.59
7.0.130.0090.00914.74
7.0.120.2680.00014.78
7.0.110.2120.00314.78
7.0.100.2460.01614.79
7.0.90.0140.00414.63
7.0.80.0110.00714.64
7.0.70.0090.00914.42
7.0.60.2980.01014.42
7.0.50.0060.00914.67
7.0.40.0080.00814.90
7.0.30.0030.01314.73
7.0.20.0130.01014.82
7.0.10.0140.00314.70
7.0.00.0120.01214.70

preferences:
53.11 ms | 401 KiB | 5 Q