3v4l.org

run code in 300+ PHP versions simultaneously
<?php $testValues = [ 'positives' => ['121', '231.45', '77,65', '9.456,77', '4,255.66'], // should pass 'negatives' => ['-121', '-231.45', '-77,65', '-9.456,77', '-4,255.66'], // should pass 'gibberish' => ['231.45a', '7a7,65', 'a9.456,77', '4,255.66a', 'aaaaaa'], // should fail ]; function customIsNumeric(string $value): bool { return is_numeric(str_replace(['.', ','], '', $value)); } foreach ($testValues as $category => $values) { var_dump($category); foreach ($values as $value) { var_dump(customIsNumeric($value)); } }

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.130.0060.00517.52
8.4.120.0100.01020.52
8.4.110.0090.01022.53
8.4.100.0090.00417.50
8.4.90.0140.00720.35
8.4.80.0040.00417.79
8.4.70.0120.00817.62
8.4.60.0110.01018.73
8.4.50.0220.00817.59
8.4.40.0080.00317.51
8.4.30.0130.00620.30
8.4.20.0100.01017.71
8.4.10.0090.00019.45
8.3.260.0120.00816.35
8.3.250.0120.00619.11
8.3.240.0100.00716.73
8.3.230.0140.00516.54
8.3.220.0050.00317.37
8.3.210.0140.00416.47
8.3.200.0040.00516.57
8.3.190.0110.00817.09
8.3.180.0010.00618.43
8.3.170.0120.00617.02
8.3.160.0110.00718.36
8.3.150.0130.00620.70
8.3.140.0120.00316.62
8.3.130.0040.00418.29
8.3.120.0030.00620.81
8.3.110.0080.01120.94
8.3.100.0040.00424.06
8.3.90.0030.00626.77
8.3.80.0030.00716.63
8.3.70.0070.00718.40
8.3.60.0060.01618.53
8.3.50.0100.00824.49
8.3.40.0180.00018.89
8.3.30.0150.00618.59
8.3.20.0070.00024.18
8.3.10.0000.00724.66
8.3.00.0040.00426.16
8.2.290.0150.00320.41
8.2.280.0060.00518.39
8.2.270.0070.01117.25
8.2.260.0000.01418.96
8.2.250.0150.00418.23
8.2.240.0070.00317.27
8.2.230.0060.00322.58
8.2.220.0080.00037.54
8.2.210.0090.00926.77
8.2.200.0030.00616.75
8.2.190.0120.00316.59
8.2.180.0070.01425.92
8.2.170.0120.00319.14
8.2.160.0070.01022.96
8.2.150.0030.00525.66
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0080.00026.35
8.2.110.0000.01019.30
8.2.100.0060.01017.91
8.2.90.0050.00317.91
8.2.80.0000.00819.30
8.2.70.0050.00317.50
8.2.60.0080.00018.05
8.2.50.0000.00818.05
8.2.40.0000.00819.95
8.2.30.0000.00717.98
8.2.20.0000.00817.94
8.2.10.0040.00419.19
8.2.00.0050.00219.29
8.1.330.0110.00921.82
8.1.320.0100.00916.15
8.1.310.0050.00318.71
8.1.300.0080.00017.67
8.1.290.0080.00030.84
8.1.280.0130.00325.92
8.1.270.0000.00823.99
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0030.00623.88
8.1.230.0070.00721.02
8.1.220.0090.00017.77
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0060.00317.11
8.1.180.0050.00318.10
8.1.170.0040.00419.01
8.1.160.0000.00718.81
8.1.150.0040.00418.95
8.1.140.0050.00318.95
8.1.130.0000.00720.07
8.1.120.0000.00717.50
8.1.110.0030.00617.36
8.1.100.0000.00817.48
8.1.90.0080.00017.48
8.1.80.0040.00417.34
8.1.70.0070.00017.44
8.1.60.0000.00717.41
8.1.50.0050.00317.51
8.1.40.0030.00617.52
8.1.30.0040.00417.70
8.1.20.0070.00317.54
8.1.10.0040.00417.52
8.1.00.0080.00017.43
8.0.300.0020.00521.96
8.0.290.0050.00316.58
8.0.280.0000.00818.44
8.0.270.0000.00817.88
8.0.260.0000.00618.58
8.0.250.0070.00016.80
8.0.240.0000.00716.98
8.0.230.0000.00916.88
8.0.220.0070.00016.89
8.0.210.0040.00416.88
8.0.200.0000.00716.84
8.0.190.0000.00816.97
8.0.180.0040.00416.92
8.0.170.0040.00416.83
8.0.160.0030.00516.85
8.0.150.0000.00716.87
8.0.140.0040.00416.78
8.0.130.0030.00313.23
8.0.120.0030.00516.85
8.0.110.0000.00716.95
8.0.100.0030.00316.76
8.0.90.0030.00316.92
8.0.80.0060.01116.83
8.0.70.0050.00216.89
8.0.60.0040.00416.71
8.0.50.0040.00416.91
8.0.30.0000.02116.98
8.0.20.0180.00017.04
8.0.10.0070.01117.05
8.0.00.0100.00916.92
7.4.330.0000.00516.84
7.4.320.0000.00716.41
7.4.300.0060.00016.51
7.4.290.0050.00316.54
7.4.280.0000.00816.51
7.4.270.0030.00316.49
7.4.260.0030.00313.29
7.4.250.0040.00416.46
7.4.240.0000.00716.55
7.4.230.0040.00416.48
7.4.220.0060.00116.51
7.4.210.0050.01116.50
7.4.200.0080.00016.41
7.4.150.0090.00916.44
7.4.140.0090.00916.54
7.4.130.0120.00616.43
7.4.120.0110.00816.41
7.4.110.0130.00616.41
7.4.100.0120.00616.53
7.4.90.0100.00916.39
7.4.80.0100.00716.63
7.4.70.0060.01216.49
7.4.60.0070.01016.52
7.4.50.0130.00616.58
7.4.40.0160.00616.57
7.4.30.0110.00716.53
7.4.20.0090.00916.40
7.4.10.0100.00916.48
7.4.00.0160.00316.54
7.3.330.0090.00016.30
7.3.320.0000.00613.12
7.3.310.0030.00316.34
7.3.300.0060.00016.22
7.3.290.0110.00716.33
7.3.270.0130.00616.56
7.3.260.0090.00916.25
7.3.250.0170.00316.41
7.3.240.0000.01616.36
7.3.230.0070.01116.35
7.3.220.0130.01016.73
7.3.210.0130.01016.46
7.3.200.0130.00616.41
7.3.190.0180.00316.37
7.3.180.0060.01216.51
7.3.170.0110.01116.38
7.3.160.0120.00616.56
7.3.150.0070.01116.61
7.3.140.0110.00616.52
7.3.130.0120.00916.45
7.3.120.0150.00316.42
7.3.110.0110.00816.59
7.3.100.0140.00416.23
7.3.90.0050.01416.32
7.3.80.0170.00316.49
7.3.70.0160.00316.38
7.3.60.0090.00916.38
7.3.50.0080.01116.44
7.3.40.0090.00916.46
7.3.30.0130.00316.33
7.3.20.0070.01016.30
7.3.10.0040.01216.55
7.3.00.0080.01016.33

preferences:
116.05 ms | 403 KiB | 5 Q