3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Hello {{name}} welcome to {{company_name}}"; $array = ['name' => 'max', 'company_name' => 'Stack Exchange']; $searchArray = array_map(function($value) { return "{{" . $value . "}}"; }, array_keys($array)); echo str_replace($searchArray, $array, $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8tPZt
function name:  (null)
number of ops:  18
compiled vars:  !0 = $str, !1 = $array, !2 = $searchArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Hello+%7B%7Bname%7D%7D+welcome+to+%7B%7Bcompany_name%7D%7D'
    5     1        ASSIGN                                                   !1, <array>
    7     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
    9     4        SEND_VAL                                                 ~5
          5        INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
    7     9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
   11    11        INIT_FCALL                                               'str_replace'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        ECHO                                                     $9
         17      > 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/8tPZt
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        CONCAT                                           ~1      '%7B%7B', !0
          2        CONCAT                                           ~2      ~1, '%7D%7D'
          3      > RETURN                                                   ~2
    9     4*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.68 ms | 1002 KiB | 16 Q