3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = "Legend Of Zelda"; $array = array("to","of","at"); echo preg_replace_callback('~\b(?:' . implode("|", $array) . ')\b~ui', function ($m) { return mb_strtolower($m[0]); }, $string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4oaeG
function name:  (null)
number of ops:  13
compiled vars:  !0 = $string, !1 = $array
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Legend+Of+Zelda'
    4     1        ASSIGN                                                       !1, <array>
    5     2        INIT_FCALL                                                   'preg_replace_callback'
          3        FRAMELESS_ICALL_2                implode             ~4      '%7C', !1
          4        CONCAT                                               ~5      '%7E%5Cb%28%3F%3A', ~4
          5        CONCAT                                               ~6      ~5, '%29%5Cb%7Eui'
          6        SEND_VAL                                                     ~6
          7        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
    7     8        SEND_VAL                                                     ~7
          9        SEND_VAR                                                     !0
    5    10        DO_ICALL                                             $8      
    7    11        ECHO                                                         $8
         12      > 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/4oaeG
function name:  {closure:/in/4oaeG:5}
number of ops:  7
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    6     1        INIT_FCALL                                                   'mb_strtolower'
          2        FETCH_DIM_R                                          ~1      !0, 0
          3        SEND_VAL                                                     ~1
          4        DO_ICALL                                             $2      
          5      > RETURN                                                       $2
    7     6*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.69 ms | 2133 KiB | 15 Q