3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Hello { private static $greeting = 'Hello'; private static $initialized = false; private static function initialize() { if (self::$initialized) return; self::$greeting .= ' There!'; self::$initialized = true; } public static function greet() { self::initialize(); echo self::$greeting; } } Hello::greet(); // Hello There!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KIiNH
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'Hello', 'greet'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class Hello:
Function initialize:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 3
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KIiNH
function name:  initialize
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'initialized'
          1      > JMPZ                                                     ~0, ->3
   11     2    > > RETURN                                                   null
   13     3    >   ASSIGN_STATIC_PROP_OP                         8          'greeting'
          4        OP_DATA                                                  '+There%21'
   14     5        ASSIGN_STATIC_PROP                                       'initialized'
          6        OP_DATA                                                  <true>
   15     7      > RETURN                                                   null

End of function initialize

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

End of function greet

End of class Hello.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.63 ms | 1394 KiB | 13 Q