3v4l.org

run code in 300+ PHP versions simultaneously
<?php // array containing data $array = array( "name" => "John", "surname" => "Doe", "email" => "j.doe@intelligence.gov" ); // build query... $sql = "INSERT INTO table"; // implode keys of $array... $sql .= " (`".implode("`, `", array_keys($array))."`)"; // implode values of $array... $sql .= " VALUES ('".implode("', '", $array)."') "; echo $sql;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s3ocd
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array, !1 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, 'INSERT+INTO+table'
   14     2        INIT_FCALL                                               'implode'
          3        SEND_VAL                                                 '%60%2C+%60'
          4        INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                         $5      
          9        CONCAT                                           ~6      '+%28%60', $5
         10        CONCAT                                           ~7      ~6, '%60%29'
         11        ASSIGN_OP                                     8          !1, ~7
   17    12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 '%27%2C+%27'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        CONCAT                                           ~10     '+VALUES+%28%27', $9
         17        CONCAT                                           ~11     ~10, '%27%29+'
         18        ASSIGN_OP                                     8          !1, ~11
   19    19        ECHO                                                     !1
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.52 ms | 1395 KiB | 17 Q