3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function set_x($v) { $this->x = $v; } function set_x_static($v) { $this->x = $v; } } $a = new A(); $a->set_x(1); A::set_x_static(2); echo $a->x; echo $this;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IA0Cf
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'set_x'
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0          
   15     6        INIT_STATIC_METHOD_CALL                                  'A', 'set_x_static'
          7        SEND_VAL                                                 2
          8        DO_FCALL                                      0          
   16     9        FETCH_OBJ_R                                      ~6      !0, 'x'
         10        ECHO                                                     ~6
   17    11        FETCH_THIS                                       ~7      
         12        ECHO                                                     ~7
         13      > RETURN                                                   1

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

End of function set_x

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

End of function set_x_static

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.38 ms | 1394 KiB | 13 Q