3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $priv; private static function set(self $instance, $name, $value) { $instance->$name = $value; } public function __construct(self $instance = null) { $name = 'priv'; $value = 'dafuq'; if ($instance) { self::set($instance, $name, $value); $instance->$name = $value; } } } $a = new Foo; $b = new Foo($a); var_dump($a, $b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Os4QN
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        NEW                                              $5      'Foo'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   27     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function set

Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/Os4QN
function name:  __construct
number of ops:  12
compiled vars:  !0 = $instance, !1 = $name, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV_INIT                                        !0      null
   14     1        ASSIGN                                                   !1, 'priv'
   15     2        ASSIGN                                                   !2, 'dafuq'
   17     3      > JMPZ                                                     !0, ->11
   18     4    >   INIT_STATIC_METHOD_CALL                                  'set'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !2
          8        DO_FCALL                                      0          
   19     9        ASSIGN_OBJ                                               !0, !1
         10        OP_DATA                                                  !2
   21    11    > > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.35 ms | 1396 KiB | 15 Q