3v4l.org

run code in 300+ PHP versions simultaneously
<?php class N { public $x = 5; } class A { public function __construct() { $this->class = new N(); $this->class->x = 4; } public function x() { return new $this->class(); } } $a = new A(); var_dump($a->x());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7qY0
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'x'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class N: [no user functions]
Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7qY0
function name:  __construct
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'N'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'class'
          3        OP_DATA                                                  $1
   13     4        FETCH_OBJ_W                                      $3      'class'
          5        ASSIGN_OBJ                                               $3, 'x'
          6        OP_DATA                                                  4
   14     7      > RETURN                                                   null

End of function __construct

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A7qY0
function name:  x
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'class'
          1        FETCH_CLASS                                   0  $1      ~0
          2        NEW                                              $2      $1
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $2
   18     5*     > RETURN                                                   null

End of function x

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.93 ms | 1396 KiB | 15 Q