3v4l.org

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

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

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.5 ms | 1396 KiB | 17 Q