3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct($str) { $this->str = $str; } protected function test() { echo $this->str; } public function x($object) { return $object->test(); } } $a = new A("teste"); $b = new A(""); echo $b->x($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P6agJ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'A'
          1        SEND_VAL_EX                                              'teste'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   21     4        NEW                                              $5      'A'
          5        SEND_VAL_EX                                              ''
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   22     8        INIT_METHOD_CALL                                         !1, 'x'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $8      
         11        ECHO                                                     $8
         12      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P6agJ
function name:  __construct
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'str'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

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

End of function test

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P6agJ
function name:  x
number of ops:  5
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        INIT_METHOD_CALL                                         !0, 'test'
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   17     4*     > RETURN                                                   null

End of function x

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.05 ms | 1395 KiB | 13 Q