3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ //$x; } function foo($p){ $p->x +=3; } function foo2($p){ $p->x +=1; return $p->x -1; } $a = new A(); $a->x =1; foo($a); $a->x = foo2($a); echo $a-x;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c9o7A
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        ASSIGN_OBJ                                               !0, 'x'
          4        OP_DATA                                                  1
   20     5        INIT_FCALL                                               'foo'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   21     8        INIT_FCALL                                               'foo2'
          9        SEND_VAR                                                 !0
         10        DO_FCALL                                      0  $7      
         11        ASSIGN_OBJ                                               !0, 'x'
         12        OP_DATA                                                  $7
   22    13        FETCH_CONSTANT                                   ~8      'x'
         14        SUB                                              ~9      !0, ~8
         15        ECHO                                                     ~9
         16      > RETURN                                                   1

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

End of function foo

Function foo2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c9o7A
function name:  foo2
number of ops:  7
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ_OP                                 1          !0, 'x'
          2        OP_DATA                                                  1
   14     3        FETCH_OBJ_R                                      ~2      !0, 'x'
          4        SUB                                              ~3      ~2, 1
          5      > RETURN                                                   ~3
   15     6*     > RETURN                                                   null

End of function foo2

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.22 ms | 1399 KiB | 15 Q