3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fields = "email,first,last,business,home,cell,street,city,state,zip,system,cameras,hdd"; $sql_header = ''; $sql_values = ''; $glue = ''; array_walk( explode(',', $fields), function ($field) use (& $sql_header, & $sql_values, & $glue) { $sql_header .= $glue . '`' . $field . '`'; $sql_values .= $glue . "'" . $field . "'"; $glue = ','; } ); echo ("INSERT INTO `customers`($sql_header) VALUES ($sql_values)");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KBI8q
function name:  (null)
number of ops:  23
compiled vars:  !0 = $fields, !1 = $sql_header, !2 = $sql_values, !3 = $glue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'email%2Cfirst%2Clast%2Cbusiness%2Chome%2Ccell%2Cstreet%2Ccity%2Cstate%2Czip%2Csystem%2Ccameras%2Chdd'
    6     1        ASSIGN                                                   !1, ''
    7     2        ASSIGN                                                   !2, ''
    8     3        ASSIGN                                                   !3, ''
   10     4        INIT_FCALL                                               'array_walk'
   11     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2C'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $8      
          9        SEND_VAR_NO_REF                               0          $8
   12    10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKBI8q%3A12%240'
         11        BIND_LEXICAL                                             ~9, !1
         12        BIND_LEXICAL                                             ~9, !2
         13        BIND_LEXICAL                                             ~9, !3
   16    14        SEND_VAL                                                 ~9
         15        DO_ICALL                                                 
   18    16        ROPE_INIT                                     5  ~12     'INSERT+INTO+%60customers%60%28'
         17        ROPE_ADD                                      1  ~12     ~12, !1
         18        ROPE_ADD                                      2  ~12     ~12, '%29+VALUES+%28'
         19        ROPE_ADD                                      3  ~12     ~12, !2
         20        ROPE_END                                      4  ~11     ~12, '%29'
         21        ECHO                                                     ~11
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKBI8q%3A12%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KBI8q
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $field, !1 = $sql_header, !2 = $sql_values, !3 = $glue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
   13     4        CONCAT                                           ~4      !3, '%60'
          5        CONCAT                                           ~5      ~4, !0
          6        CONCAT                                           ~6      ~5, '%60'
          7        ASSIGN_OP                                     8          !1, ~6
   14     8        CONCAT                                           ~8      !3, '%27'
          9        CONCAT                                           ~9      ~8, !0
         10        CONCAT                                           ~10     ~9, '%27'
         11        ASSIGN_OP                                     8          !2, ~10
   15    12        ASSIGN                                                   !3, '%2C'
   16    13      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKBI8q%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.99 ms | 1400 KiB | 17 Q