3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getClassReflector($className) { static $reflectionClassMap = []; return static function () use ($className, &$reflectionClassMap) { return isset($reflectionClassMap[$className]) ? $reflectionClassMap[$className] : $reflectionClassMap[$className] = new ReflectionClass($className); }; } $xmlReaderReflector = getClassReflector('XMLReader'); $xmlWriterReflector = getClassReflector('XMLWriter'); var_dump($xmlReaderReflector()); var_dump($xmlReaderReflector()); var_dump($xmlWriterReflector()); var_dump($xmlWriterReflector());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7MEr5
function name:  (null)
number of ops:  29
compiled vars:  !0 = $xmlReaderReflector, !1 = $xmlWriterReflector
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'getclassreflector'
          1        SEND_VAL                                                 'XMLReader'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   14     4        INIT_FCALL                                               'getclassreflector'
          5        SEND_VAL                                                 'XMLWriter'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !1, $4
   15     8        INIT_FCALL                                               'var_dump'
          9        INIT_DYNAMIC_CALL                                        !0
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
   16    13        INIT_FCALL                                               'var_dump'
         14        INIT_DYNAMIC_CALL                                        !0
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
   17    18        INIT_FCALL                                               'var_dump'
         19        INIT_DYNAMIC_CALL                                        !1
         20        DO_FCALL                                      0  $10     
         21        SEND_VAR                                                 $10
         22        DO_ICALL                                                 
   18    23        INIT_FCALL                                               'var_dump'
         24        INIT_DYNAMIC_CALL                                        !1
         25        DO_FCALL                                      0  $12     
         26        SEND_VAR                                                 $12
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function getclassreflector:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7MEr5
function name:  getClassReflector
number of ops:  7
compiled vars:  !0 = $className, !1 = $reflectionClassMap
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        BIND_STATIC                                              !1
    6     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7MEr5%3A6%240'
          3        BIND_LEXICAL                                             ~2, !0
          4        BIND_LEXICAL                                             ~2, !1
   10     5      > RETURN                                                   ~2
   11     6*     > RETURN                                                   null

End of function getclassreflector

Function %00%7Bclosure%7D%2Fin%2F7MEr5%3A6%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7MEr5
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $className, !1 = $reflectionClassMap
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
    7     2        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !0
          3      > JMPZ                                                     ~2, ->7
    8     4    >   FETCH_DIM_R                                      ~3      !1, !0
          5        QM_ASSIGN                                        ~4      ~3
          6      > JMP                                                      ->13
    9     7    >   NEW                                              $6      'ReflectionClass'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        ASSIGN_DIM                                       ~5      !1, !0
         11        OP_DATA                                                  $6
         12        QM_ASSIGN                                        ~4      ~5
         13    > > RETURN                                                   ~4
   10    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7MEr5%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.78 ms | 1402 KiB | 17 Q