3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $bad = "♥"; //$bad = chr(0xe2); $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 = 29, Position 2 = 37
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/nQUsu
function name:  (null)
number of ops:  38
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
    4     4        ASSIGN                                                   !1, '%E2%99%A5'
    6     5        INIT_FCALL                                               'array_keys'
          6        INIT_METHOD_CALL                                         !0, 'getConstants'
          7        DO_FCALL                                      0  $9      
          8        SEND_VAR                                                 $9
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !2, $10
    7    11        FETCH_DIM_R                                      ~12     !2, 0
         12        ASSIGN                                                   !3, ~12
    8    13        INIT_FCALL                                               'strpos'
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $14     
         17        ASSIGN                                                   !4, $14
    9    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !4
         20        INIT_FCALL                                               'mb_substr'
         21        SEND_VAR                                                 !3
         22        SEND_VAR                                                 !4
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $16     
         25        SEND_VAR                                                 $16
         26        DO_ICALL                                                 
   10    27        TYPE_CHECK                                  1018          !4
         28      > JMPZ                                                     ~18, ->37
   11    29    >   INIT_FCALL                                               'trigger_error'
         30        ROPE_INIT                                     5  ~20     '%27'
         31        ROPE_ADD                                      1  ~20     ~20, !1
         32        ROPE_ADD                                      2  ~20     ~20, '%27+in+%27'
         33        ROPE_ADD                                      3  ~20     ~20, !3
         34        ROPE_END                                      4  ~19     ~20, '%27'
         35        SEND_VAL                                                 ~19
         36        DO_ICALL                                                 
   12    37    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.3 ms | 1396 KiB | 23 Q