3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); //$bad = "♥"; $bad = chr(e2); $key = array_keys( $rc->getConstants() ); $target = $key[ 0 ]; $pos = strpos( $target, $bad ); var_dump( $pos,mb_substr( $target, $pos,1 )); // 5.6 if ($pos !== FALSE) { trigger_error( "'$bad' in '$target'" ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 41
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/V3QC4
function name:  (null)
number of ops:  42
compiled vars:  !0 = $rc, !1 = $bad, !2 = $key, !3 = $target, !4 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    5     4        INIT_FCALL                                               'chr'
          5        FETCH_CONSTANT                                   ~8      'e2'
          6        SEND_VAL                                                 ~8
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !1, $9
    6     9        INIT_FCALL                                               'array_keys'
         10        INIT_METHOD_CALL                                         !0, 'getConstants'
         11        DO_FCALL                                      0  $11     
         12        SEND_VAR                                                 $11
         13        DO_ICALL                                         $12     
         14        ASSIGN                                                   !2, $12
    7    15        FETCH_DIM_R                                      ~14     !2, 0
         16        ASSIGN                                                   !3, ~14
    8    17        INIT_FCALL                                               'strpos'
         18        SEND_VAR                                                 !3
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $16     
         21        ASSIGN                                                   !4, $16
    9    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !4
         24        INIT_FCALL                                               'mb_substr'
         25        SEND_VAR                                                 !3
         26        SEND_VAR                                                 !4
         27        SEND_VAL                                                 1
         28        DO_ICALL                                         $18     
         29        SEND_VAR                                                 $18
         30        DO_ICALL                                                 
   10    31        TYPE_CHECK                                  1018          !4
         32      > JMPZ                                                     ~20, ->41
   11    33    >   INIT_FCALL                                               'trigger_error'
         34        ROPE_INIT                                     5  ~22     '%27'
         35        ROPE_ADD                                      1  ~22     ~22, !1
         36        ROPE_ADD                                      2  ~22     ~22, '%27+in+%27'
         37        ROPE_ADD                                      3  ~22     ~22, !3
         38        ROPE_END                                      4  ~21     ~22, '%27'
         39        SEND_VAL                                                 ~21
         40        DO_ICALL                                                 
   12    41    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.89 ms | 1396 KiB | 25 Q