3v4l.org

run code in 300+ PHP versions simultaneously
<?php function camelCase($str) { $i = array("-","_"); $str = preg_replace('/([a-z])([A-Z])/', "\\1 \\2", $str); $str = preg_replace('@[^a-zA-Z0-9\-_ ]+@', '', $str); $str = str_replace($i, ' ', $str); $str = str_replace(' ', '', ucwords(strtolower($str))); $str = strtolower(substr($str,0,1)).substr($str,1); return $str; } function uncamelCase($str) { $str = preg_replace('/([a-z])([A-Z])/', "\\1_\\2", $str); $str = strtolower($str); return $str; } $camel = camelCase("James_LIKES-camelCase"); $uncamel = uncamelCase($camel); echo $camel." ".$uncamel;

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.4.140.0140.00717.79
8.4.130.0110.00918.10
8.4.120.0120.00720.34
8.4.110.0100.01018.95
8.4.100.0110.01017.82
8.4.90.0140.00718.14
8.4.80.0110.01019.85
8.4.70.0050.00519.65
8.4.60.0130.00818.80
8.4.50.0110.00720.29
8.4.40.0120.00917.71
8.4.30.0070.01120.71
8.4.20.0030.00618.03
8.4.10.0090.00019.72
8.3.270.0120.00816.99
8.3.260.0130.00616.72
8.3.250.0130.00518.84
8.3.240.0100.00916.65
8.3.230.0110.00916.78
8.3.220.0060.00216.41
8.3.210.0090.01018.69
8.3.200.0110.00616.66
8.3.190.0110.00917.18
8.3.180.0120.00718.75
8.3.170.0030.01417.06
8.3.160.0110.00718.60
8.3.150.0160.00320.59
8.3.140.0060.01217.03
8.3.130.0080.00018.43
8.3.120.0150.00419.09
8.3.110.0090.00020.94
8.3.100.0130.00724.06
8.3.90.0060.00326.77
8.3.80.0060.00316.75
8.3.70.0160.00316.63
8.3.60.0100.00718.55
8.3.50.0070.01119.80
8.3.40.0130.00318.72
8.3.30.0120.00318.92
8.3.20.0030.00524.18
8.3.10.0050.00324.66
8.3.00.0080.00026.16
8.2.290.0130.00620.44
8.2.280.0040.00418.38
8.2.270.0030.00617.24
8.2.260.0090.00617.01
8.2.250.0040.00416.92
8.2.240.0150.00418.95
8.2.230.0040.00422.58
8.2.220.0060.00337.54
8.2.210.0040.01626.77
8.2.200.0030.00616.63
8.2.190.0040.01116.63
8.2.180.0120.00325.92
8.2.170.0070.00719.08
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.91
8.2.110.0070.00419.13
8.2.100.0080.00417.91
8.2.90.0050.00318.16
8.2.80.0040.00417.97
8.2.70.0080.00017.73
8.2.60.0030.00617.75
8.2.50.0000.00817.93
8.2.40.0040.00417.92
8.2.30.0040.00417.79
8.2.20.0000.00720.70
8.2.10.0000.00817.92
8.2.00.0000.00719.31
8.1.330.0110.00822.12
8.1.320.0150.00416.04
8.1.310.0080.00019.87
8.1.300.0080.00018.57
8.1.290.0090.00018.88
8.1.280.0120.00925.92
8.1.270.0000.00723.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00622.25
8.1.230.0040.00921.04
8.1.220.0000.00817.74
8.1.210.0030.00518.90
8.1.200.0060.00317.48
8.1.190.0050.00317.35
8.1.180.0060.00318.10
8.1.170.0030.00617.62
8.1.160.0000.00718.92
8.1.150.0000.00718.75
8.1.140.0070.00017.50
8.1.130.0070.00018.97
8.1.120.0030.00617.51
8.1.110.0040.00417.59
8.1.100.0000.00717.61
8.1.90.0040.00417.57
8.1.80.0000.00717.50
8.1.70.0000.00817.66
8.1.60.0060.00317.78
8.1.50.0040.00417.70
8.1.40.0000.00817.65
8.1.30.0030.00517.63
8.1.20.0000.00817.79
8.1.10.0000.00917.68
8.1.00.0070.00017.44
8.0.300.0000.00720.02
8.0.290.0050.00516.75
8.0.280.0000.00818.20
8.0.270.0040.00416.85
8.0.260.0070.00018.45
8.0.250.0000.00816.99
8.0.240.0000.00817.06
8.0.230.0000.00717.13
8.0.220.0000.00716.90
8.0.210.0000.00717.03
8.0.200.0040.00417.01
8.0.190.0030.00517.03
8.0.180.0090.00016.99
8.0.170.0040.00416.91
8.0.160.0030.00617.13
8.0.150.0040.00416.96
8.0.140.0040.00417.00
8.0.130.0140.00617.07
8.0.120.0180.00017.01
8.0.110.0120.00817.01
8.0.100.0140.00216.98
8.0.90.0000.01616.95
8.0.80.0070.00716.96
8.0.70.0120.00616.94
8.0.60.0120.00616.99
8.0.50.0060.01216.80
8.0.30.0120.00617.00
8.0.20.0080.00816.99
8.0.10.0160.00216.94
8.0.00.0080.00417.08
7.4.330.0030.00315.55
7.4.320.0000.00616.71
7.4.300.0000.00616.70
7.4.290.0070.00016.66
7.4.280.0000.00816.78
7.4.270.0040.00416.81
7.4.260.0030.00616.76
7.4.250.0180.00316.76
7.4.240.0200.00016.80
7.4.230.0050.00816.77
7.4.220.0100.00516.77
7.4.210.0110.00716.78
7.4.200.0090.00616.78
7.4.190.0080.00816.75
7.4.180.0130.00316.86
7.4.160.0110.00716.59
7.4.150.0100.00716.75
7.4.140.0120.00616.70
7.4.130.0190.00016.66
7.4.120.0150.00416.61
7.4.110.0190.00316.50
7.4.100.0160.00316.75
7.4.90.0160.00316.77
7.4.80.0180.00316.81
7.4.70.0180.00316.69
7.4.60.0160.00416.69
7.4.50.0110.00816.62
7.4.40.0110.00816.53
7.4.30.0060.00616.70
7.4.20.0130.00016.55
7.4.10.0150.00316.46
7.4.00.0140.00316.55
7.3.330.0130.00016.48
7.3.320.0200.00016.46
7.3.310.0090.00416.46
7.3.300.0110.00016.17
7.3.290.0110.00316.28
7.3.280.0100.00216.20
7.3.270.0070.00716.21
7.3.260.0110.00316.17
7.3.250.0160.00016.48
7.3.240.0090.00316.25
7.3.230.0130.00716.34
7.3.220.0100.01016.31
7.3.210.0110.00416.45
7.3.200.0070.00516.27
7.3.190.0070.00616.38
7.3.180.0180.00016.40
7.3.170.0180.00016.33
7.3.160.0120.00516.54
7.3.150.0140.00016.29
7.3.140.0140.00016.43
7.3.130.0150.00016.53

preferences:
30.89 ms | 403 KiB | 5 Q