3v4l.org

run code in 300+ PHP versions simultaneously
w<?php $errored = FALSE; set_error_handler(function ($errno, $errstr) use (&$errored) { $errored = TRUE; return TRUE; }); $excludedClasses = [ // These cause fatal errors on instantiation "Closure", "SQLite3", "Filter", "PDO" ]; var_dump( array_filter( get_declared_classes(), function ($className) use (&$errored, $excludedClasses) { $errored = FALSE; $class = new ReflectionClass($className); if (!$class->isInstantiable() || $class->hasMethod('__construct') && (new ReflectionMethod("$className::__construct"))->isPrivate()) { return FALSE; } foreach ($excludedClasses as $bannedClass) { if (substr($className, 0, strlen($bannedClass)) === $bannedClass) { return FALSE; } } if (!(new ReflectionClass($className))->hasMethod('__toString')) { return true; } return FALSE; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iJXSl
function name:  (null)
number of ops:  21
compiled vars:  !0 = $errored, !1 = $excludedClasses
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     'w'
    3     1        ASSIGN                                                   !0, <false>
    5     2        INIT_FCALL                                               'set_error_handler'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FiJXSl%3A5%240'
          4        BIND_LEXICAL                                             ~3, !0
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                                 
    7     7        ASSIGN                                                   !1, <array>
   14     8        INIT_FCALL                                               'var_dump'
   15     9        INIT_FCALL                                               'array_filter'
   16    10        INIT_FCALL                                               'get_declared_classes'
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
   17    13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FiJXSl%3A17%241'
         14        BIND_LEXICAL                                             ~7, !0
         15        BIND_LEXICAL                                             ~7, !1
   33    16        SEND_VAL                                                 ~7
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                                 
   35    20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FiJXSl%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iJXSl
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errored
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        ASSIGN                                                   !2, <true>
          4      > RETURN                                                   <true>
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FiJXSl%3A5%240

Function %00%7Bclosure%7D%2Fin%2FiJXSl%3A17%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 12, Position 2 = 25
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 40
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 40
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 50
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 24
Branch analysis from position: 25
filename:       /in/iJXSl
function name:  {closure}
number of ops:  52
compiled vars:  !0 = $className, !1 = $errored, !2 = $excludedClasses, !3 = $class, !4 = $bannedClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   18     3        ASSIGN                                                   !1, <false>
   19     4        NEW                                              $6      'ReflectionClass'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !3, $6
   20     8        INIT_METHOD_CALL                                         !3, 'isInstantiable'
          9        DO_FCALL                                      0  $9      
         10        BOOL_NOT                                         ~10     $9
         11      > JMPNZ_EX                                         ~10     ~10, ->25
         12    >   INIT_METHOD_CALL                                         !3, 'hasMethod'
         13        SEND_VAL_EX                                              '__construct'
         14        DO_FCALL                                      0  $11     
         15      > JMPZ_EX                                          ~12     $11, ->24
         16    >   NEW                                              $13     'ReflectionMethod'
         17        NOP                                                      
         18        FAST_CONCAT                                      ~14     !0, '%3A%3A__construct'
         19        SEND_VAL_EX                                              ~14
         20        DO_FCALL                                      0          
         21        INIT_METHOD_CALL                                         $13, 'isPrivate'
         22        DO_FCALL                                      0  $16     
         23        BOOL                                             ~12     $16
         24    >   BOOL                                             ~10     ~12
         25    > > JMPZ                                                     ~10, ->27
   21    26    > > RETURN                                                   <false>
   23    27    > > FE_RESET_R                                       $17     !2, ->40
         28    > > FE_FETCH_R                                               $17, !4, ->40
   24    29    >   INIT_FCALL                                               'substr'
         30        SEND_VAR                                                 !0
         31        SEND_VAL                                                 0
         32        STRLEN                                           ~18     !4
         33        SEND_VAL                                                 ~18
         34        DO_ICALL                                         $19     
         35        IS_IDENTICAL                                             !4, $19
         36      > JMPZ                                                     ~20, ->39
   25    37    >   FE_FREE                                                  $17
         38      > RETURN                                                   <false>
   23    39    > > JMP                                                      ->28
         40    >   FE_FREE                                                  $17
   29    41        NEW                                              $21     'ReflectionClass'
         42        SEND_VAR_EX                                              !0
         43        DO_FCALL                                      0          
         44        INIT_METHOD_CALL                                         $21, 'hasMethod'
         45        SEND_VAL_EX                                              '__toString'
         46        DO_FCALL                                      0  $23     
         47        BOOL_NOT                                         ~24     $23
         48      > JMPZ                                                     ~24, ->50
   30    49    > > RETURN                                                   <true>
   32    50    > > RETURN                                                   <false>
   33    51*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FiJXSl%3A17%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.29 ms | 1404 KiB | 23 Q