3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { private $x; public function __construct($x) { $this->$x = $x; } public function get() { return $this->x; } public function set($x) { $this->$x = $x; } } function f(Thing $t) { $t->set(42); } $t = new Thing(1); var_dump($t->get()); f($t); var_dump($t->get());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BF6IW
function name:  (null)
number of ops:  18
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Thing'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   23     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'get'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   24     9        INIT_FCALL                                               'f'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0          
   25    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !0, 'get'
         14        DO_FCALL                                      0  $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BF6IW
function name:  f
number of ops:  5
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_METHOD_CALL                                         !0, 'set'
          2        SEND_VAL_EX                                              42
          3        DO_FCALL                                      0          
   20     4      > RETURN                                                   null

End of function f

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

End of function __construct

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

End of function get

Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BF6IW
function name:  set
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        ASSIGN_OBJ                                               !0
          2        OP_DATA                                                  !0
   15     3      > RETURN                                                   null

End of function set

End of class Thing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.34 ms | 1403 KiB | 16 Q