3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __set($name, $value) { echo func_get_arg(0); $name = "xxx"; echo func_get_arg(0); } public function test($name) { echo func_get_arg(0); $name = "xxx"; echo func_get_arg(0); } } $a = new A(); $a->test('test'); $a->test = 5;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd7pF
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_METHOD_CALL                                         !0, 'test'
          4        SEND_VAL_EX                                              'test'
          5        DO_FCALL                                      0          
   19     6        ASSIGN_OBJ                                               !0, 'test'
          7        OP_DATA                                                  5
          8      > RETURN                                                   1

Class A:
Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd7pF
function name:  __set
number of ops:  12
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'func_get_arg'
          3        SEND_VAL                                                 0
          4        DO_ICALL                                         $2      
          5        ECHO                                                     $2
    6     6        ASSIGN                                                   !0, 'xxx'
    7     7        INIT_FCALL                                               'func_get_arg'
          8        SEND_VAL                                                 0
          9        DO_ICALL                                         $4      
         10        ECHO                                                     $4
    8    11      > RETURN                                                   null

End of function __set

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Bd7pF
function name:  test
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'func_get_arg'
          2        SEND_VAL                                                 0
          3        DO_ICALL                                         $1      
          4        ECHO                                                     $1
   12     5        ASSIGN                                                   !0, 'xxx'
   13     6        INIT_FCALL                                               'func_get_arg'
          7        SEND_VAL                                                 0
          8        DO_ICALL                                         $3      
          9        ECHO                                                     $3
   14    10      > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.63 ms | 1396 KiB | 15 Q