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]+)$/', "-$num"."asd", "asd-1132"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/fFaLf
function name:  (null)
number of ops:  20
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, ->19
    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        NOP                                                      
         13        FAST_CONCAT                                      ~7      '-', !1
         14        CONCAT                                           ~8      ~7, 'asd'
         15        SEND_VAL                                                 ~8
         16        SEND_VAL                                                 'asd-1132'
         17        DO_ICALL                                         $9      
         18        ECHO                                                     $9
    6    19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.45 ms | 1395 KiB | 17 Q