3v4l.org

run code in 500+ 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:  7
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        FRAMELESS_ICALL_3                preg_replace        ~2      '%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', ''
          3        OP_DATA                                                      !0
          4        SEND_VAL                                                     ~2
    9     5        DO_ICALL                                                     
   11     6      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.47 ms | 2098 KiB | 14 Q