3v4l.org

run code in 300+ PHP versions simultaneously
<?php // connect to the database $link = mysql_connect('localhost','root','root'); mysql_select_db("goal_database",$link); function deleteActivity() { $response = array(); if (isset($_POST["aid"])) { $aid = intval($_POST["aid"]); $query = "DELETE FROM Activities WHERE ActivityID = '$aid';"; $result = mysql_query($query) or die(mysql_error()); if ($result) { $response["error"] = false; $response["message"] = "Activity deleted successfully!"; } else { $response["error"] = true; $response["message"] = "Failed to deleted activity!"; } } else { $response["error"] = true; $response["message"] = "Things are missing!"; } // echo json response echo json_encode($response); } deleteActivity(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d0Cvv
function name:  (null)
number of ops:  13
compiled vars:  !0 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'mysql_connect'
          1        SEND_VAL_EX                                              'localhost'
          2        SEND_VAL_EX                                              'root'
          3        SEND_VAL_EX                                              'root'
          4        DO_FCALL                                      0  $1      
          5        ASSIGN                                                   !0, $1
    4     6        INIT_FCALL_BY_NAME                                       'mysql_select_db'
          7        SEND_VAL_EX                                              'goal_database'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
   28    10        INIT_FCALL                                               'deleteactivity'
         11        DO_FCALL                                      0          
   29    12      > RETURN                                                   1

Function deleteactivity:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d0Cvv
function name:  deleteActivity
number of ops:  41
compiled vars:  !0 = $response, !1 = $aid, !2 = $query, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        FETCH_IS                                         ~5      '_POST'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~5, 'aid'
          3      > JMPZ                                                     ~6, ->32
   10     4    >   FETCH_R                      global              ~7      '_POST'
          5        FETCH_DIM_R                                      ~8      ~7, 'aid'
          6        CAST                                          4  ~9      ~8
          7        ASSIGN                                                   !1, ~9
   12     8        ROPE_INIT                                     3  ~12     'DELETE+FROM+Activities+WHERE+ActivityID+%3D+%27'
          9        ROPE_ADD                                      1  ~12     ~12, !1
         10        ROPE_END                                      2  ~11     ~12, '%27%3B'
         11        ASSIGN                                                   !2, ~11
   13    12        INIT_FCALL_BY_NAME                                       'mysql_query'
         13        SEND_VAR_EX                                              !2
         14        DO_FCALL                                      0  $15     
         15        ASSIGN                                           ~16     !3, $15
         16      > JMPNZ_EX                                         ~16     ~16, ->21
         17    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         18        DO_FCALL                                      0  $17     
         19      > EXIT                                                     $17
         20*       BOOL                                             ~16     <true>
   14    21    > > JMPZ                                                     !3, ->27
   15    22    >   ASSIGN_DIM                                               !0, 'error'
         23        OP_DATA                                                  <false>
   16    24        ASSIGN_DIM                                               !0, 'message'
         25        OP_DATA                                                  'Activity+deleted+successfully%21'
         26      > JMP                                                      ->31
   18    27    >   ASSIGN_DIM                                               !0, 'error'
         28        OP_DATA                                                  <true>
   19    29        ASSIGN_DIM                                               !0, 'message'
         30        OP_DATA                                                  'Failed+to+deleted+activity%21'
         31    > > JMP                                                      ->36
   22    32    >   ASSIGN_DIM                                               !0, 'error'
         33        OP_DATA                                                  <true>
   23    34        ASSIGN_DIM                                               !0, 'message'
         35        OP_DATA                                                  'Things+are+missing%21'
   26    36    >   INIT_FCALL                                               'json_encode'
         37        SEND_VAR                                                 !0
         38        DO_ICALL                                         $24     
         39        ECHO                                                     $24
   27    40      > RETURN                                                   null

End of function deleteactivity

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.72 ms | 1403 KiB | 16 Q