3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = ['1,2', 1, '']; foreach ($number as $val) { if (!empty($val) || !ctype_alpha($val)) echo "val: $val is_numeric ".is_numeric(number_format($val))."\n\r"; } $number = 'abc1,2def'; $number = preg_replace("/[a-zA-Z]/i", '', $number); echo 'is numeric? '.is_numeric(number_format($number));

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.10.0040.01217.84
8.3.140.0080.00018.78
8.3.130.0000.00818.69
8.3.120.0090.00618.96
8.3.110.0060.00320.94
8.3.100.0110.00016.82
8.3.90.0030.00626.77
8.3.80.0060.00316.50
8.3.70.0090.00616.58
8.3.60.0070.01116.50
8.3.50.0170.00321.28
8.3.40.0090.00618.79
8.3.30.0110.00418.79
8.3.20.0070.00020.36
8.3.10.0000.00723.61
8.3.00.0060.00319.54
8.2.250.0100.01016.85
8.2.240.0100.01018.89
8.2.230.0070.00022.58
8.2.220.0060.00324.06
8.2.210.0080.00026.77
8.2.200.0090.00018.41
8.2.190.0220.00016.88
8.2.180.0040.01125.92
8.2.170.0110.00419.08
8.2.160.0140.00722.96
8.2.150.0080.00025.66
8.2.140.0000.00724.66
8.2.130.0060.00326.16
8.2.120.0040.00417.63
8.2.110.0000.00922.26
8.2.100.0080.00417.72
8.2.90.0060.00317.75
8.2.80.0040.00418.96
8.2.70.0030.00517.50
8.2.60.0000.00817.50
8.2.50.0040.00417.75
8.2.40.0040.00417.75
8.2.30.0050.00319.73
8.2.20.0000.00817.78
8.2.10.0030.00518.05
8.2.00.0070.00018.20
8.1.300.0140.00417.67
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0050.00224.66
8.1.260.0000.00826.35
8.1.250.0050.00228.09
8.1.240.0060.00322.15
8.1.230.0030.00917.89
8.1.220.0000.00717.78
8.1.210.0030.00618.77
8.1.200.0000.00817.47
8.1.190.0030.00517.25
8.1.180.0070.00418.10
8.1.170.0040.00417.62
8.1.160.0070.00019.07
8.1.150.0000.00718.96
8.1.140.0000.00817.38
8.1.130.0030.00317.72
8.1.120.0000.00717.52
8.1.110.0060.00317.50
8.1.100.0040.00417.50
8.1.90.0000.00717.51
8.1.80.0050.00317.47
8.1.70.0030.00317.47
8.1.60.0080.00017.60
8.1.50.0050.00217.54
8.1.40.0030.00617.53
8.1.30.0060.00317.54
8.1.20.0090.00017.61
8.1.10.0040.00417.56
8.1.00.0040.00417.42
8.0.300.0040.00420.43
8.0.290.0000.00816.88
8.0.280.0030.00318.39
8.0.270.0000.00717.26
8.0.260.0060.00317.14
8.0.250.0000.00717.03
8.0.240.0000.00717.09
8.0.230.0060.00316.94
8.0.220.0060.00316.95
8.0.210.0040.00416.85
8.0.200.0070.00016.93
8.0.190.0090.00317.04
8.0.180.0030.00316.96
8.0.170.0030.00516.88
8.0.160.0000.00717.07
8.0.150.0070.00316.96
8.0.140.0030.00616.98
8.0.130.0070.00013.42
8.0.120.0000.00816.84
8.0.110.0000.00716.87
8.0.100.0040.00417.09
8.0.90.0030.00516.88
8.0.80.0030.01816.95
8.0.70.0040.00416.83
8.0.60.0030.00517.09
8.0.50.0000.00717.04
8.0.30.0120.00617.00
8.0.20.0120.01217.40
8.0.10.0070.00016.92
8.0.00.0100.00816.75
7.4.330.0000.00515.08
7.4.320.0060.00016.80
7.4.300.0000.00616.69
7.4.290.0080.00016.54
7.4.280.0080.00316.87
7.4.270.0000.00716.91
7.4.260.0030.00316.92
7.4.250.0040.00416.91
7.4.240.0040.00416.85
7.4.230.0070.00016.60
7.4.220.0090.00916.84
7.4.210.0100.01316.70
7.4.200.0040.00416.70
7.4.160.0090.00616.59
7.4.150.0180.00017.40
7.4.140.0050.01517.86
7.4.130.0130.00616.91
7.4.120.0100.01116.74
7.4.110.0130.01316.69
7.4.100.0090.00916.62
7.4.90.0100.00716.70
7.4.80.0120.00619.39
7.4.70.0110.00616.87
7.4.60.0130.00316.74
7.4.50.0030.00516.72
7.4.40.0090.00916.68
7.4.30.0060.01216.87
7.4.00.0060.00815.26
7.3.330.0050.00213.36
7.3.320.0030.00513.52
7.3.310.0070.00016.55
7.3.300.0030.00316.53
7.3.290.0050.01116.61
7.3.280.0090.01016.60
7.3.270.0080.00817.40
7.3.260.0120.00516.60
7.3.250.0090.00916.65
7.3.240.0140.00416.65
7.3.230.0100.01016.89
7.3.210.0150.00416.55
7.3.200.0120.00616.66
7.3.190.0120.00616.55
7.3.180.0070.01016.54
7.3.170.0080.00816.75
7.3.160.0090.01516.84
7.3.00.0090.00616.80
7.2.330.0060.01716.75
7.2.320.0150.00416.95
7.2.310.0100.00616.88
7.2.300.0100.01316.77
7.2.290.0100.00716.86
7.2.130.0130.00617.11
7.2.120.0030.01417.05
7.2.110.0120.00416.75
7.2.100.0120.00316.98
7.2.90.0080.00617.04
7.2.80.0070.00917.02
7.2.70.0030.01316.90
7.2.60.0080.00817.21
7.2.50.0000.01116.86
7.2.40.0030.01417.15
7.2.30.0040.01217.00
7.2.20.0000.01716.73
7.2.10.0140.00416.95
7.2.00.0070.00717.07
7.1.250.0110.00416.02
7.1.240.0000.01415.86
7.1.230.0030.01115.96
7.1.220.0060.00915.94
7.1.210.0120.00316.12
7.1.200.0090.00415.82
7.1.190.0060.01115.88
7.1.180.0130.00315.84
7.1.170.0090.00015.81
7.1.160.0030.00916.20
7.1.150.0000.01515.88
7.1.140.0070.00715.69
7.1.130.0000.01515.58
7.1.120.0090.00616.05
7.1.110.0040.01115.95
7.1.100.0090.00415.96
7.1.90.0070.00715.86
7.1.80.0030.00916.06
7.1.70.0160.00316.50
7.1.60.0080.00917.52
7.1.50.0100.00616.62
7.1.40.0000.01416.03
7.1.30.0000.01715.86
7.1.20.0030.01015.88
7.1.10.0100.00316.00
7.1.00.0080.04019.18
7.0.330.0030.00915.58
7.0.320.0060.00915.53
7.0.310.0100.00315.39
7.0.300.0000.00915.38
7.0.290.0120.00615.32
7.0.280.0060.00615.31
7.0.270.0100.00715.66
7.0.260.0030.00915.45
7.0.250.0030.01015.56
7.0.240.0030.00915.44
7.0.230.0050.01015.66
7.0.220.0060.00615.14
7.0.210.0040.00815.61
7.0.200.0060.00516.16
7.0.190.0070.01015.56
7.0.180.0000.01215.28
7.0.170.0000.01015.48
7.0.160.0000.00815.39
7.0.150.0000.01415.36
7.0.140.0030.01015.45
7.0.130.0000.01615.52
7.0.120.0100.00315.51
7.0.110.0030.00915.65
7.0.100.0070.00315.34
7.0.90.0060.00615.29
7.0.80.0090.00615.30
7.0.70.0090.00615.26
7.0.60.0060.03117.76
7.0.50.0080.03816.63
7.0.40.0020.02816.75
7.0.30.0100.02716.76
7.0.20.0170.02516.92
7.0.10.0080.02716.90
7.0.00.0080.02516.79
5.6.380.0090.00614.14
5.6.370.0150.00014.23
5.6.360.0000.01214.16
5.6.350.0070.00714.35
5.6.340.0130.00014.45
5.6.330.0070.00714.09
5.6.320.0060.00914.61
5.6.310.0000.01414.39
5.6.300.0030.00914.38
5.6.290.0040.00914.19
5.6.280.0060.02817.72
5.6.270.0140.00014.22
5.6.260.0040.00714.28
5.6.250.0090.00614.04
5.6.240.0030.00714.35
5.6.230.0060.00914.11
5.6.220.0000.01214.35
5.6.210.0000.04617.44
5.6.200.0080.03516.21
5.6.190.0080.02717.59
5.6.180.2510.02217.32
5.6.170.0150.04517.25
5.6.160.0050.04817.58
5.6.150.0070.02216.27
5.6.140.0100.03516.08
5.6.130.0040.04116.33
5.6.120.0110.04217.70
5.6.110.0140.04417.76
5.6.100.0070.03317.54
5.6.90.0160.03317.61
5.6.80.0100.04017.22
5.6.70.2340.01817.36
5.6.60.0040.01214.14
5.6.50.0070.00714.42
5.6.40.0070.01114.03
5.6.30.0000.01314.18
5.6.20.0070.01014.26
5.6.10.0100.00914.43
5.6.00.0130.00314.42
5.5.380.0020.00711.18
5.5.370.0060.00611.18
5.5.360.0100.00011.18
5.5.350.0050.03515.82
5.5.340.0030.02314.60
5.5.330.0100.03515.77
5.5.320.0180.04215.82
5.5.310.0170.03215.80
5.5.300.0030.04714.56
5.5.290.0030.02714.57
5.5.280.0050.02416.04
5.5.270.0060.04116.07
5.5.260.0130.03816.07
5.5.250.0090.02215.93
5.5.240.0120.02015.68
5.5.230.0130.00711.18
5.5.220.0120.00611.18
5.5.210.0110.00011.18
5.5.200.0090.00911.18
5.5.190.0080.00611.18
5.5.180.0040.00411.18
5.5.170.0110.00411.21
5.5.160.0060.00311.18
5.5.150.0230.00711.18
5.5.140.0050.00311.24
5.5.130.0180.00711.18
5.5.120.0130.00711.18
5.5.110.0120.00011.18
5.5.100.0040.01211.18
5.5.90.0140.00711.18
5.5.80.0210.01111.18
5.5.70.0110.00911.18
5.5.60.0090.00411.18
5.5.50.0070.01111.18
5.5.40.0180.00311.19
5.5.30.0060.01411.18
5.5.20.0190.00811.18
5.5.10.0090.00911.18
5.5.00.0080.00411.18
5.4.450.0520.03015.07
5.4.440.0540.03015.17
5.4.430.0500.03215.07
5.4.420.0460.03115.30
5.4.410.0550.02715.28
5.4.400.0610.02315.06
5.4.390.0540.02515.06
5.4.380.0560.03215.18
5.4.370.0580.02715.18
5.4.360.0560.03215.06
5.4.350.0490.03415.06
5.4.340.0500.03114.91
5.4.330.0120.00411.18
5.4.320.0570.02715.14
5.4.310.0510.02815.07
5.4.300.0570.02915.18
5.4.290.0530.03215.14
5.4.280.0490.02515.13
5.4.270.0580.02715.16
5.4.260.0520.03114.95
5.4.250.0460.03715.19
5.4.240.0420.03115.09
5.4.230.0380.02815.06
5.4.220.0470.02814.91
5.4.210.0490.03015.00
5.4.200.0540.02815.16
5.4.190.0470.02915.13
5.4.180.0530.02815.18
5.4.170.0400.02914.91
5.4.160.0400.02515.06
5.4.150.0420.03015.18
5.4.140.0470.03813.73
5.4.130.0350.03013.72
5.4.120.0370.03213.77
5.4.110.0430.03113.77
5.4.100.0480.02313.69
5.4.90.0330.03013.76
5.4.80.0410.02713.80
5.4.70.0130.04013.81
5.4.60.0130.02013.72
5.4.50.0040.03513.68
5.4.40.0110.01613.64
5.4.30.0030.03813.79
5.4.20.0180.02313.82
5.4.10.0060.00611.18
5.4.00.0060.00311.18

preferences:
59.28 ms | 403 KiB | 5 Q