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 = substr_replace($urlKey, '', strrpos($urlKey, $matches[1]), strlen($matches[1])); $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 = 24
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/pLGRH
function name:  (null)
number of ops:  29
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, ->24
    5     8    >   INIT_FCALL                                               'substr_replace'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 ''
         11        INIT_FCALL                                               'strrpos'
         12        SEND_VAR                                                 !0
         13        FETCH_DIM_R                                      ~7      !2, 1
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
         17        FETCH_DIM_R                                      ~9      !2, 1
         18        STRLEN                                           ~10     ~9
         19        SEND_VAL                                                 ~10
         20        DO_ICALL                                         $11     
         21        ASSIGN                                                   !1, $11
    6    22        ASSIGN_DIM                                               !3, !1
         23        OP_DATA                                                  '----'
    8    24    >   INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                                 
    9    27        ECHO                                                     !1
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.59 ms | 1387 KiB | 21 Q