3v4l.org

run code in 300+ PHP versions simultaneously
<?php $examples = array( 'Valid ASCII' => "a", 'Valid 2 Octet Sequence' => "\xc3\xb1", 'Invalid 2 Octet Sequence' => "\xc3\x28", 'Invalid Sequence Identifier' => "\xa0\xa1", 'Valid 3 Octet Sequence' => "\xe2\x82\xa1", 'Invalid 3 Octet Sequence (in 2nd Octet)' => "\xe2\x28\xa1", 'Invalid 3 Octet Sequence (in 3rd Octet)' => "\xe2\x82\x28", 'Valid 4 Octet Sequence' => "\xf0\x90\x8c\xbc", 'Invalid 4 Octet Sequence (in 2nd Octet)' => "\xf0\x28\x8c\xbc", 'Invalid 4 Octet Sequence (in 3rd Octet)' => "\xf0\x90\x28\xbc", 'Invalid 4 Octet Sequence (in 4th Octet)' => "\xf0\x28\x8c\x28", 'Valid 5 Octet Sequence (but not Unicode!)' => "\xf8\xa1\xa1\xa1\xa1", 'Valid 6 Octet Sequence (but not Unicode!)' => "\xfc\xa1\xa1\xa1\xa1\xa1", ); mb_substitute_character(0x3013); foreach ($examples as $k => $v) { echo "{$k}\n"; echo 'raw: ' . $v . '\n'; echo 'default: ' . mb_convert_encoding($v, 'UTF-8', 'UTF-8') . '\n'; echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 23
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 23
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/GioPv
function name:  (null)
number of ops:  25
compiled vars:  !0 = $examples, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        INIT_FCALL                                               'mb_substitute_character'
          2        SEND_VAL                                                 12307
          3        DO_ICALL                                                 
   22     4      > FE_RESET_R                                       $5      !0, ->23
          5    > > FE_FETCH_R                                       ~6      $5, !1, ->23
          6    >   ASSIGN                                                   !2, ~6
   24     7        NOP                                                      
          8        FAST_CONCAT                                      ~8      !2, '%0A'
          9        ECHO                                                     ~8
   25    10        CONCAT                                           ~9      'raw%3A+', !1
         11        CONCAT                                           ~10     ~9, '%5Cn'
         12        ECHO                                                     ~10
   26    13        INIT_FCALL                                               'mb_convert_encoding'
         14        SEND_VAR                                                 !1
         15        SEND_VAL                                                 'UTF-8'
         16        SEND_VAL                                                 'UTF-8'
         17        DO_ICALL                                         $11     
         18        CONCAT                                           ~12     'default%3A+', $11
         19        CONCAT                                           ~13     ~12, '%5Cn'
         20        ECHO                                                     ~13
   27    21        ECHO                                                     '%0A'
   22    22      > JMP                                                      ->5
         23    >   FE_FREE                                                  $5
   29    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.41 ms | 1387 KiB | 17 Q