3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Blabla { } function &getClassByMe($name) { static $instance = array(); if (isset($instance[$name])) { return $instance[$name]; } $instance['$name'] = new $name(); return $instance[$name]; } $aa =& getClassByMe('Blabla');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kFKFu
function name:  (null)
number of ops:  5
compiled vars:  !0 = $aa
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'getclassbyme'
          1        SEND_VAL                                                 'Blabla'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN_REF                                               !0, $1
          4      > RETURN                                                   1

Function getclassbyme:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
Return found
Branch analysis from position: 6
Return found
filename:       /in/kFKFu
function name:  getClassByMe
number of ops:  14
compiled vars:  !0 = $name, !1 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        BIND_STATIC                                              !1
   12     2        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !0
          3      > JMPZ                                                     ~2, ->6
   13     4    >   FETCH_DIM_W                                      $3      !1, !0
          5      > RETURN_BY_REF                                            $3
   16     6    >   FETCH_CLASS                                   0  $5      !0
          7        NEW                                              $6      $5
          8        DO_FCALL                                      0          
          9        ASSIGN_DIM                                               !1, '%24name'
         10        OP_DATA                                                  $6
   18    11        FETCH_DIM_W                                      $8      !1, !0
         12      > RETURN_BY_REF                                            $8
   19    13*     > RETURN_BY_REF                                            null

End of function getclassbyme

Class Blabla: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.15 ms | 1397 KiB | 14 Q