3v4l.org

run code in 300+ PHP versions simultaneously
<?php function camelize($id) { return preg_replace(array('/(^|_|-)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $id); } function camelize2($id) { return preg_replace_callback_array([ '/(^|_|-)+(.)/e' => function ($match) { return strtoupper($match[2]); }, '/\.(.)/e' => function ($match) { return '_' . strtoupper($match[1]); } ], $id); } $text = "_salut_les-amis!!"; var_dump(camelize($text), camelize2($text));

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.0140.00718.47
8.3.30.0100.00318.67
8.3.20.0040.00418.77
8.3.10.0080.00021.66
8.3.00.0070.00019.18
8.2.170.0070.00722.96
8.2.160.0100.00319.29
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0040.00421.18
8.2.120.0040.00426.35
8.2.110.0180.00320.31
8.2.100.0090.00318.03
8.2.90.0080.00019.21
8.2.80.0060.00317.97
8.2.70.0000.00817.50
8.2.60.0030.00617.80
8.2.50.0040.00418.10
8.2.40.0040.00422.33
8.2.30.0040.00420.51
8.2.20.0040.00417.67
8.2.10.0040.00417.93
8.2.00.0040.00418.18
8.1.270.0070.00023.97
8.1.260.0100.00028.09
8.1.250.0040.00428.09
8.1.240.0080.00323.86
8.1.230.0030.00921.02
8.1.220.0000.00717.74
8.1.210.0030.00618.77
8.1.200.0060.00317.25
8.1.190.0040.00417.11
8.1.180.0050.00318.10
8.1.170.0000.00818.31
8.1.160.0000.00818.89
8.1.150.0040.00418.75
8.1.140.0040.00419.58
8.1.130.0030.00317.66
8.1.120.0040.00417.48
8.1.110.0000.00817.53
8.1.100.0070.00317.51
8.1.90.0050.00317.36
8.1.80.0070.00017.30
8.1.70.0000.00817.42
8.1.60.0000.00717.64
8.1.50.0000.00817.41
8.1.40.0040.00417.49
8.1.30.0000.00817.67
8.1.20.0040.00417.66
8.1.10.0000.00717.33
8.1.00.0000.00817.46
8.0.300.0080.00018.77
8.0.290.0070.00016.63
8.0.280.0030.00318.32
8.0.270.0000.00717.29
8.0.260.0030.00317.06
8.0.250.0030.00316.98
8.0.240.0000.00716.81
8.0.230.0050.00216.88
8.0.220.0040.00416.91
8.0.210.0030.00316.95
8.0.200.0060.00017.03
8.0.190.0040.00416.98
8.0.180.0040.00416.91
8.0.170.0050.00316.94
8.0.160.0000.00816.93
8.0.150.0000.00816.88
8.0.140.0090.00316.89
8.0.130.0030.00313.41
8.0.120.0030.00616.91
8.0.110.0050.00216.98
8.0.100.0000.00716.78
8.0.90.0000.00716.84
8.0.80.0030.01316.91
8.0.70.0000.00716.91
8.0.60.0000.00717.05
8.0.50.0000.00816.87
8.0.30.0070.01017.11
8.0.20.0090.01217.40
8.0.10.0020.00517.06
8.0.00.0090.01116.74
7.4.330.0020.00215.08
7.4.320.0060.00016.48
7.4.300.0030.00316.57
7.4.290.0000.00716.58
7.4.280.0040.00416.51
7.4.270.0030.00316.48
7.4.260.0030.00316.45
7.4.250.0070.00016.45
7.4.240.0030.00316.50
7.4.230.0030.00316.38
7.4.220.0100.01016.50
7.4.210.0070.01316.48
7.4.200.0000.00716.50
7.4.160.0110.00416.50
7.4.150.0200.00417.40
7.4.140.0150.00317.86
7.4.130.0090.00916.58
7.4.120.0090.01016.40
7.4.110.0040.01316.46
7.4.100.0130.00316.37
7.4.90.0070.01016.54
7.4.80.0130.00619.39
7.4.70.0030.01416.68
7.4.60.0090.01416.51
7.4.50.0030.01316.37
7.4.40.0070.01016.45
7.4.30.0070.01316.51
7.4.00.0140.00414.74
7.3.330.0040.00413.08
7.3.320.0000.00513.11
7.3.310.0000.00716.20
7.3.300.0030.00316.32
7.3.290.0100.00916.26
7.3.280.0100.00916.28
7.3.270.0070.01017.40
7.3.260.0150.00616.55
7.3.250.0090.01016.33
7.3.240.0090.00816.42
7.3.230.0080.00916.39
7.3.210.0080.00816.36
7.3.200.0000.01716.55
7.3.190.0060.01216.57
7.3.180.0060.01316.51
7.3.170.0120.00416.55
7.3.160.0100.00716.22
7.2.330.0110.00716.57
7.2.320.0180.00916.86
7.2.310.0130.00516.85
7.2.300.0060.02116.83
7.2.290.0090.00616.73
7.2.60.0090.00617.10
7.2.00.0050.01219.65
7.1.200.0060.00615.89
7.1.120.0070.01019.03
7.1.110.0000.01718.28
7.1.100.0020.01318.35
7.1.90.0090.01217.73
7.1.80.0120.00918.30
7.1.70.0070.00917.16
7.1.60.0170.01427.71
7.1.50.0190.00626.03
7.1.40.0230.01734.63
7.1.30.0170.01734.54
7.1.20.0130.02034.76
7.1.10.0080.00816.60
7.1.00.0050.04119.68
7.0.260.0030.01318.48
7.0.250.0110.00417.88
7.0.240.0030.01318.10
7.0.230.0080.01217.77
7.0.220.0030.02017.91
7.0.210.0040.01416.46
7.0.200.0030.01016.76
7.0.190.0040.00816.54
7.0.180.0000.02116.33
7.0.170.0060.01016.23
7.0.160.0030.01216.36
7.0.150.0070.01016.34
7.0.140.0100.00716.48
7.0.130.0090.00616.54
7.0.120.0060.01016.73
7.0.110.0060.01316.40
7.0.100.0060.00916.42
7.0.90.0060.01216.49
7.0.80.0060.01316.67
7.0.70.0050.00816.44
7.0.60.0130.03719.08
7.0.50.0030.04817.21
7.0.40.0100.03518.51
7.0.30.0150.04318.51
7.0.20.0120.03718.33
7.0.10.0180.02918.55
7.0.00.0130.03218.41
5.6.300.0210.04820.68
5.6.290.0070.06320.74
5.6.280.0080.06520.86
5.6.270.0070.06520.73
5.6.260.0110.06420.96
5.6.250.0100.06520.77
5.6.240.0100.06420.91
5.6.230.0100.06320.90
5.6.220.0130.06720.88
5.6.210.0050.07320.76
5.6.200.0130.05619.50
5.6.190.0170.06020.97
5.6.180.0210.05220.96
5.6.170.0180.05920.90
5.6.160.0150.05820.96
5.6.150.0200.06021.02
5.6.140.0180.06720.88
5.6.130.0220.06420.91
5.6.120.0170.05620.93
5.6.110.0200.05820.92
5.6.100.0100.06120.94
5.6.90.0150.06620.88
5.6.80.0190.04920.40
5.6.70.0150.05720.39
5.6.60.0120.05920.37
5.6.50.0210.06220.29
5.6.40.0160.06720.27
5.6.30.0190.06320.30
5.6.20.0180.05720.24
5.6.10.0140.05620.29
5.6.00.0120.05720.28
5.5.380.0040.07517.41
5.5.370.0130.05517.63
5.5.360.0060.06317.45
5.5.350.0220.06019.07
5.5.340.0050.05017.99
5.5.330.0210.05419.45
5.5.320.0170.05519.27
5.5.310.0160.06619.30
5.5.300.0200.05819.48
5.5.290.0150.05919.35
5.5.280.0110.06219.49
5.5.270.0190.05619.52
5.5.260.0170.06219.47
5.5.250.0070.06419.32
5.5.240.0150.05318.90
5.5.230.0120.05818.72
5.5.220.0170.05318.77
5.5.210.0150.06718.83
5.5.200.0170.06718.87
5.5.190.0130.06118.78
5.5.180.0170.06918.81
5.5.160.0120.05618.80
5.5.150.0100.05818.74
5.5.140.0140.05418.89
5.5.130.0170.05918.78
5.5.120.0120.06818.77
5.5.110.0150.05618.71
5.5.100.0100.05718.74
5.5.90.0180.04818.69
5.5.80.0130.05318.69
5.5.70.0100.06018.76
5.5.60.0070.06318.56
5.5.50.0120.05518.66
5.5.40.0140.05518.69
5.5.30.0190.05018.53
5.5.20.0120.05818.72
5.5.10.0150.05518.72
5.5.00.0130.06518.66

preferences:
63.83 ms | 400 KiB | 5 Q