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"]); /* 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/Q8OB3
function name:  (null)
number of ops:  33
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
    8     4        INIT_FCALL                                                   'mb_check_encoding'
          5        SEND_VAR                                                     !1
          6        SEND_VAL                                                     'UTF-8'
          7        DO_ICALL                                                     
   11     8        INIT_FCALL                                                   'var_dump'
          9        INIT_FCALL                                                   'bin2hex'
         10        INIT_FCALL                                                   'mb_substr'
         11        SEND_VAR                                                     !0
         12        SEND_VAL                                                     0
         13        SEND_VAL                                                     1
         14        SEND_VAL                                                     'UTF-8-Mobile%23DOCOMO'
         15        DO_ICALL                                             $7      
         16        SEND_VAR                                                     $7
         17        DO_ICALL                                             $8      
         18        SEND_VAR                                                     $8
         19        DO_ICALL                                                     
   12    20        INIT_FCALL                                                   'var_dump'
         21        INIT_FCALL                                                   'bin2hex'
         22        INIT_FCALL                                                   'mb_substr'
         23        SEND_VAR                                                     !1
         24        SEND_VAL                                                     0
         25        SEND_VAL                                                     1
         26        SEND_VAL                                                     'UTF-8-Mobile%23DOCOMO'
         27        DO_ICALL                                             $10     
         28        SEND_VAR                                                     $10
         29        DO_ICALL                                             $11     
         30        SEND_VAR                                                     $11
         31        DO_ICALL                                                     
   14    32      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.81 ms | 482 KiB | 11 Q