3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export(preg_split('~..\K~', 'abcdefghijklm', 3)); echo "\n---\n"; var_export([preg_replace('~..\K~','*', 'abcdefghijklm', 3, $count1), $count1]); echo "\n---\n"; var_export([preg_filter('~..\K~', '*', 'abcdefghijklm', 3, $count2), $count2]); echo "\n---\n"; var_export(preg_grep('~..\K~', ['abc', 'def', 'ghi', 'jklm'])); echo "\n---\n"; var_export(preg_match_all('~(..)\K~', 'abcdefghijklm', $m1) ? $m1 : null); echo "\n---\n"; var_export(preg_match_all('~..\K~', 'abcdefghijklm', $m2) ? $m2 : null);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 65
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 65
Branch analysis from position: 63
Branch analysis from position: 65
filename:       /in/6EvPV
function name:  (null)
number of ops:  69
compiled vars:  !0 = $count1, !1 = $count2, !2 = $m1, !3 = $m2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%7E..%5CK%7E'
          3        SEND_VAL                                                 'abcdefghijklm'
          4        SEND_VAL                                                 3
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
    5     8        ECHO                                                     '%0A---%0A'
    7     9        INIT_FCALL                                               'var_export'
         10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%7E..%5CK%7E'
         12        SEND_VAL                                                 '%2A'
         13        SEND_VAL                                                 'abcdefghijklm'
         14        SEND_VAL                                                 3
         15        SEND_REF                                                 !0
         16        DO_ICALL                                         $6      
         17        INIT_ARRAY                                       ~7      $6
         18        ADD_ARRAY_ELEMENT                                ~7      !0
         19        SEND_VAL                                                 ~7
         20        DO_ICALL                                                 
    9    21        ECHO                                                     '%0A---%0A'
   11    22        INIT_FCALL                                               'var_export'
         23        INIT_FCALL                                               'preg_filter'
         24        SEND_VAL                                                 '%7E..%5CK%7E'
         25        SEND_VAL                                                 '%2A'
         26        SEND_VAL                                                 'abcdefghijklm'
         27        SEND_VAL                                                 3
         28        SEND_REF                                                 !1
         29        DO_ICALL                                         $9      
         30        INIT_ARRAY                                       ~10     $9
         31        ADD_ARRAY_ELEMENT                                ~10     !1
         32        SEND_VAL                                                 ~10
         33        DO_ICALL                                                 
   13    34        ECHO                                                     '%0A---%0A'
   15    35        INIT_FCALL                                               'var_export'
         36        INIT_FCALL                                               'preg_grep'
         37        SEND_VAL                                                 '%7E..%5CK%7E'
         38        SEND_VAL                                                 <array>
         39        DO_ICALL                                         $12     
         40        SEND_VAR                                                 $12
         41        DO_ICALL                                                 
   17    42        ECHO                                                     '%0A---%0A'
   19    43        INIT_FCALL                                               'var_export'
         44        INIT_FCALL                                               'preg_match_all'
         45        SEND_VAL                                                 '%7E%28..%29%5CK%7E'
         46        SEND_VAL                                                 'abcdefghijklm'
         47        SEND_REF                                                 !2
         48        DO_ICALL                                         $14     
         49      > JMPZ                                                     $14, ->52
         50    >   QM_ASSIGN                                        ~15     !2
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~15     null
         53    >   SEND_VAL                                                 ~15
         54        DO_ICALL                                                 
   20    55        ECHO                                                     '%0A---%0A'
   22    56        INIT_FCALL                                               'var_export'
         57        INIT_FCALL                                               'preg_match_all'
         58        SEND_VAL                                                 '%7E..%5CK%7E'
         59        SEND_VAL                                                 'abcdefghijklm'
         60        SEND_REF                                                 !3
         61        DO_ICALL                                         $17     
         62      > JMPZ                                                     $17, ->65
         63    >   QM_ASSIGN                                        ~18     !3
         64      > JMP                                                      ->66
         65    >   QM_ASSIGN                                        ~18     null
         66    >   SEND_VAL                                                 ~18
         67        DO_ICALL                                                 
         68      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.67 ms | 1008 KiB | 19 Q