3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '$£%wow!😮'; echo 'No mb: ' . strlen($string) . PHP_EOL; echo 'With mb: ' . mb_strlen($string) . PHP_EOL; $chrArray = preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY); foreach ($chrArray as $chr) { echo $chr . ' ' . strlen($chr) . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/1h4Ui
function name:  (null)
number of ops:  28
compiled vars:  !0 = $string, !1 = $chrArray, !2 = $chr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%24%C2%A3%25wow%21%F0%9F%98%AE'
    5     1        STRLEN                                           ~4      !0
          2        CONCAT                                           ~5      'No+mb%3A+', ~4
          3        CONCAT                                           ~6      ~5, '%0A'
          4        ECHO                                                     ~6
    6     5        INIT_FCALL                                               'mb_strlen'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        CONCAT                                           ~8      'With+mb%3A+', $7
          9        CONCAT                                           ~9      ~8, '%0A'
         10        ECHO                                                     ~9
    8    11        INIT_FCALL                                               'preg_split'
         12        SEND_VAL                                                 '%2F%2Fu'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 -1
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !1, $10
    9    18      > FE_RESET_R                                       $12     !1, ->26
         19    > > FE_FETCH_R                                               $12, !2, ->26
   10    20    >   CONCAT                                           ~13     !2, '+'
         21        STRLEN                                           ~14     !2
         22        CONCAT                                           ~15     ~13, ~14
         23        CONCAT                                           ~16     ~15, '%0A'
         24        ECHO                                                     ~16
    9    25      > JMP                                                      ->19
         26    >   FE_FREE                                                  $12
   11    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.21 ms | 1461 KiB | 15 Q