3v4l.org

run code in 300+ PHP versions simultaneously
<?php $examples = [ 'Sep 04-08', 'Sep 29-Oct 01', ]; $result = []; foreach ($examples as $example) { var_export( explode('-', preg_replace('/^(\D{4})\d{2}-\K(?=\d)/', '$1', $example)) ); echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/scfSF
function name:  (null)
number of ops:  20
compiled vars:  !0 = $examples, !1 = $result, !2 = $example
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
    9     2      > FE_RESET_R                                       $5      !0, ->18
          3    > > FE_FETCH_R                                               $5, !2, ->18
   10     4    >   INIT_FCALL                                               'var_export'
   11     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '-'
          7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAL                                                 '%2F%5E%28%5CD%7B4%7D%29%5Cd%7B2%7D-%5CK%28%3F%3D%5Cd%29%2F'
          9        SEND_VAL                                                 '%241'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                                 
   13    16        ECHO                                                     '%0A'
    9    17      > JMP                                                      ->3
         18    >   FE_FREE                                                  $5
   14    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.12 ms | 1395 KiB | 19 Q