3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $bad = "♥"; $key = array_keys( $rc->getConstants())[0]; //$substr = substr( $key, -1,1 ); $substr = mb_substr( $key, -1,1 ); // 5.6 if ( $substr === $bad ) { trigger_error( "'$bad' in '$key'" ); } // Notice: '♥' in 'AB♥' ...
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/1fZSW
function name:  (null)
number of ops:  29
compiled vars:  !0 = $rc, !1 = $bad, !2 = $key, !3 = $substr
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'
    5     5        INIT_FCALL                                               'array_keys'
          6        INIT_METHOD_CALL                                         !0, 'getConstants'
          7        DO_FCALL                                      0  $8      
          8        SEND_VAR                                                 $8
          9        DO_ICALL                                         $9      
         10        FETCH_DIM_R                                      ~10     $9, 0
         11        ASSIGN                                                   !2, ~10
    7    12        INIT_FCALL                                               'mb_substr'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 -1
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !3, $12
    8    18        IS_IDENTICAL                                             !3, !1
         19      > JMPZ                                                     ~14, ->28
    9    20    >   INIT_FCALL                                               'trigger_error'
         21        ROPE_INIT                                     5  ~16     '%27'
         22        ROPE_ADD                                      1  ~16     ~16, !1
         23        ROPE_ADD                                      2  ~16     ~16, '%27+in+%27'
         24        ROPE_ADD                                      3  ~16     ~16, !2
         25        ROPE_END                                      4  ~15     ~16, '%27'
         26        SEND_VAL                                                 ~15
         27        DO_ICALL                                                 
   11    28    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.78 ms | 1395 KiB | 19 Q