3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '21-11-2016'; $pattern = '/(\d{2})-(\d{2})-(\d{4})/'; $rep = "Month: $2 , Day: $1 , Year: $3"; echo preg_replace($pattern, $rep, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYhvB
function name:  (null)
number of ops:  10
compiled vars:  !0 = $string, !1 = $pattern, !2 = $rep
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '21-11-2016'
    4     1        ASSIGN                                                   !1, '%2F%28%5Cd%7B2%7D%29-%28%5Cd%7B2%7D%29-%28%5Cd%7B4%7D%29%2F'
    5     2        ASSIGN                                                   !2, 'Month%3A+%242+%2C+Day%3A+%241+%2C+Year%3A+%243'
    6     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ECHO                                                     $6
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.11 ms | 1009 KiB | 14 Q