3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Greeting { private static $message; public static function greet() { echo self::$message; } public static function __init($message) { self::$message = $message; } } class GreetingFactory { public static function createGreeting($message) { Greeting::__init($message); return 'Greeting'; } } class GreetingFactoryManager { private static $greetingFactory; public static function getInstance() { if (static::$greetingFactory === null) self::$greetingFactory = 'GreetingFactory'; return static::$greetingFactory; } } $greeterFactory = GreetingFactoryManager::getInstance(); $greeter = $greeterFactory::createGreeting('G\' morning'); $greeter::greet();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MLOU3
function name:  (null)
number of ops:  12
compiled vars:  !0 = $greeterFactory, !1 = $greeter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'GreetingFactoryManager', 'getInstance'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   25     3        FETCH_CLASS                                   0  $4      !0
          4        INIT_STATIC_METHOD_CALL                                  $4, 'createGreeting'
          5        SEND_VAL_EX                                              'G%27+morning'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
   26     8        FETCH_CLASS                                   0  $7      !1
          9        INIT_STATIC_METHOD_CALL                                  $7, 'greet'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Greeting:
Function greet:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MLOU3
function name:  greet
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'message'
          1        ECHO                                                     ~0
          2      > RETURN                                                   null

End of function greet

Function __init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MLOU3
function name:  __init
number of ops:  4
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        ASSIGN_STATIC_PROP                                       'message'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function __init

End of class Greeting.

Class GreetingFactory:
Function creategreeting:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MLOU3
function name:  createGreeting
number of ops:  6
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        INIT_STATIC_METHOD_CALL                                  'Greeting', '__init'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   'Greeting'
          5*     > RETURN                                                   null

End of function creategreeting

End of class GreetingFactory.

Class GreetingFactoryManager:
Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/MLOU3
function name:  getInstance
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'greetingFactory'
          1        TYPE_CHECK                                    2          ~0
          2      > JMPZ                                                     ~1, ->5
          3    >   ASSIGN_STATIC_PROP                                       'greetingFactory'
          4        OP_DATA                                                  'GreetingFactory'
   20     5    >   FETCH_STATIC_PROP_R          unknown             ~3      'greetingFactory'
          6      > RETURN                                                   ~3
   21     7*     > RETURN                                                   null

End of function getinstance

End of class GreetingFactoryManager.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.71 ms | 1399 KiB | 13 Q