3v4l.org

run code in 300+ PHP versions simultaneously
<?php $amount = 5; $stuff = '<div><div class="rev_slider_2_2_wrapper"></div><i id="rev_slider_2_2_wrapper"></i></div>'; $stuff = preg_replace( "/rev_slider_(\d+)_(\d+)_wrapper/i", "rev_slider_$1_{$amount}", $stuff ); print_r( $stuff );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gJOtI
function name:  (null)
number of ops:  14
compiled vars:  !0 = $amount, !1 = $stuff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    5     1        ASSIGN                                                   !1, '%3Cdiv%3E%3Cdiv+class%3D%22rev_slider_2_2_wrapper%22%3E%3C%2Fdiv%3E%3Ci+id%3D%22rev_slider_2_2_wrapper%22%3E%3C%2Fi%3E%3C%2Fdiv%3E'
    7     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2Frev_slider_%28%5Cd%2B%29_%28%5Cd%2B%29_wrapper%2Fi'
          4        NOP                                                      
          5        FAST_CONCAT                                      ~4      'rev_slider_%241_', !0
          6        SEND_VAL                                                 ~4
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        ASSIGN                                                   !1, $5
    9    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168 ms | 1398 KiB | 17 Q