3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Entity { class File { private $foo = 'top'; } class FileInbox { public $file; public function setFile(File $file) { $this->file = $file; } } } namespace Entity\FileInbox { class File { private $foo = 'nested'; } } namespace Test { use Entity\FileInbox; $fileInbox = new FileInbox(); $fileInbox->setFile(new File()); var_dump($fileInbox->file->foo); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JLLVB
function name:  (null)
number of ops:  15
compiled vars:  !0 = $fileInbox
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'Entity%5CFileInbox'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        INIT_METHOD_CALL                                         !0, 'setFile'
          4        NEW                                              $4      'Test%5CFile'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $4
          7        DO_FCALL                                      0          
   28     8        INIT_NS_FCALL_BY_NAME                                    'Test%5Cvar_dump'
          9        CHECK_FUNC_ARG                                           
         10        FETCH_OBJ_FUNC_ARG                               $7      !0, 'file'
         11        FETCH_OBJ_FUNC_ARG                               $8      $7, 'foo'
         12        SEND_FUNC_ARG                                            $8
         13        DO_FCALL                                      0          
   29    14      > RETURN                                                   1

Class Entity\File: [no user functions]
Class Entity\FileInbox:
Function setfile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JLLVB
function name:  setFile
number of ops:  4
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        ASSIGN_OBJ                                               'file'
          2        OP_DATA                                                  !0
   13     3      > RETURN                                                   null

End of function setfile

End of class Entity\FileInbox.

Class Entity\FileInbox\File: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.83 ms | 1395 KiB | 15 Q