3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const ABC♥ = "alphabet"; } $class = new ReflectionClass("Test"); $bad_char = "♥"; $constants = $class->getConstants(); $names = array_keys($constants); var_dump($names); /* for ($i = 0, $max = count($constants); $i < $max; $i++) { if ( mb_strpos( $constants[$i], $bad_char) !== false ) { trigger_error( "'$bad_char' in '$constant'" ); } } // Notice: '♥' in 'ABC♥' ... */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/j3Rjv
function name:  (null)
number of ops:  16
compiled vars:  !0 = $class, !1 = $bad_char, !2 = $constants, !3 = $names
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    4     4        ASSIGN                                                   !1, '%E2%99%A5'
    7     5        INIT_METHOD_CALL                                         !0, 'getConstants'
          6        DO_FCALL                                      0  $8      
          7        ASSIGN                                                   !2, $8
    8     8        INIT_FCALL                                               'array_keys'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $10     
         11        ASSIGN                                                   !3, $10
    9    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
   17    15      > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.6 ms | 1394 KiB | 17 Q