3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Lorem ipsum random_5ac18d179707d dolor random_5ac18d179707d sit amet, consectetur random_5ac18decebd4e adipiscing elit. random_5ac18d179707d"; preg_match_all('~random_(\w+)~', $string, $m); echo strtr($string, array_combine($s = array_unique($m[1]), range(1, count($s))));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ARunK
function name:  (null)
number of ops:  26
compiled vars:  !0 = $string, !1 = $m, !2 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Lorem+ipsum+random_5ac18d179707d+dolor+random_5ac18d179707d+sit+amet%2C+consectetur+random_5ac18decebd4e+adipiscing+elit.+random_5ac18d179707d'
    5     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%7Erandom_%28%5Cw%2B%29%7E'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    6     6        INIT_FCALL                                               'strtr'
          7        SEND_VAR                                                 !0
          8        INIT_FCALL                                               'array_combine'
          9        INIT_FCALL                                               'array_unique'
         10        FETCH_DIM_R                                      ~5      !1, 1
         11        SEND_VAL                                                 ~5
         12        DO_ICALL                                         $6      
         13        ASSIGN                                           ~7      !2, $6
         14        SEND_VAL                                                 ~7
         15        INIT_FCALL                                               'range'
         16        SEND_VAL                                                 1
         17        COUNT                                            ~8      !2
         18        SEND_VAL                                                 ~8
         19        DO_ICALL                                         $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                         $10     
         22        SEND_VAR                                                 $10
         23        DO_ICALL                                         $11     
         24        ECHO                                                     $11
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.87 ms | 1015 KiB | 18 Q