3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array( '1' => array( 'prodid' => 1, 'title' => 'product one', ), '2' => array( 'prodid' => 2, 'title' => 'product two', ), '3' => array( 'prodid' => 3, 'title' => 'product three', ), ); foreach ($array1 as $prodid => $data){ $insert .= "($prodid,'".$data['title']."'),"; } $insert = substr($insert,0,-1); echo $insert;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/d07To
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array1, !1 = $data, !2 = $prodid, !3 = $insert
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   16     1      > FE_RESET_R                                       $5      !0, ->12
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->12
          3    >   ASSIGN                                                   !2, ~6
   17     4        ROPE_INIT                                     3  ~9      '%28'
          5        ROPE_ADD                                      1  ~9      ~9, !2
          6        ROPE_END                                      2  ~8      ~9, '%2C%27'
          7        FETCH_DIM_R                                      ~11     !1, 'title'
          8        CONCAT                                           ~12     ~8, ~11
          9        CONCAT                                           ~13     ~12, '%27%29%2C'
         10        ASSIGN_OP                                     8          !3, ~13
   16    11      > JMP                                                      ->2
         12    >   FE_FREE                                                  $5
   19    13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 0
         16        SEND_VAL                                                 -1
         17        DO_ICALL                                         $15     
         18        ASSIGN                                                   !3, $15
   20    19        ECHO                                                     !3
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.16 ms | 1399 KiB | 15 Q