3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { public $p = 3; function __construct() { $this->p = 4; } } //Cannot create Closure for new expression //$c = new X(...); $x = new x(); echo $x->p; $x->p = 5; echo $x->p; $f = $x->__construct(...); $f(); echo $x->p;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k57Tp
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x, !1 = $f
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $2      'x'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   15     3        FETCH_OBJ_R                                          ~5      !0, 'p'
          4        ECHO                                                         ~5
   16     5        ASSIGN_OBJ                                                   !0, 'p'
          6        OP_DATA                                                      5
   17     7        FETCH_OBJ_R                                          ~7      !0, 'p'
          8        ECHO                                                         ~7
   18     9        INIT_METHOD_CALL                                             !0, '__construct'
         10        CALLABLE_CONVERT                                     ~8      
         11        ASSIGN                                                       !1, ~8
   20    12        INIT_DYNAMIC_CALL                                            !1
         13        DO_FCALL                                          0          
   21    14        FETCH_OBJ_R                                          ~11     !0, 'p'
         15        ECHO                                                         ~11
   22    16      > RETURN                                                       1

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

End of function __construct

End of class x.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.35 ms | 1114 KiB | 13 Q