3v4l.org

run code in 300+ PHP versions simultaneously
<?php // PHP5.3: but must use array(); PHP5.4+ $start = '1,2,3\n,4,5,6,\n,7,8,9'; $it = [['k' =>',', 'v'=>''], ['k'=>'\n', 'v'=>"\n"]]; // aproximating tuple seq print array_reduce($it, function($s, $a){ return str_replace( $a['k'], $a['v'], $s ); }, $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OVPEK
function name:  (null)
number of ops:  10
compiled vars:  !0 = $start, !1 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '1%2C2%2C3%5Cn%2C4%2C5%2C6%2C%5Cn%2C7%2C8%2C9'
    7     1        ASSIGN                                                   !1, <array>
   10     2        INIT_FCALL                                               'array_reduce'
          3        SEND_VAR                                                 !1
   11     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FOVPEK%3A11%240'
   13     5        SEND_VAL                                                 ~4
   14     6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FOVPEK%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OVPEK
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $s, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_FCALL                                               'str_replace'
          3        FETCH_DIM_R                                      ~2      !1, 'k'
          4        SEND_VAL                                                 ~2
          5        FETCH_DIM_R                                      ~3      !1, 'v'
          6        SEND_VAL                                                 ~3
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9      > RETURN                                                   $4
   13    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FOVPEK%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.22 ms | 1395 KiB | 17 Q