3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Use descriptive replacement mb_substitute_character('none'); $badAscii = 'Invalid input: ' . chr(0x81); print mb_convert_encoding($badAscii, 'UTF-8', 'ASCII'); print "\n"; $utf8 = 'UTF-8 that is not in ASCII: €'; print mb_convert_encoding($utf8, 'ASCII', 'UTF-8');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6D8tt
function name:  (null)
number of ops:  19
compiled vars:  !0 = $badAscii, !1 = $utf8
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'mb_substitute_character'
          1        SEND_VAL                                                 'none'
          2        DO_ICALL                                                 
    6     3        ASSIGN                                                   !0, 'Invalid+input%3A+%81'
    7     4        INIT_FCALL                                               'mb_convert_encoding'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'UTF-8'
          7        SEND_VAL                                                 'ASCII'
          8        DO_ICALL                                         $4      
          9        ECHO                                                     $4
    9    10        ECHO                                                     '%0A'
   11    11        ASSIGN                                                   !1, 'UTF-8+that+is+not+in+ASCII%3A+%E2%82%AC'
   12    12        INIT_FCALL                                               'mb_convert_encoding'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 'ASCII'
         15        SEND_VAL                                                 'UTF-8'
         16        DO_ICALL                                         $6      
         17        ECHO                                                     $6
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.59 ms | 1000 KiB | 15 Q