3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vocabulary = array( array('Language' => 'Gotisch','Nederlands' => 'Gotisch','German' => 'Gotisch','English' => 'Gothic','article' => '','id' => '0','type' => '','French' => ''), array('Language' => 'augĀ“','Nederlands' => 'oog','German' => 'Auge','English' => 'eye','article' => ' ','id' => '0','type' => '','French' => '')); $table = 't'; $sql = array_reduce($vocabulary, function($cur, $x) { return $cur.=join(', ', array_map(function($y) { return "'".$y."'"; }, $x)); }, 'INSERT INTO '.$table. '('.join(', ', array_keys(current($vocabulary))).') VALUES '); var_dump($sql);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FAMbA
function name:  (null)
number of ops:  27
compiled vars:  !0 = $vocabulary, !1 = $table, !2 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, 't'
    8     2        INIT_FCALL                                               'array_reduce'
          3        SEND_VAR                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFAMbA%3A8%240'
   14     5        SEND_VAL                                                 ~5
          6        CONCAT                                           ~6      'INSERT+INTO+', !1
          7        CONCAT                                           ~7      ~6, '%28'
          8        INIT_FCALL                                               'join'
          9        SEND_VAL                                                 '%2C+'
         10        INIT_FCALL                                               'array_keys'
         11        INIT_FCALL                                               'current'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                         $9      
         16        SEND_VAR                                                 $9
         17        DO_ICALL                                         $10     
         18        CONCAT                                           ~11     ~7, $10
         19        CONCAT                                           ~12     ~11, '%29+VALUES+'
         20        SEND_VAL                                                 ~12
         21        DO_ICALL                                         $13     
    8    22        ASSIGN                                                   !2, $13
   16    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFAMbA%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FAMbA
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $cur, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'join'
          3        SEND_VAL                                                 '%2C+'
          4        INIT_FCALL                                               'array_map'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFAMbA%3A10%241'
   13     6        SEND_VAL                                                 ~2
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                         $4      
         11        ASSIGN_OP                                     8  ~5      !0, $4
         12      > RETURN                                                   ~5
   14    13*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFAMbA%3A8%240

Function %00%7Bclosure%7D%2Fin%2FFAMbA%3A10%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FAMbA
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        CONCAT                                           ~1      '%27', !0
          2        CONCAT                                           ~2      ~1, '%27'
          3      > RETURN                                                   ~2
   13     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFAMbA%3A10%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.57 ms | 1392 KiB | 25 Q