3v4l.org

run code in 300+ 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:  16
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        INIT_FCALL                                               'implode'
          4        SEND_VAL                                                 '%7C'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $4      
          7        CONCAT                                           ~5      '%7E%5Cb%28%3F%3A', $4
          8        CONCAT                                           ~6      ~5, '%29%5Cb%7Eui'
          9        SEND_VAL                                                 ~6
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4oaeG%3A5%240'
    7    11        SEND_VAL                                                 ~7
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $8      
         14        ECHO                                                     $8
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F4oaeG%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4oaeG
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2F4oaeG%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.74 ms | 943 KiB | 20 Q