3v4l.org

run code in 300+ PHP versions simultaneously
<?php $String = "{{ONE}} {{TWO}} {{THREE}} {{FOUR}} {{FIVE}} {{SIX}}"; $rows = array(array('linkVal' => '{{TWO}}', 'link' => 'http://one.com'), array('linkVal' => '{{FOUR}}', 'link' => 'http://two.com') ); echo str_replace(array_column($rows, 'linkVal'), array_column($rows, 'link'), $String);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ch9HV
function name:  (null)
number of ops:  17
compiled vars:  !0 = $String, !1 = $rows
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B%7BONE%7D%7D+%7B%7BTWO%7D%7D+%7B%7BTHREE%7D%7D+%7B%7BFOUR%7D%7D+%7B%7BFIVE%7D%7D+%7B%7BSIX%7D%7D'
    4     1        ASSIGN                                                   !1, <array>
    8     2        INIT_FCALL                                               'str_replace'
          3        INIT_FCALL                                               'array_column'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 'linkVal'
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        INIT_FCALL                                               'array_column'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 'link'
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $6      
         15        ECHO                                                     $6
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.69 ms | 1010 KiB | 15 Q