3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export(preg_split('~.{3}\K~', 'abcdefghijklm', 3)); echo "\n---\n"; var_export([preg_replace('~.{3}\K~','*', 'abcdefghijklm', 3, $count1), $count1]); echo "\n---\n"; var_export([preg_filter('~.{3}\K~', '*', 'abcdefghijklm', 3, $count2), $count2]); echo "\n---\n"; var_export(preg_grep('~.{3}\K~', ['abcdef', 'ghijklm'])); echo "\n---\n"; var_export(preg_match_all('~(.{3})\K~', 'abcdefghijklm', $m1) ? $m1 : null); echo "\n---\n"; var_export(preg_match_all('~.{3}\K~', 'abcdefghijklm', $m2) ? $m2 : null); echo "\n---\n"; var_export([preg_replace_callback('~.{3}\K~', function() { return '*'; }, 'abcdefghijklm', 3, $count3), $count3]);
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/kQHQZ
function name:  (null)
number of ops:  83
compiled vars:  !0 = $count1, !1 = $count2, !2 = $m1, !3 = $m2, !4 = $count3
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.%7B3%7D%5CK%7E'
          3        SEND_VAL                                                 'abcdefghijklm'
          4        SEND_VAL                                                 3
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                                 
    5     8        ECHO                                                     '%0A---%0A'
    7     9        INIT_FCALL                                               'var_export'
         10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%7E.%7B3%7D%5CK%7E'
         12        SEND_VAL                                                 '%2A'
         13        SEND_VAL                                                 'abcdefghijklm'
         14        SEND_VAL                                                 3
         15        SEND_REF                                                 !0
         16        DO_ICALL                                         $7      
         17        INIT_ARRAY                                       ~8      $7
         18        ADD_ARRAY_ELEMENT                                ~8      !0
         19        SEND_VAL                                                 ~8
         20        DO_ICALL                                                 
    9    21        ECHO                                                     '%0A---%0A'
   11    22        INIT_FCALL                                               'var_export'
         23        INIT_FCALL                                               'preg_filter'
         24        SEND_VAL                                                 '%7E.%7B3%7D%5CK%7E'
         25        SEND_VAL                                                 '%2A'
         26        SEND_VAL                                                 'abcdefghijklm'
         27        SEND_VAL                                                 3
         28        SEND_REF                                                 !1
         29        DO_ICALL                                         $10     
         30        INIT_ARRAY                                       ~11     $10
         31        ADD_ARRAY_ELEMENT                                ~11     !1
         32        SEND_VAL                                                 ~11
         33        DO_ICALL                                                 
   13    34        ECHO                                                     '%0A---%0A'
   15    35        INIT_FCALL                                               'var_export'
         36        INIT_FCALL                                               'preg_grep'
         37        SEND_VAL                                                 '%7E.%7B3%7D%5CK%7E'
         38        SEND_VAL                                                 <array>
         39        DO_ICALL                                         $13     
         40        SEND_VAR                                                 $13
         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.%7B3%7D%29%5CK%7E'
         46        SEND_VAL                                                 'abcdefghijklm'
         47        SEND_REF                                                 !2
         48        DO_ICALL                                         $15     
         49      > JMPZ                                                     $15, ->52
         50    >   QM_ASSIGN                                        ~16     !2
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~16     null
         53    >   SEND_VAL                                                 ~16
         54        DO_ICALL                                                 
   21    55        ECHO                                                     '%0A---%0A'
   23    56        INIT_FCALL                                               'var_export'
         57        INIT_FCALL                                               'preg_match_all'
         58        SEND_VAL                                                 '%7E.%7B3%7D%5CK%7E'
         59        SEND_VAL                                                 'abcdefghijklm'
         60        SEND_REF                                                 !3
         61        DO_ICALL                                         $18     
         62      > JMPZ                                                     $18, ->65
         63    >   QM_ASSIGN                                        ~19     !3
         64      > JMP                                                      ->66
         65    >   QM_ASSIGN                                        ~19     null
         66    >   SEND_VAL                                                 ~19
         67        DO_ICALL                                                 
   25    68        ECHO                                                     '%0A---%0A'
   27    69        INIT_FCALL                                               'var_export'
         70        INIT_FCALL                                               'preg_replace_callback'
         71        SEND_VAL                                                 '%7E.%7B3%7D%5CK%7E'
         72        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkQHQZ%3A27%240'
         73        SEND_VAL                                                 ~21
         74        SEND_VAL                                                 'abcdefghijklm'
         75        SEND_VAL                                                 3
         76        SEND_REF                                                 !4
         77        DO_ICALL                                         $22     
         78        INIT_ARRAY                                       ~23     $22
         79        ADD_ARRAY_ELEMENT                                ~23     !4
         80        SEND_VAL                                                 ~23
         81        DO_ICALL                                                 
         82      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FkQHQZ%3A27%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kQHQZ
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E > > RETURN                                                   '%2A'
          1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FkQHQZ%3A27%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.77 ms | 949 KiB | 28 Q