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; } } $o = new test($a=25); var_dump($a,$o->PlusOne());// 126?
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2VU0H
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'test'
          1        ASSIGN                                           ~3      !1, 25
          2        SEND_VAL_EX                                              ~3
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   16     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        INIT_METHOD_CALL                                         !0, 'PlusOne'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2VU0H
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/2VU0H
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:
157.39 ms | 1395 KiB | 15 Q