3v4l.org

run code in 300+ PHP versions simultaneously
<?php $encodings = mb_list_encodings(); var_dump(count($encodings)); $results = []; foreach ($encodings as $encoding) { foreach (["\r", "\r\n"] as $string) { if (strlen($string) !== mb_strlen($string, $encoding)) { $results[] = [ 'encoding' => $encoding, 'char' => "\r" === $string ? '\r' : '\r\n', 'strlen' => strlen($string), 'mb_strlen' => mb_strlen($string, $encoding), ]; } } } print_r($results);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 38
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 38
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 36
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 36
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 35
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 35
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 36
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/sm3h1
function name:  (null)
number of ops:  43
compiled vars:  !0 = $encodings, !1 = $results, !2 = $encoding, !3 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'mb_list_encodings'
          1        DO_ICALL                                         $4      
          2        ASSIGN                                                   !0, $4
    4     3        INIT_FCALL                                               'var_dump'
          4        COUNT                                            ~6      !0
          5        SEND_VAL                                                 ~6
          6        DO_ICALL                                                 
    6     7        ASSIGN                                                   !1, <array>
    7     8      > FE_RESET_R                                       $9      !0, ->38
          9    > > FE_FETCH_R                                               $9, !2, ->38
    8    10    > > FE_RESET_R                                       $10     <array>, ->36
         11    > > FE_FETCH_R                                               $10, !3, ->36
    9    12    >   STRLEN                                           ~11     !3
         13        INIT_FCALL                                               'mb_strlen'
         14        SEND_VAR                                                 !3
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        IS_NOT_IDENTICAL                                         $12, ~11
         18      > JMPZ                                                     ~13, ->35
   11    19    >   INIT_ARRAY                                       ~15     !2, 'encoding'
   12    20        IS_IDENTICAL                                             !3, '%0D'
         21      > JMPZ                                                     ~16, ->24
         22    >   QM_ASSIGN                                        ~17     '%5Cr'
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~17     '%5Cr%5Cn'
         25    >   ADD_ARRAY_ELEMENT                                ~15     ~17, 'char'
   13    26        STRLEN                                           ~18     !3
         27        ADD_ARRAY_ELEMENT                                ~15     ~18, 'strlen'
   14    28        INIT_FCALL                                               'mb_strlen'
         29        SEND_VAR                                                 !3
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                         $19     
         32        ADD_ARRAY_ELEMENT                                ~15     $19, 'mb_strlen'
   10    33        ASSIGN_DIM                                               !1
   14    34        OP_DATA                                                  ~15
    8    35    > > JMP                                                      ->11
         36    >   FE_FREE                                                  $10
    7    37      > JMP                                                      ->9
         38    >   FE_FREE                                                  $9
   20    39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !1
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.89 ms | 1400 KiB | 21 Q