3v4l.org

run code in 300+ PHP versions simultaneously
<?php function formatAds(array $ad): array { $ad['last_name'] = ucfirst($ad['last_name']); $ad['first_name'] = ucfirst($ad['first_name']); $phoneNumber = str_replace(' ', '', $ad['phone_number']); $ad['phone_number'] = is_numeric($phoneNumber) && strlen($phoneNumber) === 10 ? $phoneNumber : null; return $ad; } $ad = [ "last_name" => "foo", "first_name" => "bar", "phone_number" => "04 55 66 77 11", ]; print_r(formatAds($ad));

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.120.0110.00920.79
8.4.110.0080.01322.44
8.4.100.0120.00917.47
8.4.90.0110.00820.53
8.4.80.0120.00917.79
8.4.70.0070.00219.42
8.4.60.0110.00817.70
8.4.50.0110.01117.93
8.4.40.0080.00019.54
8.4.30.0130.01020.51
8.4.20.0090.01217.71
8.4.10.0050.00517.85
8.3.250.0100.00918.91
8.3.240.0110.00820.66
8.3.230.0110.00816.37
8.3.220.0030.00519.08
8.3.210.0050.00318.55
8.3.200.0100.01016.64
8.3.190.0110.00716.38
8.3.180.0080.01016.80
8.3.170.0110.00716.50
8.3.160.0100.00717.41
8.3.150.0080.00017.38
8.3.140.0110.00418.83
8.3.130.0130.00618.19
8.3.120.0040.00420.99
8.3.110.0080.00020.94
8.3.100.0040.00424.06
8.3.90.0070.01126.77
8.3.80.0030.00719.36
8.3.70.0060.01318.56
8.3.60.0120.00618.13
8.3.50.0070.01016.17
8.3.40.0160.00319.02
8.3.30.0180.00018.84
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.290.0120.00616.62
8.2.280.0130.00616.87
8.2.270.0090.00922.12
8.2.260.0000.00816.62
8.2.250.0110.00416.63
8.2.240.0060.00317.28
8.2.230.0030.00622.58
8.2.220.0050.00337.54
8.2.210.0060.00326.77
8.2.200.0080.00318.88
8.2.190.0110.01118.29
8.2.180.0030.01725.92
8.2.170.0080.00818.83
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00426.35
8.2.110.0100.00022.00
8.2.100.0090.00319.64
8.2.90.0040.00417.63
8.2.80.0070.00318.96
8.2.70.0050.00317.63
8.2.60.0000.00817.75
8.2.50.0040.00417.55
8.2.40.0080.00517.63
8.2.30.0030.00618.01
8.2.20.0000.00818.02
8.2.10.0040.00419.20
8.2.00.0030.00419.20
8.1.330.0080.01122.07
8.1.320.0140.00516.30
8.1.310.0080.00016.84
8.1.300.0060.00317.99
8.1.290.0000.00930.84
8.1.280.0140.00725.92
8.1.270.0060.00320.77
8.1.260.0030.00628.09
8.1.250.0040.00428.09
8.1.240.0030.00619.14
8.1.230.0070.00420.97
8.1.220.0040.00418.55
8.1.210.0040.00418.77
8.1.200.0080.00017.66
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0080.00017.62
8.1.160.0000.00718.95
8.1.150.0070.00018.91
8.1.140.0060.00618.91
8.1.130.0000.00820.20
8.1.120.0070.00017.51
8.1.110.0040.00417.35
8.1.100.0050.00217.52
8.1.90.0000.00717.53
8.1.80.0030.00517.46
8.1.70.0070.00017.46
8.1.60.0060.00317.49
8.1.50.0000.00817.47
8.1.40.0050.00517.54
8.1.30.0040.00417.54
8.1.20.0040.00417.65
8.1.10.0030.00617.56
8.1.00.0120.00017.41
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0050.00218.37
8.0.270.0000.00817.94
8.0.260.0000.00818.37
8.0.250.0000.00716.85
8.0.240.0030.00316.96
8.0.230.0040.00416.94
8.0.220.0030.00316.74
8.0.210.0040.00416.76
8.0.200.0030.00316.95
8.0.190.0040.00416.93
8.0.180.0040.00416.82
8.0.170.0030.00616.89
8.0.160.0040.00416.82
8.0.150.0050.00216.79
8.0.140.0000.00716.76
8.0.130.0000.00613.34
8.0.120.0040.00416.86
8.0.110.0030.00516.91
8.0.100.0000.00716.93
8.0.90.0040.00416.70
8.0.80.0080.00816.82
8.0.70.0030.00316.79
8.0.60.0040.00416.90
8.0.50.0000.00716.81
8.0.30.0060.01616.95
8.0.20.0040.01216.93
8.0.10.0120.01317.03
8.0.00.0090.01317.00
7.4.330.0000.00515.55
7.4.320.0030.00316.47
7.4.300.0000.00716.50
7.4.290.0040.00416.36
7.4.280.0050.00316.59
7.4.270.0000.00716.61
7.4.260.0000.00613.27
7.4.250.0050.00216.61
7.4.240.0040.00416.52
7.4.230.0030.00316.36
7.4.220.0000.00716.60
7.4.210.0080.00916.57
7.4.200.0030.00316.71
7.4.160.0090.01216.70
7.4.150.0040.01116.50
7.4.140.0100.00516.50
7.4.130.0130.00616.49
7.4.120.0060.00916.51
7.4.110.0090.01216.36
7.4.100.0110.00716.41
7.4.90.0080.01416.46
7.4.80.0090.00616.48
7.4.70.0140.00716.55
7.4.60.0060.01216.43
7.4.50.0070.00716.30
7.4.40.0000.02016.52
7.4.30.0100.00716.42
7.4.20.0090.00616.49
7.4.10.0040.01116.44
7.4.00.0030.01216.48
7.3.330.0050.00316.37
7.3.320.0050.00013.37
7.3.310.0040.00416.40
7.3.300.0000.00616.42
7.3.290.0090.00816.38
7.3.270.0100.00716.46
7.3.260.0040.01416.37
7.3.250.0090.00916.38
7.3.240.0080.00616.37
7.3.230.0090.00916.39
7.3.220.0060.01616.25
7.3.210.0080.01416.25
7.3.200.0060.01216.39
7.3.190.0140.00716.36
7.3.180.0100.00716.38
7.3.170.0150.00016.28
7.3.160.0120.00616.28
7.3.150.0060.00916.25
7.3.140.0070.01416.28
7.3.130.0070.01116.36
7.3.120.0090.00916.22
7.3.110.0090.00616.22
7.3.100.0100.00916.16
7.3.90.0030.01216.59
7.3.80.0120.00316.31
7.3.70.0070.00716.43
7.3.60.0120.00416.51
7.3.50.0060.00916.50
7.3.40.0000.01616.43
7.3.30.0070.00816.53
7.3.20.0080.00816.31
7.3.10.0030.01216.37
7.3.00.0090.00616.41

preferences:
34.36 ms | 403 KiB | 5 Q