3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** vendor/symfony/abc */ namespace Foobar { /* private */ class Wizzbang { } } /** src/Wizzbonk.php */ namespace App { class ExternalClass { public function doStuff(): \Foobar\Wizzbang { return \Foobar\fetchPrivateWizzbang(); } public function accessOtherFizz(): \Foobar\Wizzbang { return new \Foobar\OtherFizz(); } } } namespace Foobar { function fetchPrivateWizzbang() { return new Wizzbang(); } /* private */ class OtherFizz extends Wizzbang { } } namespace { $x = new \App\ExternalClass(); var_dump($x->doStuff()); var_dump($x->accessOtherFizz()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u8hmQ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'App%5CExternalClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   37     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'doStuff'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   38     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'accessOtherFizz'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
   39    13      > RETURN                                                   1

Function foobar%5Cfetchprivatewizzbang:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u8hmQ
function name:  Foobar\fetchPrivateWizzbang
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $0      'Foobar%5CWizzbang'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   28     3*     > RETURN                                                   null

End of function foobar%5Cfetchprivatewizzbang

Class Foobar\Wizzbang: [no user functions]
Class App\ExternalClass:
Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u8hmQ
function name:  doStuff
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL_BY_NAME                                       'Foobar%5CfetchPrivateWizzbang'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   17     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function dostuff

Function accessotherfizz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u8hmQ
function name:  accessOtherFizz
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $0      'Foobar%5COtherFizz'
          1        DO_FCALL                                      0          
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   21     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function accessotherfizz

End of class App\ExternalClass.

Class Foobar\OtherFizz: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.8 ms | 1005 KiB | 14 Q