3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = [ ["Apple iPhone 13 128 Go Minuit", "1 379€00"], ["Apple iPhone 14 128 Go Minuit", "1 379€00"], ["Apple iPhone 14 128 Go Lumière Stellaire", "919€00"], ["Apple iPhone 14 Pro 128 Go Noir Sidéral", "919€00"] ]; foreach ($result as $item) { $price = $item['1']; $convert_array = ['$', '€', '£', '¥', '₩', '₹', '₽', '฿', '₺', '₴']; foreach ($convert_array as $symbol) { if (strpos($price, $symbol) !== false) { $price = str_replace($symbol, '.', $price); $price = preg_replace('/\. /', '', $price, 1); $price = str_replace(',', '.', $price); break; } } $price_format = trim($price); if (substr($price_format, -1) == '.') { $price_format = substr($price_format, 0, -1); } if (is_string($price_format)) { $price_format = number_format((float)str_replace(' ','',$price_format), 2, '.', ' '); } if (is_numeric($price_format)) { $price_format = $price_format . ' num'; } print_r($price_format); echo PHP_EOL; }

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.0160.00424.17
8.4.110.0100.00722.38
8.4.100.0070.01218.51
8.4.90.0080.01219.00
8.4.80.0120.00720.44
8.4.70.0060.00318.19
8.4.60.0100.00618.81
8.4.50.0070.00218.73
8.4.40.0030.00617.91
8.4.30.0060.01320.72
8.4.20.0070.01423.79
8.4.10.0130.00723.68
8.3.250.0140.00418.94
8.3.240.0040.00617.03
8.3.230.0110.00916.62
8.3.220.0040.00319.02
8.3.210.0080.00818.31
8.3.200.0100.00916.67
8.3.190.0100.00917.13
8.3.180.0100.00916.96
8.3.170.0120.00618.96
8.3.160.0090.00918.79
8.3.150.0150.00417.06
8.3.140.0030.00616.68
8.3.130.0060.00318.35
8.3.120.0060.00320.46
8.3.110.0060.00318.68
8.3.100.0030.00524.06
8.3.90.0040.00426.77
8.3.80.0030.00618.55
8.3.70.0110.00416.88
8.3.60.0070.01116.88
8.3.50.0110.00718.63
8.3.40.0110.00420.22
8.3.30.0000.01518.92
8.3.20.0050.00324.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.290.0110.00920.45
8.2.280.0130.00618.61
8.2.270.0090.00917.27
8.2.260.0150.00016.85
8.2.250.0000.00916.98
8.2.240.0050.00517.34
8.2.230.0050.00320.94
8.2.220.0070.01337.54
8.2.210.0130.00726.77
8.2.200.0030.00616.88
8.2.190.0000.01516.84
8.2.180.0070.00716.88
8.2.170.0070.00719.15
8.2.160.0110.00322.96
8.2.150.0000.00825.66
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0050.00321.11
8.2.110.0030.00620.93
8.2.100.0100.00318.03
8.2.90.0000.00817.88
8.2.80.0040.00419.10
8.2.70.0000.01018.00
8.2.60.0000.00917.75
8.2.50.0040.00417.88
8.2.40.0150.00217.75
8.2.30.0110.00517.63
8.2.20.0080.00817.71
8.2.10.0120.00417.75
8.2.00.0120.00317.88
8.1.330.0110.00821.88
8.1.320.0110.00918.29
8.1.310.0080.01217.79
8.1.300.0060.00320.34
8.1.290.0060.00330.84
8.1.280.0170.00325.92
8.1.270.0070.00024.66
8.1.260.0070.00326.35
8.1.250.0140.00028.09
8.1.240.0040.00422.65
8.1.230.0080.00317.89
8.1.220.0000.00817.78
8.1.210.0040.00418.77
8.1.200.0040.00417.60
8.1.190.0040.00417.35
8.1.180.0110.00218.10
8.1.170.0080.00817.63
8.1.160.0090.00917.62
8.1.150.0160.00017.62
8.1.140.0110.00617.62
8.1.130.0090.00617.62
8.1.120.0050.01117.62
8.1.110.0100.00517.62
8.1.100.0170.00017.63
8.1.90.0150.00317.62
8.1.80.0150.00417.62
8.1.70.0150.00517.62
8.1.60.0140.00517.63
8.1.50.0130.00317.62
8.1.40.0130.00417.63
8.1.30.0100.00617.71
8.1.20.0120.00617.63
8.1.10.0140.00317.62
8.1.00.0140.00517.62
8.0.300.0040.00418.77
8.0.290.0000.00817.00
8.0.280.0190.00017.62
8.0.270.0120.00417.62
8.0.260.0170.00217.62
8.0.250.0080.00817.62
8.0.240.0150.00017.62
8.0.230.0160.00017.62
8.0.220.0060.00917.62
8.0.210.0130.00417.62
8.0.200.0070.00917.62
8.0.190.0100.00717.62
8.0.180.0160.00017.62
8.0.170.0120.00617.62
8.0.160.0110.00617.62
8.0.150.0120.00317.62
8.0.140.0110.00517.62
8.0.130.0160.00017.62
8.0.120.0000.01517.62
8.0.110.0160.00017.62
8.0.100.0140.00517.62
8.0.90.0170.00017.62
8.0.80.0130.00417.62
8.0.70.0080.00817.62
8.0.60.0160.00017.62
8.0.50.0120.00417.62
8.0.30.0080.00817.62
8.0.20.0110.00617.62
8.0.10.0050.01017.62

preferences:
29.86 ms | 403 KiB | 5 Q