3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text = 'a container_ids="4" resp. container_ids="777"'; $nahrada = preg_replace_callback('~(container_ids=")(\d+)(")~', function ($matches) { return $matches[1] . ($matches[2] + 10) . $matches[3]; }, $text); var_dump($nahrada);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/At0TP
function name:  (null)
number of ops:  12
compiled vars:  !0 = $text, !1 = $nahrada
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'a+container_ids%3D%224%22+resp.+container_ids%3D%22777%22'
    4     1        INIT_FCALL                                                   'preg_replace_callback'
          2        SEND_VAL                                                     '%7E%28container_ids%3D%22%29%28%5Cd%2B%29%28%22%29%7E'
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
    6     4        SEND_VAL                                                     ~3
          5        SEND_VAR                                                     !0
    4     6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !1, $4
    7     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                                     
         11      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/At0TP
function name:  {closure:/in/At0TP:4}
number of ops:  9
compiled vars:  !0 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        FETCH_DIM_R                                          ~1      !0, 1
          2        FETCH_DIM_R                                          ~2      !0, 2
          3        ADD                                                  ~3      ~2, 10
          4        CONCAT                                               ~4      ~1, ~3
          5        FETCH_DIM_R                                          ~5      !0, 3
          6        CONCAT                                               ~6      ~4, ~5
          7      > RETURN                                                       ~6
    6     8*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.28 ms | 1536 KiB | 10 Q