3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($id) { $getArg = $id; if ($getArg (is_numeric($getArg) || $getArg === 'test')) { return true; } return false; } var_dump(test('1'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L6gtL
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'test'
          2        SEND_VAL                                                 '1'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/L6gtL
function name:  test
number of ops:  15
compiled vars:  !0 = $id, !1 = $getArg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, !0
    6     2        INIT_DYNAMIC_CALL                                        !1
          3        INIT_FCALL                                               'is_numeric'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $3      
          6      > JMPNZ_EX                                         ~4      $3, ->9
          7    >   IS_IDENTICAL                                     ~5      !1, 'test'
          8        BOOL                                             ~4      ~5
          9    >   SEND_VAL_EX                                              ~4
         10        DO_FCALL                                      0  $6      
         11      > JMPZ                                                     $6, ->13
    7    12    > > RETURN                                                   <true>
   10    13    > > RETURN                                                   <false>
   11    14*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.15 ms | 1398 KiB | 18 Q