3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (preg_match('/-([0-9]+)$/', "asd-1132", $matches) === 1) { $num = (int) $matches[1]; print preg_replace('/-([0-9]+)$/', "-$1"."asd", "asd-1132"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/tV22D
function name:  (null)
number of ops:  17
compiled vars:  !0 = $matches, !1 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'preg_match'
          1        SEND_VAL                                                 '%2F-%28%5B0-9%5D%2B%29%24%2F'
          2        SEND_VAL                                                 'asd-1132'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                         $2      
          5        IS_IDENTICAL                                             $2, 1
          6      > JMPZ                                                     ~3, ->16
    4     7    >   FETCH_DIM_R                                      ~4      !0, 1
          8        CAST                                          4  ~5      ~4
          9        ASSIGN                                                   !1, ~5
    5    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F-%28%5B0-9%5D%2B%29%24%2F'
         12        SEND_VAL                                                 '-%241asd'
         13        SEND_VAL                                                 'asd-1132'
         14        DO_ICALL                                         $7      
         15        ECHO                                                     $7
    6    16    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.42 ms | 1394 KiB | 17 Q