3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { function t($func) { if (is_array($func) && $func[0] = 'this') $this->$func[1](); } function test() { print 'test'; } } $func = ['this', 'test']; (new x)->t($func);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZosuL
function name:  (null)
number of ops:  7
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1        NEW                                              $2      'x'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $2, 't'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class x:
Function t:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/ZosuL
function name:  t
number of ops:  12
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        TYPE_CHECK                                  128  ~1      !0
          2      > JMPZ_EX                                          ~1      ~1, ->6
          3    >   ASSIGN_DIM                                       ~2      !0, 0
          4        OP_DATA                                                  'this'
          5        BOOL                                             ~1      ~2
          6    > > JMPZ                                                     ~1, ->11
    8     7    >   FETCH_OBJ_R                                      ~3      !0
          8        FETCH_DIM_R                                      ~4      ~3, 1
          9        INIT_DYNAMIC_CALL                                        ~4
         10        DO_FCALL                                      0          
    9    11    > > RETURN                                                   null

End of function t

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZosuL
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ECHO                                                     'test'
   14     1      > RETURN                                                   null

End of function test

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.77 ms | 1395 KiB | 13 Q