3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $const = array_keys( $rc->getConstants())[0]; // $substr = substr( $const, -1,1 ); $substr = mb_substr( $const, -1,1 ); // PHP 5.6 if ( $substr === "♥" ) { trigger_error("\"♥\" in \"$key\"" ); } // Notice: "♥" in "AB ♥" …
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/bJtfs
function name:  (null)
number of ops:  26
compiled vars:  !0 = $rc, !1 = $const, !2 = $substr, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    4     4        INIT_FCALL                                               'array_keys'
          5        INIT_METHOD_CALL                                         !0, 'getConstants'
          6        DO_FCALL                                      0  $7      
          7        SEND_VAR                                                 $7
          8        DO_ICALL                                         $8      
          9        FETCH_DIM_R                                      ~9      $8, 0
         10        ASSIGN                                                   !1, ~9
    6    11        INIT_FCALL                                               'mb_substr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 -1
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !2, $11
    7    17        IS_IDENTICAL                                             !2, '%E2%99%A5'
         18      > JMPZ                                                     ~13, ->25
    8    19    >   INIT_FCALL                                               'trigger_error'
         20        ROPE_INIT                                     3  ~15     '%22%E2%99%A5%22+in+%22'
         21        ROPE_ADD                                      1  ~15     ~15, !3
         22        ROPE_END                                      2  ~14     ~15, '%22'
         23        SEND_VAL                                                 ~14
         24        DO_ICALL                                                 
   10    25    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.42 ms | 1395 KiB | 19 Q