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 ); $substr = substr( $target, $pos,1 ); // 5.6 if ( $substr === $bad ) { trigger_error( "'$bad' in '$target'" ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 34
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/qY1CA
function name:  (null)
number of ops:  35
compiled vars:  !0 = $rc, !1 = $bad, !2 = $key, !3 = $target, !4 = $pos, !5 = $substr
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'
    6     5        INIT_FCALL                                               'array_keys'
          6        INIT_METHOD_CALL                                         !0, 'getConstants'
          7        DO_FCALL                                      0  $10     
          8        SEND_VAR                                                 $10
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !2, $11
    7    11        FETCH_DIM_R                                      ~13     !2, 0
         12        ASSIGN                                                   !3, ~13
    8    13        INIT_FCALL                                               'strpos'
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $15     
         17        ASSIGN                                                   !4, $15
    9    18        INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !3
         20        SEND_VAR                                                 !4
         21        SEND_VAL                                                 1
         22        DO_ICALL                                         $17     
         23        ASSIGN                                                   !5, $17
   10    24        IS_IDENTICAL                                             !5, !1
         25      > JMPZ                                                     ~19, ->34
   11    26    >   INIT_FCALL                                               'trigger_error'
         27        ROPE_INIT                                     5  ~21     '%27'
         28        ROPE_ADD                                      1  ~21     ~21, !1
         29        ROPE_ADD                                      2  ~21     ~21, '%27+in+%27'
         30        ROPE_ADD                                      3  ~21     ~21, !3
         31        ROPE_END                                      4  ~20     ~21, '%27'
         32        SEND_VAL                                                 ~20
         33        DO_ICALL                                                 
   12    34    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 937 KiB | 22 Q