3v4l.org

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

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

End of function %00%7Bclosure%7D%2Fin%2F3ErWl%3A3%240

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

End of function %00%7Bclosure%7D%2Fin%2F3ErWl%3A15%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.44 ms | 1404 KiB | 23 Q