3v4l.org

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

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

End of function __construct

Function gettest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gXYdQ
function name:  getTest
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   FETCH_THIS                                       ~0      
          1        FETCH_R                      local               ~1      ~0
          2        FETCH_OBJ_R                                      ~2      ~1, 'test'
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of function gettest

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.73 ms | 1394 KiB | 13 Q