3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractBase { // Nothing } class Foo extends AbstractBase { // Nothing } class Doer { public function getThingToDo($fqcn): AbstractBase { return new $fqcn(); } } $doer = new Doer(); $foo = $doer->getThingToDo('Foo');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebCai
function name:  (null)
number of ops:  8
compiled vars:  !0 = $doer, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'Doer'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   22     3        INIT_METHOD_CALL                                         !0, 'getThingToDo'
          4        SEND_VAL_EX                                              'Foo'
          5        DO_FCALL                                      0  $5      
          6        ASSIGN                                                   !1, $5
          7      > RETURN                                                   1

Class AbstractBase: [no user functions]
Class Foo: [no user functions]
Class Doer:
Function getthingtodo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ebCai
function name:  getThingToDo
number of ops:  8
compiled vars:  !0 = $fqcn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        FETCH_CLASS                                   0  $1      !0
          2        NEW                                              $2      $1
          3        DO_FCALL                                      0          
          4        VERIFY_RETURN_TYPE                                       $2
          5      > RETURN                                                   $2
   18     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function getthingtodo

End of class Doer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.2 ms | 1393 KiB | 13 Q