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($vorcabulary, function($cur, $x) { return $cur.=join(', ', array_map(function($y) { return "'".$y."'"; }, $x)); }, 'INSERT INTO '.$t. '('.join(', ', array_keys(current($vorcabulary))).') VALUES '); var_dump($sql);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kAiaX
function name:  (null)
number of ops:  27
compiled vars:  !0 = $vocabulary, !1 = $table, !2 = $sql, !3 = $vorcabulary, !4 = $t
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                                                 !3
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FkAiaX%3A8%240'
   14     5        SEND_VAL                                                 ~7
          6        CONCAT                                           ~8      'INSERT+INTO+', !4
          7        CONCAT                                           ~9      ~8, '%28'
          8        INIT_FCALL                                               'join'
          9        SEND_VAL                                                 '%2C+'
         10        INIT_FCALL                                               'array_keys'
         11        INIT_FCALL                                               'current'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                         $11     
         16        SEND_VAR                                                 $11
         17        DO_ICALL                                         $12     
         18        CONCAT                                           ~13     ~9, $12
         19        CONCAT                                           ~14     ~13, '%29+VALUES+'
         20        SEND_VAL                                                 ~14
         21        DO_ICALL                                         $15     
    8    22        ASSIGN                                                   !2, $15
   16    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FkAiaX%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kAiaX
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%2FkAiaX%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%2FkAiaX%3A8%240

Function %00%7Bclosure%7D%2Fin%2FkAiaX%3A10%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kAiaX
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%2FkAiaX%3A10%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.83 ms | 1400 KiB | 25 Q