3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $t = array_keys( $rc->getConstants())[0]; if ( mb_substr($t,-1,1,"utf-8") == "\xe2\x99\xa5" ) { trigger_error("heart symbol is disallowed",E_USER_ERROR); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/t30hk
function name:  (null)
number of ops:  24
compiled vars:  !0 = $rc, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $2      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    5     4        INIT_FCALL                                               'array_keys'
          5        INIT_METHOD_CALL                                         !0, 'getConstants'
          6        DO_FCALL                                      0  $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        FETCH_DIM_R                                      ~7      $6, 0
         10        ASSIGN                                                   !1, ~7
    6    11        INIT_FCALL                                               'mb_substr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 -1
         14        SEND_VAL                                                 1
         15        SEND_VAL                                                 'utf-8'
         16        DO_ICALL                                         $9      
         17        IS_EQUAL                                                 $9, '%E2%99%A5'
         18      > JMPZ                                                     ~10, ->23
    7    19    >   INIT_FCALL                                               'trigger_error'
         20        SEND_VAL                                                 'heart+symbol+is+disallowed'
         21        SEND_VAL                                                 256
         22        DO_ICALL                                                 
    8    23    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.56 ms | 1395 KiB | 19 Q