3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(stringToEnglishNumber('-214-277. 4404-', ',')); function stringToEnglishNumber($string, $separator = '') { $sanitized = preg_replace("/[^\-0-9,. ]/", '', $string); $split = str_split($sanitized); if (empty($split)) { return $string; } if ($split[0] == '-') { $split[0] = 'negative'; } $convert = [ '-' => 'dash', '.' => 'dot', ' ' => 'space', ]; foreach ($split as $key => $char) { if (array_key_exists($char, $convert)) { $split[$key] = $convert[$char]; } } return implode(" {$separator}", $split); }

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.0040.01118.68
8.3.50.0130.00521.40
8.3.40.0140.00518.99
8.3.30.0070.00718.95
8.3.20.0070.00020.17
8.3.10.0030.00523.40
8.3.00.0040.00422.52
8.2.180.0090.00618.54
8.2.170.0070.00718.99
8.2.160.0140.00722.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0100.00326.16
8.2.120.0040.00421.05
8.2.110.0100.00022.36
8.2.100.0080.00417.75
8.2.90.0040.00419.34
8.2.80.0090.00017.97
8.2.70.0030.00617.75
8.2.60.0080.00018.05
8.2.50.0060.00318.07
8.2.40.0080.00021.11
8.2.30.0050.00218.13
8.2.20.0090.00017.86
8.2.10.0000.00918.21
8.2.00.0000.00718.10
8.1.280.0170.00725.92
8.1.270.0020.00520.33
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0090.00019.54
8.1.230.0000.01117.76
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0040.00417.36
8.1.180.0000.00818.10
8.1.170.0080.00018.71
8.1.160.0040.00422.15
8.1.150.0050.00218.97
8.1.140.0040.00417.61
8.1.130.0040.00417.74
8.1.120.0040.00417.70
8.1.110.0040.00417.63
8.1.100.0000.00717.53
8.1.90.0000.00717.50
8.1.80.0030.00517.64
8.1.70.0050.00317.64
8.1.60.0040.00417.79
8.1.50.0040.00417.58
8.1.40.0040.00717.62
8.1.30.0000.00817.66
8.1.20.0040.00417.74
8.1.10.0040.00417.77
8.1.00.0030.00517.75
8.0.300.0030.00618.77
8.0.290.0000.00717.00
8.0.280.0000.00818.49
8.0.270.0040.00417.30
8.0.260.0080.00017.16
8.0.250.0040.00417.02
8.0.240.0000.00717.13
8.0.230.0030.00316.95
8.0.220.0040.00416.98
8.0.210.0040.00417.13
8.0.200.0030.00317.10
8.0.190.0090.00317.11
8.0.180.0040.00417.15
8.0.170.0060.00317.05
8.0.160.0040.00416.98
8.0.150.0050.00217.01
8.0.140.0000.00716.94
8.0.130.0040.00413.52
8.0.120.0030.00517.00
8.0.110.0030.00516.96
8.0.100.0040.00417.10
8.0.90.0000.00717.11
8.0.80.0030.01917.11
8.0.70.0030.00516.99
8.0.60.0000.00817.11
8.0.50.0040.00416.93
8.0.30.0080.01017.56
8.0.20.0160.00317.40
8.0.10.0040.00417.22
8.0.00.0080.01016.99
7.4.330.0050.00015.18
7.4.320.0030.00316.88
7.4.300.0000.00616.68
7.4.290.0040.00416.85
7.4.280.0060.00316.79
7.4.270.0070.00016.75
7.4.260.0080.00016.71
7.4.250.0040.00416.66
7.4.240.0050.00416.72
7.4.230.0000.00716.84
7.4.220.0130.00916.86
7.4.210.0120.00516.85
7.4.200.0040.00416.72
7.4.160.0070.01316.87
7.4.150.0150.01017.40
7.4.140.0130.00517.86
7.4.130.0110.00916.79
7.4.120.0100.00916.69
7.4.110.0100.01316.65
7.4.100.0180.00516.73
7.4.90.0050.01416.72
7.4.80.0110.01119.39
7.4.70.0110.00716.81
7.4.60.0060.01016.77
7.4.50.0050.00316.74
7.4.40.0100.00616.61
7.4.30.0120.00616.85
7.4.00.0090.00615.24
7.3.330.0020.00213.49
7.3.320.0060.00013.41
7.3.310.0000.00716.55
7.3.300.0030.00316.42
7.3.290.0000.00716.52
7.3.280.0090.00916.52
7.3.270.0100.00717.40
7.3.260.0090.00916.69
7.3.250.0100.00816.62
7.3.240.0180.00016.86
7.3.230.0110.00716.66
7.3.210.0110.00816.72
7.3.200.0030.01419.39
7.3.190.0060.00916.58
7.3.180.0130.00316.65
7.3.170.0100.01116.84
7.3.160.0080.00816.62
7.2.330.0140.00416.88
7.2.320.0130.00516.90
7.2.310.0140.00716.88
7.2.300.0070.01016.89
7.2.290.0100.00616.90
7.2.00.0070.00719.60
7.1.100.0060.00618.31
7.1.70.0030.00617.41
7.1.60.0080.00417.57
7.1.50.0030.01317.21
7.1.40.0150.00316.80
7.1.30.0030.00916.93
7.1.20.0090.00316.99
7.1.10.0080.00416.91
7.1.00.0050.00517.05
7.0.200.0000.00716.92
7.0.190.0070.00417.01
7.0.180.0090.00516.45
7.0.170.0040.00416.42
7.0.160.0000.00816.59
7.0.150.0030.01016.45
7.0.140.0000.01316.61
7.0.130.0070.00316.89
7.0.120.0030.00916.74
7.0.110.0090.00316.75
7.0.100.0070.00316.45
7.0.90.0040.00616.81
7.0.80.0030.00616.73
7.0.70.0090.00016.63
7.0.60.0030.00616.62
7.0.50.0060.00316.57
7.0.40.0000.01116.35
7.0.30.0000.01616.35
7.0.20.0000.00916.35
7.0.10.0000.00716.35
7.0.00.0060.00316.35
5.6.300.0070.04120.82
5.6.290.0070.07120.96
5.6.280.0030.04520.88
5.6.270.0030.04521.09
5.6.260.0030.04720.88
5.6.250.0040.04621.07
5.6.240.0000.04820.85
5.6.230.0030.04521.05
5.6.220.0030.04520.97
5.6.210.0000.05120.65
5.6.200.0030.04820.83
5.6.190.0130.04020.93
5.6.180.0070.03621.05
5.6.170.0000.04220.75
5.6.160.0070.05121.00
5.6.150.0000.04820.97
5.6.140.0030.04520.99
5.6.130.0140.05820.77
5.6.120.0070.04221.05
5.6.110.0070.04120.82
5.6.100.0070.04020.98
5.6.90.0070.03721.02
5.6.80.0100.04420.38
5.6.70.0030.04620.28
5.6.60.0060.03920.20
5.6.50.0030.04620.16
5.6.40.0030.04120.36
5.6.30.0000.05720.22
5.6.20.0070.03920.17
5.6.10.0060.03920.14
5.6.00.0070.04120.28
5.5.380.0000.04617.41
5.5.370.0000.05417.43
5.5.360.0030.04217.52
5.5.350.0040.04617.50
5.5.340.0030.04518.17
5.5.330.0100.03618.18
5.5.320.0030.04418.13
5.5.310.0140.04117.70
5.5.300.0040.03917.74
5.5.290.0070.04317.86
5.5.280.0000.04218.03
5.5.270.0070.05118.03
5.5.260.0000.05517.68
5.5.250.0030.04317.90
5.5.240.0130.03217.51
5.5.230.0070.04617.47
5.5.220.0070.03617.21
5.5.210.0100.03617.47
5.5.200.0070.03617.40
5.5.190.0030.04017.19
5.5.180.0030.03917.52
5.5.160.0000.04617.44
5.5.150.0070.03417.52
5.5.140.0070.03817.52
5.5.130.0000.04517.41
5.5.120.0030.04017.52
5.5.110.0000.04217.38
5.5.100.0030.03817.38
5.5.90.0030.03817.09
5.5.80.0000.03917.28
5.5.70.0000.04617.33
5.5.60.0000.04317.34
5.5.50.0100.03716.99
5.5.40.0030.03817.36
5.5.30.0000.04817.43
5.5.20.0090.04117.28
5.5.10.0070.04017.33
5.5.00.0100.03417.27
5.4.450.0070.04719.40
5.4.440.0030.03819.29
5.4.430.0000.04919.31
5.4.420.0030.04219.46
5.4.410.0030.03819.23
5.4.400.0030.04119.20
5.4.390.0100.03619.07
5.4.380.0000.04218.90
5.4.370.0070.07519.17
5.4.360.0000.04319.09
5.4.350.0000.04419.06
5.4.340.0000.04818.95
5.4.320.0060.03818.99
5.4.310.0030.06119.21
5.4.300.0030.04219.09
5.4.290.0060.04019.24
5.4.280.0070.03819.07
5.4.270.0300.03019.16
5.4.260.0060.03819.24
5.4.250.0030.04019.16
5.4.240.0000.04019.21
5.4.230.0000.04518.95
5.4.220.0000.04518.95
5.4.210.0000.04619.09
5.4.200.0070.03518.91
5.4.190.0060.03818.95
5.4.180.0030.04219.05
5.4.170.0030.04118.97
5.4.160.0060.03419.20
5.4.150.0030.05019.14
5.4.140.0030.04116.75
5.4.130.0000.04216.67
5.4.120.0000.03916.77
5.4.110.0000.04616.64
5.4.100.0060.03216.79
5.4.90.0030.03516.62
5.4.80.0000.04516.69
5.4.70.0070.03616.47
5.4.60.0090.03216.69
5.4.50.0030.03816.61
5.4.40.0030.04116.77
5.4.30.0000.04016.58
5.4.20.0070.03716.61
5.4.10.0030.04716.68
5.4.00.0060.03516.35

preferences:
58.11 ms | 401 KiB | 5 Q