3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class A extends B{ public function hi(){ echo $this->myVar->greeting("Hello", "World"); } } Class B{ public $myVar; public function __construct(){ $this->myVar->greeting = self::myFunction; } public static function myFunction($x, $y){ return $x." ".$y; } } $myClass = new A(); $myClass->hi(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4OotI
function name:  (null)
number of ops:  7
compiled vars:  !0 = $myClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'a', 'b'
   20     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   21     4        INIT_METHOD_CALL                                         !0, 'hi'
          5        DO_FCALL                                      0          
   22     6      > RETURN                                                   1

Class A:
Function hi:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4OotI
function name:  hi
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_OBJ_R                                      ~0      'myVar'
          1        INIT_METHOD_CALL                                         ~0, 'greeting'
          2        SEND_VAL_EX                                              'Hello'
          3        SEND_VAL_EX                                              'World'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
    5     6      > RETURN                                                   null

End of function hi

End of class A.

Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4OotI
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_CLASS_CONSTANT                             ~2      'myFunction'
          1        FETCH_OBJ_W                                      $0      'myVar'
          2        ASSIGN_OBJ                                               $0, 'greeting'
          3        OP_DATA                                                  ~2
   13     4      > RETURN                                                   null

End of function __construct

Function myfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4OotI
function name:  myFunction
number of ops:  6
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        CONCAT                                           ~2      !0, '+'
          3        CONCAT                                           ~3      ~2, !1
          4      > RETURN                                                   ~3
   17     5*     > RETURN                                                   null

End of function myfunction

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.22 ms | 1395 KiB | 13 Q