3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PHPApprentice { private static $velocity = ''; private static $initialized = false; public static function initialize () { if ( self::initialized ) return; self::$initialized = true; self::$velocity = 'fast!'; } public static function getVelocity () { self::initialize(); return self::$velocity; } public static function setVelocity ( $value ) { self::$velocity = $value; self::$initialized = true; } } PHPApprentice::setVelocity ( 'Ludicrous Speed!!' ); echo PHPApprentice::getVelocity();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3h4kc
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_STATIC_METHOD_CALL                                  'PHPApprentice', 'setVelocity'
          1        SEND_VAL                                                 'Ludicrous+Speed%21%21'
          2        DO_FCALL                                      0          
   29     3        INIT_STATIC_METHOD_CALL                                  'PHPApprentice', 'getVelocity'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
          6      > RETURN                                                   1

Class PHPApprentice:
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/3h4kc
function name:  initialize
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_CLASS_CONSTANT                             ~0      'initialized'
          1      > JMPZ                                                     ~0, ->3
   10     2    > > RETURN                                                   null
   12     3    >   ASSIGN_STATIC_PROP                                       'initialized'
          4        OP_DATA                                                  <true>
   13     5        ASSIGN_STATIC_PROP                                       'velocity'
          6        OP_DATA                                                  'fast%21'
   14     7      > RETURN                                                   null

End of function initialize

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

End of function getvelocity

Function setvelocity:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3h4kc
function name:  setVelocity
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        ASSIGN_STATIC_PROP                                       'velocity'
          2        OP_DATA                                                  !0
   24     3        ASSIGN_STATIC_PROP                                       'initialized'
          4        OP_DATA                                                  <true>
   25     5      > RETURN                                                   null

End of function setvelocity

End of class PHPApprentice.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.28 ms | 1431 KiB | 13 Q