3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = ['id', 'zip_code', 'state', 'city', 'town', 'lot_number', 'building']; $sets = array_map(function ($name) { return "{$name} = :{$name}"; }, $items); $values = array_map(function ($name) { return filter_input(INPUT_POST, $name); }, $items); $where = array_shift($sets); $stmt = connectDB()->prepare("UPDATE users SET " . implode(', ', $sets) . ' WHERE ' . $where); $stmt->execute($values);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cP4Qp
function name:  (null)
number of ops:  34
compiled vars:  !0 = $items, !1 = $sets, !2 = $values, !3 = $where, !4 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcP4Qp%3A4%240'
          3        SEND_VAL                                                 ~6
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !1, $7
    5     7        INIT_FCALL                                               'array_map'
          8        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcP4Qp%3A5%241'
          9        SEND_VAL                                                 ~9
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
    6    13        INIT_FCALL                                               'array_shift'
         14        SEND_REF                                                 !1
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !3, $12
    7    17        INIT_FCALL_BY_NAME                                       'connectDB'
         18        DO_FCALL                                      0  $14     
         19        INIT_METHOD_CALL                                         $14, 'prepare'
         20        INIT_FCALL                                               'implode'
         21        SEND_VAL                                                 '%2C+'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $15     
         24        CONCAT                                           ~16     'UPDATE+users+SET+', $15
         25        CONCAT                                           ~17     ~16, '+WHERE+'
         26        CONCAT                                           ~18     ~17, !3
         27        SEND_VAL_EX                                              ~18
         28        DO_FCALL                                      0  $19     
         29        ASSIGN                                                   !4, $19
    8    30        INIT_METHOD_CALL                                         !4, 'execute'
         31        SEND_VAR_EX                                              !2
         32        DO_FCALL                                      0          
         33      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcP4Qp%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cP4Qp
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        ROPE_INIT                                     3  ~2      !0
          2        ROPE_ADD                                      1  ~2      ~2, '+%3D+%3A'
          3        ROPE_END                                      2  ~1      ~2, !0
          4      > RETURN                                                   ~1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcP4Qp%3A4%240

Function %00%7Bclosure%7D%2Fin%2FcP4Qp%3A5%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cP4Qp
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'filter_input'
          2        SEND_VAL                                                 0
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcP4Qp%3A5%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.56 ms | 1400 KiB | 21 Q