3v4l.org

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

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
253.28 ms | 1400 KiB | 24 Q