3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'abc-def/something/else/', 'abc-def-2019/something/else/', 'abc-def-2019-2020/something/else/', 'abc-def-125-2019/something/else/' ]; var_export( preg_replace('~^(?:[a-z\d]+-?)*?(?:/|(?=20\d{2}-?){1,2})~', '', $tests) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/INSHr
function name:  (null)
number of ops:  10
compiled vars:  !0 = $tests
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'var_export'
   10     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%7E%5E%28%3F%3A%5Ba-z%5Cd%5D%2B-%3F%29%2A%3F%28%3F%3A%2F%7C%28%3F%3D20%5Cd%7B2%7D-%3F%29%7B1%2C2%7D%29%7E'
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
    9     8        DO_ICALL                                                 
   11     9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.66 ms | 997 KiB | 15 Q