3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153 ms | 1395 KiB | 17 Q