3v4l.org

run code in 300+ PHP versions simultaneously
<?php $boms = array("\xef\xbf\xbe" => '', "\xef\xbf\xbf" => '',); $array = array( "BOMがマルチバイト文字に分断されたもの"=>"あ\xefい\xbf\xbeう\xef\xbfえ\xbfお", "制御文字でBOMが分断されたもの" => "あい\xef\xbf\x07\xbeう\xef\x1f\xbf\xbfえお", "U+FFFE" => "\xef\xbf\xbe", "U+FFFF" => "\xef\xbf\xbf", "1バイト" => "\xef", "2バイト" => "\xef\xbf", "おしい" => "\xef\xbf\x6a" ); foreach($array as $key => $str) { echo $key . " "; echo var_dump(strpos($str, key($boms))); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/0parn
function name:  (null)
number of ops:  21
compiled vars:  !0 = $boms, !1 = $array, !2 = $str, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
   14     2      > FE_RESET_R                                       $6      !1, ->19
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->19
          4    >   ASSIGN                                                   !3, ~7
   15     5        CONCAT                                           ~9      !3, '+'
          6        ECHO                                                     ~9
   16     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !2
         10        INIT_FCALL                                               'key'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $10     
         13        SEND_VAR                                                 $10
         14        DO_ICALL                                         $11     
         15        SEND_VAR                                                 $11
         16        DO_ICALL                                         $12     
         17        ECHO                                                     $12
   14    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $6
   17    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.77 ms | 1399 KiB | 19 Q