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

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.01 ms | 1400 KiB | 25 Q