3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public $memvar; public function __construct(&$a) { $a = 100; $this->memvar = ++$a; } public function PlusOne() { return $this->memvar; } } $x = 25; $a = &$x; $o = new test($a); var_dump($a,$o->PlusOne());// 126?
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/smmBo
function name:  (null)
number of ops:  13
compiled vars:  !0 = $x, !1 = $a, !2 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 25
   16     1        ASSIGN_REF                                               !1, !0
   17     2        NEW                                              $5      'test'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $5
   18     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        INIT_METHOD_CALL                                         !2, 'PlusOne'
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

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

End of function __construct

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

End of function plusone

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.49 ms | 1400 KiB | 15 Q