3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Ozzie; use Exception; use ReflectionClass; class Language { const DUTCH = 1; private static $languages_values; public static function getConstName($value) { if (!isset(self::$languages_values[$value])) { throw new Exception('de value bestaat niet!'); } return self::$languages_values[$value]; } public static function init() { static $initialized = false; if ( ! $initialized) { $ref_class = new ReflectionClass(self::class); self::$languages_values = array_flip($ref_class->getConstants()); $initialized = true; } } } // ja, dit zet je in het zelfde bestand Language::init();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZNUtm
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_STATIC_METHOD_CALL                                  'Ozzie%5CLanguage', 'init'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class Ozzie\Language:
Function getconstname:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZNUtm
function name:  getConstName
number of ops:  13
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        FETCH_STATIC_PROP_IS                             ~1      'languages_values'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, !0
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->9
   16     5    >   NEW                                              $4      'Exception'
          6        SEND_VAL_EX                                              'de+value+bestaat+niet%21'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $4
   18     9    >   FETCH_STATIC_PROP_R          unknown             ~6      'languages_values'
         10        FETCH_DIM_R                                      ~7      ~6, !0
         11      > RETURN                                                   ~7
   19    12*     > RETURN                                                   null

End of function getconstname

Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ZNUtm
function name:  init
number of ops:  16
compiled vars:  !0 = $initialized, !1 = $ref_class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   BIND_STATIC                                              !0
   24     1        BOOL_NOT                                         ~2      !0
          2      > JMPZ                                                     ~2, ->15
   25     3    >   NEW                                              $3      'ReflectionClass'
          4        SEND_VAL_EX                                              'Ozzie%5CLanguage'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $3
   26     7        INIT_NS_FCALL_BY_NAME                                    'Ozzie%5Carray_flip'
          8        INIT_METHOD_CALL                                         !1, 'getConstants'
          9        DO_FCALL                                      0  $7      
         10        SEND_VAR_NO_REF_EX                                       $7
         11        DO_FCALL                                      0  $8      
         12        ASSIGN_STATIC_PROP                                       'languages_values'
         13        OP_DATA                                                  $8
   28    14        ASSIGN                                                   !0, <true>
   30    15    > > RETURN                                                   null

End of function init

End of class Ozzie\Language.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.04 ms | 1400 KiB | 15 Q