3v4l.org

run code in 300+ PHP versions simultaneously
<?php function plumberpro_id_safe( $string ) { // Strip accents $accents = '/&([A-Za-z]{1,2})(tilde|grave|acute|circ|cedil|uml|lig);/'; $string = preg_replace( $accents, '$1', htmlentities( utf8_decode( $string ) ) ); // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores. $string = strtolower( preg_replace( '/[^a-zA-Z0-9_-]+/', '-', $string ) ); // If the first character is not a-z, add 'n' in front. if ( !ctype_lower( $string{0} ) ) { // Don't use ctype_alpha since its locale aware. $string = 'id' . $string; } return $string; }

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.0060.01016.50
8.3.50.0040.01518.18
8.3.40.0130.00618.75
8.3.30.0040.01118.72
8.3.20.0000.00720.30
8.3.10.0040.00421.89
8.3.00.0000.01123.27
8.2.180.0040.01118.16
8.2.170.0070.01122.96
8.2.160.0100.00319.16
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00022.25
8.2.120.0000.00926.35
8.2.110.0030.00621.10
8.2.100.0120.00017.63
8.2.90.0000.00918.95
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0000.00817.91
8.2.50.0000.00818.10
8.2.40.0000.00820.60
8.2.30.0000.00718.99
8.2.20.0050.00218.04
8.2.10.0050.00217.83
8.2.00.0000.00817.98
8.1.280.0120.00325.92
8.1.270.0000.00822.09
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00919.02
8.1.230.0060.00619.48
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0060.00317.22
8.1.190.0080.00017.11
8.1.180.0040.00418.10
8.1.170.0030.00618.42
8.1.160.0050.00218.64
8.1.150.0050.00520.03
8.1.140.0000.00719.45
8.1.130.0070.00017.18
8.1.120.0000.00817.29
8.1.110.0070.00017.22
8.1.100.0000.00717.33
8.1.90.0030.00717.30
8.1.80.0000.00817.37
8.1.70.0030.00317.31
8.1.60.0000.00817.46
8.1.50.0040.00417.29
8.1.40.0060.00317.42
8.1.30.0040.00417.34
8.1.20.0060.00317.58
8.1.10.0040.00417.38
8.1.00.0060.00617.19
8.0.300.0040.00418.77
8.0.290.0030.00616.58
8.0.280.0000.00718.37
8.0.270.0070.00017.09
8.0.260.0000.00716.73
8.0.250.0000.00716.86
8.0.240.0050.00716.84
8.0.230.0030.00616.77
8.0.220.0000.00816.69
8.0.210.0070.00016.84
8.0.200.0000.00616.88
8.0.190.0030.00516.79
8.0.180.0040.00416.84
8.0.170.0070.00016.84
8.0.160.0000.00716.89
8.0.150.0000.00716.73
8.0.140.0040.00416.84
8.0.130.0030.00313.29
8.0.120.0060.00316.84
8.0.110.0030.00316.69
8.0.100.0040.00416.88
8.0.90.0000.00716.80
8.0.80.0080.01216.77
8.0.70.0030.00516.89
8.0.60.0030.00316.62
8.0.50.0040.00416.80
8.0.30.0080.00816.77
8.0.20.0120.00817.40
8.0.10.0000.00716.82
8.0.00.0070.01016.64
7.4.330.0060.00015.55
7.4.320.0060.00016.52
7.4.300.0030.00316.52
7.4.290.0050.00516.45
7.4.280.0000.00716.39
7.4.270.0040.00416.30
7.4.260.0030.00616.45
7.4.250.0070.00016.43
7.4.240.0070.00016.30
7.4.230.0030.00316.55
7.4.220.0140.01116.32
7.4.210.0090.00616.45
7.4.200.0040.00416.28
7.4.160.0080.00816.39
7.4.150.0110.00917.40
7.4.140.0150.01117.86
7.4.130.0100.00616.49
7.4.120.0110.01016.37
7.4.110.0040.01416.33
7.4.100.0130.00716.49
7.4.90.0080.00916.37
7.4.80.0090.00919.39
7.4.70.0210.00316.47
7.4.60.0030.01316.33
7.4.50.0060.00616.16
7.4.40.0170.00616.45
7.4.30.0080.00716.44
7.4.00.0100.00714.88
7.3.330.0000.00612.91
7.3.320.0050.00013.04
7.3.310.0030.00316.20
7.3.300.0030.00316.15
7.3.290.0050.01016.12
7.3.280.0090.01016.18
7.3.270.0030.01417.40
7.3.260.0060.01116.22
7.3.250.0120.00516.22
7.3.240.0150.00616.32
7.3.230.0160.00016.40
7.3.210.0130.00616.34
7.3.200.0100.01016.34
7.3.190.0150.00316.48
7.3.180.0060.01516.26
7.3.170.0100.01016.19
7.3.160.0130.00316.39
7.3.120.0070.01314.74
7.3.110.0060.01314.34
7.3.100.0140.00714.79
7.3.90.0080.00414.75
7.3.80.0070.01114.45
7.3.70.0110.00314.77
7.3.60.0090.00914.71
7.3.50.0050.00514.50
7.3.40.0000.01514.43
7.3.30.0030.00914.70
7.3.20.0090.00616.50
7.3.10.0100.00316.35
7.3.00.0050.00916.51
7.2.330.0130.01016.16
7.2.320.0190.00016.33
7.2.310.0130.00316.34
7.2.300.0080.01116.40
7.2.290.0160.00316.29
7.2.250.0000.01914.89
7.2.240.0040.01514.69
7.2.230.0100.00314.69
7.2.220.0100.00314.65
7.2.210.0000.01814.77
7.2.200.0080.00314.74
7.2.190.0070.00715.06
7.2.180.0100.00714.72
7.2.170.0060.00614.95
7.2.160.0120.00315.01
7.2.150.0030.01016.67
7.2.140.0040.01116.92
7.2.130.0090.00316.73
7.2.120.0050.01116.58
7.2.110.0110.00616.55
7.2.100.0060.00916.56
7.2.90.0100.00816.66
7.2.80.0100.00616.66
7.2.70.0080.00616.80
7.2.60.0100.00416.70
7.2.50.0060.00616.64
7.2.40.0000.01316.56
7.2.30.0040.01116.52
7.2.20.0070.00716.64
7.2.10.0090.00416.52
7.2.00.0070.00616.56
7.1.330.0110.00415.79
7.1.320.0040.00715.76
7.1.310.0060.00615.80
7.1.300.0030.00615.54
7.1.290.0060.00615.64
7.1.280.0000.00915.41
7.1.270.0090.00615.55
7.1.260.0060.01015.71
7.1.250.0030.01215.65
7.1.240.0080.00715.55
7.1.230.0060.00915.67
7.1.220.0090.00315.57
7.1.210.0070.00915.58
7.1.200.0060.00715.63
7.1.190.0040.00715.69
7.1.180.0030.01115.60
7.1.170.0120.00215.54
7.1.160.0030.01015.54
7.1.150.0050.00615.36
7.1.140.0080.00615.32
7.1.130.0070.00415.54
7.1.120.0070.00515.42
7.1.110.0030.01215.54
7.1.100.0120.00215.45
7.1.90.0060.00715.55
7.1.80.0020.00915.31
7.1.70.0050.00615.86
7.1.60.0060.01016.04
7.1.50.0040.00815.67
7.1.40.0070.00615.38
7.1.30.0970.02722.53
7.1.20.0690.02522.46
7.1.10.0950.02416.98
7.1.00.0080.02517.20
7.0.330.0080.01015.05
7.0.320.0120.00515.11
7.0.310.0110.00615.18
7.0.300.0080.00715.07
7.0.290.0070.00715.31
7.0.280.0070.00715.12
7.0.270.0020.01215.16
7.0.260.0070.00715.07
7.0.250.0070.00515.08
7.0.240.0030.00915.20
7.0.230.0030.01214.89
7.0.220.0100.00515.28
7.0.210.0090.00315.13
7.0.200.0020.00815.43
7.0.190.0030.01015.26
7.0.180.0060.00515.15
7.0.170.0720.02416.68
7.0.160.0650.02316.76
7.0.150.0850.01816.78
7.0.140.1310.02616.82
7.0.130.0090.02616.80
7.0.120.1090.03116.81
7.0.110.0950.02616.81
7.0.100.1240.02216.86
7.0.90.1190.02416.73
7.0.80.0100.03116.78
7.0.70.0070.02816.87
7.0.60.0100.02216.81
7.0.50.0690.02916.80
7.0.40.0080.02415.54
7.0.30.0050.02615.45
7.0.20.0840.02215.43
7.0.10.0080.02115.56
7.0.00.0150.01915.49
5.6.400.0060.00914.29
5.6.390.0070.00714.07
5.6.380.0030.01014.05
5.6.370.0130.00414.41
5.6.360.0060.00914.28
5.6.350.0100.00314.43
5.6.340.0040.01114.00
5.6.330.0040.01413.90
5.6.320.0000.01413.94
5.6.310.0040.00414.45
5.6.300.0070.00714.16
5.6.290.0000.01414.37
5.6.280.0000.01313.99
5.6.270.0030.01014.35
5.6.260.0000.00914.23
5.6.250.0030.01214.17
5.6.240.0060.00914.17
5.6.230.0080.00414.41
5.6.220.0070.00713.89
5.6.210.0030.00914.18
5.6.200.0060.00614.13
5.6.190.0150.00314.04
5.6.180.0030.01014.08
5.6.170.0070.01114.00
5.6.160.0090.00313.84
5.6.150.0030.00614.27
5.6.140.0040.00814.19
5.6.130.0030.01014.41
5.6.120.0130.00314.11
5.6.110.0030.01013.94
5.6.100.0030.00914.07
5.6.90.0070.00714.34
5.6.80.0030.00913.88
5.6.70.0030.00614.13
5.6.60.0060.00613.84
5.6.50.0000.01314.03
5.6.40.0040.00713.81
5.6.30.0080.00614.13
5.6.20.0060.00914.08
5.6.10.0040.00814.10
5.6.00.0000.01314.26

preferences:
57.85 ms | 400 KiB | 5 Q