3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const AB♥ = "alphabet"; } $rc = new ReflectionClass("Test"); $t = array_keys( $rc->getConstants())[0]; if ( mb_substr($t,-1,1,"utf-8") == "\xe2\x99\xa5" ) { var_dump($t,mb_substr($t,-1,1,"utf-8"), "\xe2\x99\xa5"); echo "heart: ",json_decode('"' . "\u2665" . '"'); //trigger_error("heart symbol is disallowed",E_USER_ERROR); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 35
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/QqOMi
function name:  (null)
number of ops:  36
compiled vars:  !0 = $rc, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'ReflectionClass'
          1        SEND_VAL_EX                                              'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    4     4        INIT_FCALL                                               'array_keys'
          5        INIT_METHOD_CALL                                         !0, 'getConstants'
          6        DO_FCALL                                      0  $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        FETCH_DIM_R                                      ~7      $6, 0
         10        ASSIGN                                                   !1, ~7
    5    11        INIT_FCALL                                               'mb_substr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 -1
         14        SEND_VAL                                                 1
         15        SEND_VAL                                                 'utf-8'
         16        DO_ICALL                                         $9      
         17        IS_EQUAL                                                 $9, '%E2%99%A5'
         18      > JMPZ                                                     ~10, ->35
    6    19    >   INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        INIT_FCALL                                               'mb_substr'
         22        SEND_VAR                                                 !1
         23        SEND_VAL                                                 -1
         24        SEND_VAL                                                 1
         25        SEND_VAL                                                 'utf-8'
         26        DO_ICALL                                         $11     
         27        SEND_VAR                                                 $11
         28        SEND_VAL                                                 '%E2%99%A5'
         29        DO_ICALL                                                 
    8    30        ECHO                                                     'heart%3A+'
         31        INIT_FCALL                                               'json_decode'
         32        SEND_VAL                                                 '%22%5Cu2665%22'
         33        DO_ICALL                                         $13     
         34        ECHO                                                     $13
   10    35    > > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.69 ms | 1396 KiB | 21 Q