3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { static function baz($var) { echo "Oh the $var of it!\n"; } } (new class { public $arr = ["baz"]; function test( $arg ){ if( is_callable( $this->arr[0],true ) ){ (myClass::$this->arr[0])( $arg ); } } })->test("joy");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VB1H8
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_ANON_CLASS                               <indirect>  
          1        NEW                                              $1      $0
          2        DO_FCALL                                      0          
   22     3        INIT_METHOD_CALL                                         $1, 'test'
          4        SEND_VAL_EX                                              'joy'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class myClass:
Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VB1H8
function name:  baz
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ROPE_INIT                                     3  ~2      'Oh+the+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '+of+it%21%0A'
          4        ECHO                                                     ~1
    7     5      > RETURN                                                   null

End of function baz

End of class myClass.

Class class@anonymous:
Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/VB1H8
function name:  test
number of ops:  15
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'is_callable'
          2        FETCH_OBJ_R                                      ~1      'arr'
          3        FETCH_DIM_R                                      ~2      ~1, 0
          4        SEND_VAL                                                 ~2
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->14
   18     8    >   FETCH_STATIC_PROP_R          unknown             ~4      'this'
          9        FETCH_OBJ_R                                      ~5      ~4, 'arr'
         10        FETCH_DIM_R                                      ~6      ~5, 0
         11        INIT_DYNAMIC_CALL                                        ~6
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
   20    14    > > RETURN                                                   null

End of function test

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.29 ms | 1396 KiB | 15 Q