3v4l.org

run code in 300+ PHP versions simultaneously
<?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); foreach ($excludedClasses as $bannedClass) { if (substr($className, 0, strlen($bannedClass)) === $bannedClass) { return FALSE; } } if (!(new ReflectionClass($className))->hasMethod('__toString')) { try { $x = (new ReflectionClass($className))->newInstanceWithoutConstructor(); $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/QTVVO
function name:  (null)
number of ops:  20
compiled vars:  !0 = $errored, !1 = $excludedClasses
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <false>
    5     1        INIT_FCALL                                               'set_error_handler'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQTVVO%3A5%240'
          3        BIND_LEXICAL                                             ~3, !0
          4        SEND_VAL                                                 ~3
          5        DO_ICALL                                                 
    7     6        ASSIGN                                                   !1, <array>
   14     7        INIT_FCALL                                               'var_dump'
   15     8        INIT_FCALL                                               'array_filter'
   16     9        INIT_FCALL                                               'get_declared_classes'
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
   17    12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQTVVO%3A17%241'
         13        BIND_LEXICAL                                             ~7, !0
         14        BIND_LEXICAL                                             ~7, !1
   36    15        SEND_VAL                                                 ~7
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
   38    19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQTVVO%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QTVVO
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%2FQTVVO%3A5%240

Function %00%7Bclosure%7D%2Fin%2FQTVVO%3A17%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 43
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Found catch point at position: 41
Branch analysis from position: 41
2 jumps found. (Code = 107) Position 1 = 42, Position 2 = -2
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QTVVO
function name:  {closure}
number of ops:  45
compiled vars:  !0 = $className, !1 = $errored, !2 = $excludedClasses, !3 = $class, !4 = $bannedClass, !5 = $x, !6 = $e
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                                              $8      'ReflectionClass'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !3, $8
   20     8      > FE_RESET_R                                       $11     !2, ->21
          9    > > FE_FETCH_R                                               $11, !4, ->21
   21    10    >   INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 0
         13        STRLEN                                           ~12     !4
         14        SEND_VAL                                                 ~12
         15        DO_ICALL                                         $13     
         16        IS_IDENTICAL                                             !4, $13
         17      > JMPZ                                                     ~14, ->20
   22    18    >   FE_FREE                                                  $11
         19      > RETURN                                                   <false>
   20    20    > > JMP                                                      ->9
         21    >   FE_FREE                                                  $11
   26    22        NEW                                              $15     'ReflectionClass'
         23        SEND_VAR_EX                                              !0
         24        DO_FCALL                                      0          
         25        INIT_METHOD_CALL                                         $15, 'hasMethod'
         26        SEND_VAL_EX                                              '__toString'
         27        DO_FCALL                                      0  $17     
         28        BOOL_NOT                                         ~18     $17
         29      > JMPZ                                                     ~18, ->43
   28    30    >   NEW                                              $19     'ReflectionClass'
         31        SEND_VAR_EX                                              !0
         32        DO_FCALL                                      0          
         33        INIT_METHOD_CALL                                         $19, 'newInstanceWithoutConstructor'
         34        DO_FCALL                                      0  $21     
         35        ASSIGN                                                   !5, $21
   29    36        CAST                                          6  ~23     !5
         37        ASSIGN                                                   !5, ~23
   30    38        BOOL_NOT                                         ~25     !1
         39      > RETURN                                                   ~25
         40*       JMP                                                      ->43
   31    41  E > > CATCH                                       last         'Exception'
   32    42    > > RETURN                                                   <false>
   35    43    > > RETURN                                                   <false>
   36    44*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.97 ms | 1404 KiB | 23 Q