3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/html; charset=UTF-8'); function verificaNumero( $numero = null) { if( !is_null( $numero ) && preg_match('/^((\d+)((\.|,)\d+)?)$/', $numero) ) { $numero = preg_replace('/,/sim', '.', $numero); echo $numero . PHP_EOL; } else echo 'Não passou' . PHP_EOL; } verificaNumero(10); verificaNumero(10.11); verificaNumero('10,12'); verificaNumero('String'); verificaNumero('a123');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qfq7p
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-type%3A+text%2Fhtml%3B+charset%3DUTF-8'
          2        DO_ICALL                                                 
   13     3        INIT_FCALL                                               'verificanumero'
          4        SEND_VAL                                                 10
          5        DO_FCALL                                      0          
   14     6        INIT_FCALL                                               'verificanumero'
          7        SEND_VAL                                                 10.11
          8        DO_FCALL                                      0          
   15     9        INIT_FCALL                                               'verificanumero'
         10        SEND_VAL                                                 '10%2C12'
         11        DO_FCALL                                      0          
   16    12        INIT_FCALL                                               'verificanumero'
         13        SEND_VAL                                                 'String'
         14        DO_FCALL                                      0          
   17    15        INIT_FCALL                                               'verificanumero'
         16        SEND_VAL                                                 'a123'
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Function verificanumero:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/qfq7p
function name:  verificaNumero
number of ops:  21
compiled vars:  !0 = $numero
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        TYPE_CHECK                                    2  ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ_EX                                          ~2      ~2, ->9
          4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2F%5E%28%28%5Cd%2B%29%28%28%5C.%7C%2C%29%5Cd%2B%29%3F%29%24%2F'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        BOOL                                             ~2      $3
          9    > > JMPZ                                                     ~2, ->19
    6    10    >   INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%2C%2Fsim'
         12        SEND_VAL                                                 '.'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $4      
         15        ASSIGN                                                   !0, $4
    7    16        CONCAT                                           ~6      !0, '%0A'
         17        ECHO                                                     ~6
         18      > JMP                                                      ->20
   10    19    >   ECHO                                                     'N%C3%A3o+passou%0A'
   11    20    > > RETURN                                                   null

End of function verificanumero

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.23 ms | 1394 KiB | 24 Q