3v4l.org

run code in 300+ PHP versions simultaneously
<?php $urlKey = 'ftrcvgbhnjk-2000-4628-20.html'; $oldUrlKey = null; if (preg_match('/^.*-[0-9]+(-[0-9]+)\.html$/', $urlKey, $matches)) { $oldUrlKey = str_replace($matches[1], '', $urlKey); $index[$oldUrlKey] = '----'; } var_dump($matches); echo $oldUrlKey;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/PmhsX
function name:  (null)
number of ops:  22
compiled vars:  !0 = $urlKey, !1 = $oldUrlKey, !2 = $matches, !3 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'ftrcvgbhnjk-2000-4628-20.html'
    3     1        ASSIGN                                                   !1, null
    4     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%5E.%2A-%5B0-9%5D%2B%28-%5B0-9%5D%2B%29%5C.html%24%2F'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $6      
          7      > JMPZ                                                     $6, ->17
    5     8    >   INIT_FCALL                                               'str_replace'
          9        FETCH_DIM_R                                      ~7      !2, 1
         10        SEND_VAL                                                 ~7
         11        SEND_VAL                                                 ''
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
    6    15        ASSIGN_DIM                                               !3, !1
         16        OP_DATA                                                  '----'
    8    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
    9    20        ECHO                                                     !1
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.7 ms | 1395 KiB | 19 Q