3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Demo {}; $o = new class extends Demo {}; $r = new ReflectionClass($o::class); echo $r; var_dump($o::class); var_dump(str_replace("\0", "\\x00", $o::class)); $withoutNull = substr($o::class, 0, strpos($o::class, "\0")); var_dump($withoutNull); try { new ReflectionClass($withoutNull); } catch (Throwable $e) { echo $e; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 34
Branch analysis from position: 34
2 jumps found. (Code = 107) Position 1 = 35, Position 2 = -2
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7LSSp
function name:  (null)
number of ops:  37
compiled vars:  !0 = $o, !1 = $r, !2 = $withoutNull, !3 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   DECLARE_ANON_CLASS                                   <array> 'demo'
          1        NEW                                                  $5      $4
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $5
    7     4        NEW                                                  $8      'ReflectionClass'
          5        FETCH_CLASS_NAME                                     ~9      !0
          6        SEND_VAL_EX                                                  ~9
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $8
    8     9        ECHO                                                         !1
   10    10        INIT_FCALL                                                   'var_dump'
         11        FETCH_CLASS_NAME                                     ~12     !0
         12        SEND_VAL                                                     ~12
         13        DO_ICALL                                                     
   11    14        INIT_FCALL                                                   'var_dump'
         15        FETCH_CLASS_NAME                                     ~14     !0
         16        FRAMELESS_ICALL_3                str_replace         ~15     '%00', '%5Cx00'
         17        OP_DATA                                                      ~14
         18        SEND_VAL                                                     ~15
         19        DO_ICALL                                                     
   12    20        FETCH_CLASS_NAME                                     ~17     !0
         21        FETCH_CLASS_NAME                                     ~18     !0
         22        FRAMELESS_ICALL_2                strpos              ~19     ~18, '%00'
         23        FRAMELESS_ICALL_3                substr              ~20     ~17, 0
         24        OP_DATA                                                      ~19
         25        ASSIGN                                                       !2, ~20
   13    26        INIT_FCALL                                                   'var_dump'
         27        SEND_VAR                                                     !2
         28        DO_ICALL                                                     
   15    29        NEW                                                  $23     'ReflectionClass'
         30        SEND_VAR_EX                                                  !2
         31        DO_FCALL                                          0          
         32        FREE                                                         $23
         33      > JMP                                                          ->36
   16    34  E > > CATCH                                           last         'Throwable'
   17    35    >   ECHO                                                         !3
   18    36    > > RETURN                                                       1

Class Demo: [no user functions]
Class Demo@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
139.74 ms | 1443 KiB | 14 Q