3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getValorDecimal($linhaDados, $posicaoInicial, $tamanhoCampo, $decimal = 0) { $retorno = ""; $retorno = substr($linhaDados,$posicaoInicial-1 , $tamanhoCampo ); $retorno = trim($retorno); $retorno = str_replace(".","", $retorno); $retorno = str_replace(",",".", $retorno); if ($retorno != "") { $retorno = ltrim($retorno,'0'); if ($retorno == '') { $retorno = '0'; } if ($retorno != 0 && $decimal != 0) { $divisor = str_pad('1', $decimal + 1, '0'); $retorno = round($retorno / $divisor , $decimal); } } return $retorno; } $v = getValorDecimal('000000015565835', 1, 15, 2); $v = str_replace(".",",", $v); $value = $v; $rsp = ""; if($value != ""){ $arrayVirgula = explode(",",trim($value)); if (count($arrayVirgula) > 1) { $rsp = preg_match("/^[0-9\,]+$/", strip_tags(trim($value))); }else{ $rsp = preg_match("/^[0-9\.]+$/", strip_tags(trim($value))); } } echo $rsp;

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.0120.00916.50
8.3.50.0080.00816.63
8.3.40.0090.00619.08
8.3.30.0110.00418.98
8.3.20.0070.00021.89
8.3.10.0000.00823.53
8.3.00.0080.00018.03
8.2.180.0000.01516.35
8.2.170.0080.00822.96
8.2.160.0100.00321.31
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0080.00020.52
8.2.120.0050.00326.35
8.2.110.0030.00621.38
8.2.100.0080.00417.91
8.2.90.0080.00419.21
8.2.80.0080.00018.05
8.2.70.0000.00817.75
8.2.60.0000.00818.03
8.2.50.0040.00418.10
8.2.40.0040.00420.66
8.2.30.0040.00419.25
8.2.20.0040.00418.12
8.2.10.0040.00418.08
8.2.00.0000.00718.19
8.1.280.0130.00725.92
8.1.270.0000.00821.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.95
8.1.230.0000.01217.59
8.1.220.0030.00517.89
8.1.210.0050.00318.77
8.1.200.0060.00617.47
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0050.00318.81
8.1.160.0040.00418.85
8.1.150.0040.00420.35
8.1.140.0000.00819.77
8.1.130.0000.00720.63
8.1.120.0000.00717.58
8.1.110.0030.00517.55
8.1.100.0030.00517.61
8.1.90.0070.00017.69
8.1.80.0000.00717.71
8.1.70.0040.00417.67
8.1.60.0030.00617.76
8.1.50.0040.00417.66
8.1.40.0080.00017.62
8.1.30.0050.00317.75
8.1.20.0060.00317.91
8.1.10.0000.00817.69
8.1.00.0000.00717.68
8.0.300.0040.00418.77
8.0.290.0060.00316.88
8.0.280.0070.00018.53
8.0.270.0070.00017.34
8.0.260.0030.00316.96
8.0.250.0000.00717.21
8.0.240.0040.00417.05
8.0.230.0000.00717.15
8.0.220.0000.00817.04
8.0.210.0070.00017.00
8.0.200.0070.00417.20
8.0.190.0030.00517.18
8.0.180.0030.00617.12
8.0.170.0070.00017.15
8.0.160.0000.00717.18
8.0.150.0040.00417.00
8.0.140.0040.00416.96
8.0.130.0030.00313.59
8.0.120.0030.00516.93
8.0.110.0040.00416.94
8.0.100.0070.00017.00
8.0.90.0040.00417.14
8.0.80.0120.00317.07
8.0.70.0000.00716.99
8.0.60.0000.00817.06
8.0.50.0040.00417.05
8.0.30.0040.01317.18
8.0.20.0160.00517.45
8.0.10.0070.00017.23
8.0.00.0070.01017.15
7.4.330.0000.00515.55
7.4.320.0000.00616.85
7.4.300.0030.00316.82
7.4.290.0070.00016.79
7.4.280.0000.00716.77
7.4.270.0070.00016.88
7.4.260.0070.00016.88
7.4.250.0030.00316.83
7.4.240.0000.00716.88
7.4.230.0030.00316.82
7.4.220.0130.01316.65
7.4.210.0030.01216.79
7.4.200.0000.00716.91
7.4.160.0080.01116.73
7.4.150.0120.00617.40
7.4.140.0100.00917.86
7.4.130.0110.01416.71
7.4.120.0140.00716.66
7.4.110.0030.01516.82
7.4.100.0120.00616.86
7.4.90.0110.00716.71
7.4.80.0100.00719.39
7.4.70.0100.00716.77
7.4.60.0160.00016.92
7.4.50.0060.00616.75
7.4.40.0090.01216.56
7.4.30.0130.00916.88
7.4.00.0050.01315.21
7.3.330.0050.00013.68
7.3.320.0020.00213.53
7.3.310.0030.00316.63
7.3.300.0000.00716.54
7.3.290.0070.00816.59
7.3.280.0070.00916.59
7.3.270.0130.01617.40
7.3.260.0130.00716.54
7.3.250.0070.01016.54
7.3.240.0090.00716.72
7.3.230.0060.01216.69
7.3.210.0100.00616.80
7.3.200.0060.01016.59
7.3.190.0080.00916.52
7.3.180.0100.01316.60
7.3.170.0030.01416.79
7.3.160.0100.00716.86
7.3.120.0130.00315.03
7.3.110.0110.00715.14
7.3.100.0120.00315.18
7.3.90.0040.01215.31
7.3.80.0040.01114.94
7.3.70.0060.00315.01
7.3.60.0000.01114.88
7.3.50.0040.01115.14
7.3.40.0100.00315.17
7.3.30.0090.00915.13
7.3.20.0070.01016.79
7.3.10.0000.01016.95
7.3.00.0040.00716.97
7.2.330.0130.00616.94
7.2.320.0100.00716.88
7.2.310.0060.01117.00
7.2.300.0070.01016.85
7.2.290.0130.00616.97
7.2.250.0070.01015.11
7.2.240.0070.01115.50
7.2.230.0060.00915.20
7.2.220.0040.00815.31
7.2.210.0030.01215.38
7.2.200.0000.01315.07
7.2.190.0030.01015.11
7.2.180.0060.01014.95
7.2.170.0090.00614.96
7.2.60.0070.00417.09
7.2.50.0000.01717.07
7.1.330.0040.00816.19
7.1.320.0070.00716.07
7.1.310.0030.01316.20
7.1.300.0060.01215.87
7.1.290.0060.00615.86
7.1.280.0000.01515.73
7.1.270.0030.01315.80
7.1.260.0040.00716.13
7.1.200.0000.01415.81
7.1.70.0220.00017.34
7.1.60.2070.01733.28
7.1.50.1130.01033.34
7.1.40.1300.01732.86
7.1.30.1370.01032.96
7.1.20.1100.01333.10
7.1.10.1070.01015.06
7.1.00.1070.00315.20
7.0.200.1930.01014.86
7.0.190.1870.01015.09
7.0.180.1070.01014.39
7.0.170.1300.01314.59
7.0.160.1200.01014.62
7.0.150.1070.01014.73
7.0.140.0730.01314.70
7.0.130.1200.01315.00
7.0.120.0930.00714.98
7.0.110.0170.01315.04
7.0.100.0930.01014.78
7.0.90.1000.01014.74
7.0.80.0930.01715.04
7.0.70.1070.01314.63
7.0.60.1070.01014.76
7.0.50.0130.01315.01
7.0.40.0470.00714.90
7.0.30.0970.01314.98
7.0.20.1270.01314.71
7.0.10.0830.00314.80
7.0.00.0870.01014.70

preferences:
59.91 ms | 400 KiB | 5 Q