3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function ($errno, $errstr) { global $errored; $errored = TRUE; return TRUE; }); $errored = FALSE; var_dump( array_filter( get_declared_classes(), function ($className) use (&$errored) { $errored = FALSE; if (!(new ReflectionClass($className))->hasMethod('__toString')) { $x = new $className; $x = (string)$x; return $errored; } return FALSE; } ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hCh1V
function name:  (null)
number of ops:  17
compiled vars:  !0 = $errored
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'set_error_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhCh1V%3A4%240'
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
    6     4        ASSIGN                                                   !0, <false>
    8     5        INIT_FCALL                                               'var_dump'
    9     6        INIT_FCALL                                               'array_filter'
   10     7        INIT_FCALL                                               'get_declared_classes'
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
   11    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FhCh1V%3A11%241'
         11        BIND_LEXICAL                                             ~5, !0
   19    12        SEND_VAL                                                 ~5
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
   21    16      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FhCh1V%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hCh1V
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errored
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     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%2FhCh1V%3A4%240

Function %00%7Bclosure%7D%2Fin%2FhCh1V%3A11%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hCh1V
function name:  {closure}
number of ops:  20
compiled vars:  !0 = $className, !1 = $errored, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   12     2        ASSIGN                                                   !1, <false>
   13     3        NEW                                              $4      'ReflectionClass'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        INIT_METHOD_CALL                                         $4, 'hasMethod'
          7        SEND_VAL_EX                                              '__toString'
          8        DO_FCALL                                      0  $6      
          9        BOOL_NOT                                         ~7      $6
         10      > JMPZ                                                     ~7, ->18
   14    11    >   FETCH_CLASS                                   0  $8      !0
         12        NEW                                              $9      $8
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !2, $9
   15    15        CAST                                          6  ~12     !2
         16        ASSIGN                                                   !2, ~12
   16    17      > RETURN                                                   !1
   18    18    > > RETURN                                                   <false>
   19    19*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FhCh1V%3A11%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.86 ms | 1405 KiB | 21 Q