3v4l.org

run code in 500+ PHP versions simultaneously
<?php $rego_columns = [ "make", "model", "year", "rego", ]; $record = ['make' => 'A', 'model' => 'B', 'year' => 'C', 'rego' => 'D']; $tableValues = array_map(function($r) use ($record) { return $record[$r]; }, $rego_columns); $tableColumns = '`' . implode('`,`', $rego_columns) . '`'; $tableValues = '"' . implode('","', $tableValues) . '"'; echo 'INSERT INTO table_name (' . $tableColumns . ') VALUES (' . $tableValues . ')';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h70pO
function name:  (null)
number of ops:  23
compiled vars:  !0 = $rego_columns, !1 = $record, !2 = $tableValues, !3 = $tableColumns
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, <array>
   12     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          4        BIND_LEXICAL                                                 ~6, !1
   14     5        SEND_VAL                                                     ~6
          6        SEND_VAR                                                     !0
   12     7        DO_ICALL                                             $7      
          8        ASSIGN                                                       !2, $7
   16     9        FRAMELESS_ICALL_2                implode             ~9      '%60%2C%60', !0
         10        CONCAT                                               ~10     '%60', ~9
         11        CONCAT                                               ~11     ~10, '%60'
         12        ASSIGN                                                       !3, ~11
   17    13        FRAMELESS_ICALL_2                implode             ~13     '%22%2C%22', !2
         14        CONCAT                                               ~14     '%22', ~13
         15        CONCAT                                               ~15     ~14, '%22'
         16        ASSIGN                                                       !2, ~15
   20    17        CONCAT                                               ~17     'INSERT+INTO+table_name++%28', !3
         18        CONCAT                                               ~18     ~17, '%29+VALUES+%28'
         19        CONCAT                                               ~19     ~18, !2
         20        CONCAT                                               ~20     ~19, '%29'
         21        ECHO                                                         ~20
         22      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h70pO
function name:  {closure:/in/h70pO:12}
number of ops:  5
compiled vars:  !0 = $r, !1 = $record
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   13     2        FETCH_DIM_R                                          ~2      !1, !0
          3      > RETURN                                                       ~2
   14     4*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.51 ms | 2549 KiB | 14 Q