3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X{ public function test($varName){ $this->{$varName} = 'blah'; } } $x = new X; $x->test('hello'); echo $x->hello;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/riLbN
function name:  (null)
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'X'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INIT_METHOD_CALL                                         !0, 'test'
          4        SEND_VAL_EX                                              'hello'
          5        DO_FCALL                                      0          
   10     6        FETCH_OBJ_R                                      ~5      !0, 'hello'
          7        ECHO                                                     ~5
   11     8      > RETURN                                                   1

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

End of function test

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.58 ms | 1393 KiB | 13 Q