3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check_int($i) { if (preg_match('[^0-9]', $i)) { return 0; } else { return 1; } } function check_int1($i) { return (strval((int)$i) === strval($i)); } echo check_int1("-5");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/99KQv
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'check_int1'
          1        SEND_VAL                                                 '-5'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function check_int:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/99KQv
function name:  check_int
number of ops:  10
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%5B%5E0-9%5D'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > JMPZ                                                     $1, ->8
    4     6    > > RETURN                                                   0
          7*       JMP                                                      ->9
    6     8    > > RETURN                                                   1
    8     9*     > RETURN                                                   null

End of function check_int

Function check_int1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/99KQv
function name:  check_int1
number of ops:  7
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        CAST                                          4  ~1      !0
          2        CAST                                          6  ~2      ~1
          3        CAST                                          6  ~3      !0
          4        IS_IDENTICAL                                     ~4      ~2, ~3
          5      > RETURN                                                   ~4
   13     6*     > RETURN                                                   null

End of function check_int1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.47 ms | 1399 KiB | 16 Q