3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='先秦兩漢'; var_export(preg_split('~~u', $string, 0, PREG_SPLIT_NO_EMPTY)); echo "\n---\n"; var_export(preg_split('~\X\K~u', $string, 0, PREG_SPLIT_NO_EMPTY)); echo "\n---\n"; var_export(preg_split('~\X\K(?!$)~u', $string)); echo "\n---\n"; var_export(mb_split('\X\K(?!$)', $string)); echo "\n---\n"; var_export(preg_match_all('~\X~u', $string, $out) ? $out[0] : []);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lEeLG
function name:  (null)
number of ops:  51
compiled vars:  !0 = $string, !1 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%E5%85%88%E7%A7%A6%E5%85%A9%E6%BC%A2'
    3     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'preg_split'
          3        SEND_VAL                                                 '%7E%7Eu'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
    4    10        ECHO                                                     '%0A---%0A'
    5    11        INIT_FCALL                                               'var_export'
         12        INIT_FCALL                                               'preg_split'
         13        SEND_VAL                                                 '%7E%5CX%5CK%7Eu'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $5      
         18        SEND_VAR                                                 $5
         19        DO_ICALL                                                 
    6    20        ECHO                                                     '%0A---%0A'
    7    21        INIT_FCALL                                               'var_export'
         22        INIT_FCALL                                               'preg_split'
         23        SEND_VAL                                                 '%7E%5CX%5CK%28%3F%21%24%29%7Eu'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $7      
         26        SEND_VAR                                                 $7
         27        DO_ICALL                                                 
    8    28        ECHO                                                     '%0A---%0A'
    9    29        INIT_FCALL                                               'var_export'
         30        INIT_FCALL                                               'mb_split'
         31        SEND_VAL                                                 '%5CX%5CK%28%3F%21%24%29'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                         $9      
         34        SEND_VAR                                                 $9
         35        DO_ICALL                                                 
   10    36        ECHO                                                     '%0A---%0A'
   11    37        INIT_FCALL                                               'var_export'
         38        INIT_FCALL                                               'preg_match_all'
         39        SEND_VAL                                                 '%7E%5CX%7Eu'
         40        SEND_VAR                                                 !0
         41        SEND_REF                                                 !1
         42        DO_ICALL                                         $11     
         43      > JMPZ                                                     $11, ->47
         44    >   FETCH_DIM_R                                      ~12     !1, 0
         45        QM_ASSIGN                                        ~13     ~12
         46      > JMP                                                      ->48
         47    >   QM_ASSIGN                                        ~13     <array>
         48    >   SEND_VAL                                                 ~13
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.36 ms | 1445 KiB | 17 Q