3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function __construct () { $this->bar = 1; } function add() { $this->bar+=1; } } $one = $two = $three = new foo(); $one->add(); var_dump($one); var_dump($two);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Tnq4
function name:  (null)
number of ops:  14
compiled vars:  !0 = $one, !1 = $two, !2 = $three
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $3      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                           ~5      !2, $3
          3        ASSIGN                                           ~6      !1, ~5
          4        ASSIGN                                                   !0, ~6
   14     5        INIT_METHOD_CALL                                         !0, 'add'
          6        DO_FCALL                                      0          
   15     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   16    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

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

End of function __construct

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Tnq4
function name:  add
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ_OP                                 1          'bar'
          1        OP_DATA                                                  1
    9     2      > RETURN                                                   null

End of function add

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.63 ms | 1387 KiB | 15 Q