3v4l.org

run code in 300+ PHP versions simultaneously
<?php class weird { var $myvar; var $other; var $blee; function __construct() { $myvar = 'other'; ${'myvar'} = 'blee'; $this->myvar = "A"; $this->$myvar = "B"; $this->${'$myvar'} = "C"; echo 'this->myvar: '.$this->myvar."\n"; echo 'this->$myvar: '.$this->$myvar."\n"; echo 'this->${\'$myvar\'}: '.$this->${'$myvar'}."\n"; } } $obj = new weird;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Gr9K
function name:  (null)
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'weird'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class weird:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Gr9K
function name:  __construct
number of ops:  21
compiled vars:  !0 = $myvar, !1 = $$myvar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'other'
   10     1        ASSIGN                                                   !0, 'blee'
   12     2        ASSIGN_OBJ                                               'myvar'
          3        OP_DATA                                                  'A'
   13     4        ASSIGN_OBJ                                               !0
          5        OP_DATA                                                  'B'
   14     6        ASSIGN_OBJ                                               !1
          7        OP_DATA                                                  'C'
   16     8        FETCH_OBJ_R                                      ~7      'myvar'
          9        CONCAT                                           ~8      'this-%3Emyvar%3A+', ~7
         10        CONCAT                                           ~9      ~8, '%0A'
         11        ECHO                                                     ~9
   17    12        FETCH_OBJ_R                                      ~10     !0
         13        CONCAT                                           ~11     'this-%3E%24myvar%3A+', ~10
         14        CONCAT                                           ~12     ~11, '%0A'
         15        ECHO                                                     ~12
   18    16        FETCH_OBJ_R                                      ~13     !1
         17        CONCAT                                           ~14     'this-%3E%24%7B%27%24myvar%27%7D%3A+', ~13
         18        CONCAT                                           ~15     ~14, '%0A'
         19        ECHO                                                     ~15
   20    20      > RETURN                                                   null

End of function __construct

End of class weird.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.82 ms | 1394 KiB | 13 Q