3v4l.org

run code in 500+ PHP versions simultaneously
<?php /* Two identical strings: "®" (c2 ae). They are built at runtime because literals cannot get the flag. */ $plain = implode('', ["\xC2", "\xAE"]); $flagged = implode('', ["\xC2", "\xAE"]); var_dump(bin2hex(mb_str_split($plain)[0])); /* Marks $flagged as valid UTF-8 without changing its bytes */ mb_check_encoding($flagged, 'UTF-8'); /* DOCOMO writes "®" as ee 9c b6 */ var_dump(bin2hex(mb_substr($plain, 0, 1, 'UTF-8-Mobile#DOCOMO'))); var_dump(bin2hex(mb_substr($flagged, 0, 1, 'UTF-8-Mobile#DOCOMO'))); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0D7hG
function name:  (null)
number of ops:  43
compiled vars:  !0 = $plain, !1 = $flagged
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   FRAMELESS_ICALL_2                implode             ~2      '', <array>
          1        ASSIGN                                                       !0, ~2
    5     2        FRAMELESS_ICALL_2                implode             ~4      '', <array>
          3        ASSIGN                                                       !1, ~4
    7     4        INIT_FCALL                                                   'var_dump'
          5        INIT_FCALL                                                   'bin2hex'
          6        INIT_FCALL                                                   'mb_str_split'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                             $6      
          9        FETCH_DIM_R                                          ~7      $6, 0
         10        SEND_VAL                                                     ~7
         11        DO_ICALL                                             $8      
         12        SEND_VAR                                                     $8
         13        DO_ICALL                                                     
   10    14        INIT_FCALL                                                   'mb_check_encoding'
         15        SEND_VAR                                                     !1
         16        SEND_VAL                                                     'UTF-8'
         17        DO_ICALL                                                     
   13    18        INIT_FCALL                                                   'var_dump'
         19        INIT_FCALL                                                   'bin2hex'
         20        INIT_FCALL                                                   'mb_substr'
         21        SEND_VAR                                                     !0
         22        SEND_VAL                                                     0
         23        SEND_VAL                                                     1
         24        SEND_VAL                                                     'UTF-8-Mobile%23DOCOMO'
         25        DO_ICALL                                             $11     
         26        SEND_VAR                                                     $11
         27        DO_ICALL                                             $12     
         28        SEND_VAR                                                     $12
         29        DO_ICALL                                                     
   14    30        INIT_FCALL                                                   'var_dump'
         31        INIT_FCALL                                                   'bin2hex'
         32        INIT_FCALL                                                   'mb_substr'
         33        SEND_VAR                                                     !1
         34        SEND_VAL                                                     0
         35        SEND_VAL                                                     1
         36        SEND_VAL                                                     'UTF-8-Mobile%23DOCOMO'
         37        DO_ICALL                                             $14     
         38        SEND_VAR                                                     $14
         39        DO_ICALL                                             $15     
         40        SEND_VAR                                                     $15
         41        DO_ICALL                                                     
   16    42      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
134.91 ms | 487 KiB | 12 Q