3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keywords = ['test', 'value']; $replace = array_map(function($key) { return '<span>' . $key . '</span>'; }, $keywords); $string = 'Hello world. This is a test.'; $render = str_replace($keywords, $replace, $string); echo $render;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rdQLE
function name:  (null)
number of ops:  16
compiled vars:  !0 = $keywords, !1 = $replace, !2 = $string, !3 = $render
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FrdQLE%3A5%240'
    7     3        SEND_VAL                                                 ~5
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
    5     6        ASSIGN                                                   !1, $6
    9     7        ASSIGN                                                   !2, 'Hello+world.+This+is+a+test.'
   11     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
   13    14        ECHO                                                     !3
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FrdQLE%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rdQLE
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        CONCAT                                           ~1      '%3Cspan%3E', !0
          2        CONCAT                                           ~2      ~1, '%3C%2Fspan%3E'
          3      > RETURN                                                   ~2
    7     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FrdQLE%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.35 ms | 1395 KiB | 17 Q