3v4l.org

run code in 300+ PHP versions simultaneously
<?php function updater_serv($connection,$email,$servicedta)//edit υπηρεσιών { $allowed = array_flip(['servicename','price','price_show','id']); // foreach ($servicedta as $update) { $update = array_intersect_key($update, $allowed); $id = array_pop($update); $values = array_values($update); $values[] = $id; $set = []; foreach ($update as $field => $value) { $set[] = "`{$field}`=:{$value}"; } $sql = 'UPDATE services_list SET ' . implode(', ', $set). ' WHERE serviceID='.$id; if($stmt=$connection->prepare($sql)) { $stmt->bind_param(str_repeat("s", count($set)+1), ...$values); $stmt->execute(); } } return 'update'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XIpBh
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E > > RETURN                                                   1

Function updater_serv:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 63
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 63
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 35
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 35
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 62
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 62
Branch analysis from position: 35
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 63
filename:       /in/XIpBh
function name:  updater_serv
number of ops:  66
compiled vars:  !0 = $connection, !1 = $email, !2 = $servicedta, !3 = $allowed, !4 = $update, !5 = $id, !6 = $values, !7 = $set, !8 = $value, !9 = $field, !10 = $sql, !11 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        INIT_FCALL                                               'array_flip'
          4        SEND_VAL                                                 <array>
          5        DO_ICALL                                         $12     
          6        ASSIGN                                                   !3, $12
    7     7      > FE_RESET_R                                       $14     !2, ->63
          8    > > FE_FETCH_R                                               $14, !4, ->63
    9     9    >   INIT_FCALL                                               'array_intersect_key'
         10        SEND_VAR                                                 !4
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $15     
         13        ASSIGN                                                   !4, $15
   10    14        INIT_FCALL                                               'array_pop'
         15        SEND_REF                                                 !4
         16        DO_ICALL                                         $17     
         17        ASSIGN                                                   !5, $17
   12    18        INIT_FCALL                                               'array_values'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $19     
         21        ASSIGN                                                   !6, $19
   13    22        ASSIGN_DIM                                               !6
         23        OP_DATA                                                  !5
   14    24        ASSIGN                                                   !7, <array>
   17    25      > FE_RESET_R                                       $23     !4, ->35
         26    > > FE_FETCH_R                                       ~24     $23, !8, ->35
         27    >   ASSIGN                                                   !9, ~24
   18    28        ROPE_INIT                                     4  ~28     '%60'
         29        ROPE_ADD                                      1  ~28     ~28, !9
         30        ROPE_ADD                                      2  ~28     ~28, '%60%3D%3A'
         31        ROPE_END                                      3  ~27     ~28, !8
         32        ASSIGN_DIM                                               !7
         33        OP_DATA                                                  ~27
   17    34      > JMP                                                      ->26
         35    >   FE_FREE                                                  $23
   20    36        INIT_FCALL                                               'implode'
         37        SEND_VAL                                                 '%2C+'
         38        SEND_VAR                                                 !7
         39        DO_ICALL                                         $30     
         40        CONCAT                                           ~31     'UPDATE+services_list+SET+', $30
         41        CONCAT                                           ~32     ~31, '+WHERE+serviceID%3D'
         42        CONCAT                                           ~33     ~32, !5
         43        ASSIGN                                                   !10, ~33
   21    44        INIT_METHOD_CALL                                         !0, 'prepare'
         45        SEND_VAR_EX                                              !10
         46        DO_FCALL                                      0  $35     
         47        ASSIGN                                           ~36     !11, $35
         48      > JMPZ                                                     ~36, ->62
   22    49    >   INIT_METHOD_CALL                                         !11, 'bind_param'
         50        INIT_FCALL                                               'str_repeat'
         51        SEND_VAL                                                 's'
         52        COUNT                                            ~37     !7
         53        ADD                                              ~38     ~37, 1
         54        SEND_VAL                                                 ~38
         55        DO_ICALL                                         $39     
         56        SEND_VAR_NO_REF_EX                                       $39
         57        SEND_UNPACK                                              !6
         58        CHECK_UNDEF_ARGS                                         
         59        DO_FCALL                                      1          
   23    60        INIT_METHOD_CALL                                         !11, 'execute'
         61        DO_FCALL                                      0          
    7    62    > > JMP                                                      ->8
         63    >   FE_FREE                                                  $14
   30    64      > RETURN                                                   'update'
   31    65*     > RETURN                                                   null

End of function updater_serv

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.04 ms | 1015 KiB | 19 Q