3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const ABC♥ = "alphabet"; } $class = new ReflectionClass("Test"); $bad_char = "♥"; $constants = $class->getConstants(); $keys = array_keys($constants); for ( $i=0, $ct=count($keys); $i < $ct; $i++) { $target = $keys[ $i ]; if ( strpos( $target, $bad_char) !== false ) { var_dump(substr($bad_char,0,1)); var_dump(mb_substr($bad_char,0,1)); trigger_error( "'$bad_char' in '$target'" ); }}
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 16
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 48
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 16
Branch analysis from position: 51
Branch analysis from position: 16
Branch analysis from position: 48
filename:       /in/b3RTP
function name:  (null)
number of ops:  52
compiled vars:  !0 = $class, !1 = $bad_char, !2 = $constants, !3 = $keys, !4 = $i, !5 = $ct, !6 = $target
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_METHOD_CALL                                         !0, 'getConstants'
          6        DO_FCALL                                      0  $11     
          7        ASSIGN                                                   !2, $11
    6     8        INIT_FCALL                                               'array_keys'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $13     
         11        ASSIGN                                                   !3, $13
    7    12        ASSIGN                                                   !4, 0
         13        COUNT                                            ~16     !3
         14        ASSIGN                                                   !5, ~16
         15      > JMP                                                      ->49
    8    16    >   FETCH_DIM_R                                      ~18     !3, !4
         17        ASSIGN                                                   !6, ~18
    9    18        INIT_FCALL                                               'strpos'
         19        SEND_VAR                                                 !6
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $20     
         22        TYPE_CHECK                                  1018          $20
         23      > JMPZ                                                     ~21, ->48
   10    24    >   INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'substr'
         26        SEND_VAR                                                 !1
         27        SEND_VAL                                                 0
         28        SEND_VAL                                                 1
         29        DO_ICALL                                         $22     
         30        SEND_VAR                                                 $22
         31        DO_ICALL                                                 
   11    32        INIT_FCALL                                               'var_dump'
         33        INIT_FCALL                                               'mb_substr'
         34        SEND_VAR                                                 !1
         35        SEND_VAL                                                 0
         36        SEND_VAL                                                 1
         37        DO_ICALL                                         $24     
         38        SEND_VAR                                                 $24
         39        DO_ICALL                                                 
   12    40        INIT_FCALL                                               'trigger_error'
         41        ROPE_INIT                                     5  ~27     '%27'
         42        ROPE_ADD                                      1  ~27     ~27, !1
         43        ROPE_ADD                                      2  ~27     ~27, '%27+in+%27'
         44        ROPE_ADD                                      3  ~27     ~27, !6
         45        ROPE_END                                      4  ~26     ~27, '%27'
         46        SEND_VAL                                                 ~26
         47        DO_ICALL                                                 
    7    48    >   PRE_INC                                                  !4
         49    >   IS_SMALLER                                               !4, !5
         50      > JMPNZ                                                    ~32, ->16
   13    51    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.21 ms | 1400 KiB | 25 Q