3v4l.org

run code in 300+ PHP versions simultaneously
<?php $A = new class() { public $name; public function getName() : string { return $this->name; } }; $B = new $A(); $B->name = 'matti'; var_dump($B->getName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RLti9
function name:  (null)
number of ops:  16
compiled vars:  !0 = $A, !1 = $B
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <true>  
          1        NEW                                              $3      $2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
   13     4        FETCH_CLASS                                   0  $6      !0
          5        NEW                                              $7      $6
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   14     8        ASSIGN_OBJ                                               !1, 'name'
          9        OP_DATA                                                  'matti'
   15    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !1, 'getName'
         12        DO_FCALL                                      0  $11     
         13        SEND_VAR                                                 $11
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class class@anonymous:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RLti9
function name:  getName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
    9     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getname

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.23 ms | 1395 KiB | 15 Q