3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createNewNutritionGoal() { $response = array(); if (isset($_POST["pid"]) && isset($_POST["nutritionProgress"]) && isset($_POST["nutrition"]) && isset($_POST["week"])) { $pid = intval($_POST["pid"]); $nutrition = $_POST["nutrition"]; $nutritionProg = floatval($_POST["nutritionProgress"]); $week = intval($_POST["week"]); $query = "INSERT INTO Goals (ParticipantID, Type, Description, WeekNumber, P rogress) VALUES ('$pid', 'NUTRITION', '$nutrition', '$week', $nutritionProg');"; $result = mysql_query($query) or die(mysql_error()); if ($result) { $response["error"] = false; $response["message"] = "Nutrtition goal created successfully!"; } else { $response["error"] = true; $response["message"] = "Failed to create nutrtition goal!"; } } else { $response["error"] = true; $response["message"] = "Things are missing!"; } // echo json response echo json_encode($response); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AgLcW
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E > > RETURN                                                   1

Function createnewnutritiongoal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 61
Branch analysis from position: 16
2 jumps found. (Code = 47) Position 1 = 46, Position 2 = 50
Branch analysis from position: 46
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 56
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
Branch analysis from position: 11
Branch analysis from position: 7
filename:       /in/AgLcW
function name:  createNewNutritionGoal
number of ops:  70
compiled vars:  !0 = $response, !1 = $pid, !2 = $nutrition, !3 = $nutritionProg, !4 = $week, !5 = $query, !6 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        FETCH_IS                                         ~8      '_POST'
          2        ISSET_ISEMPTY_DIM_OBJ                         0  ~9      ~8, 'pid'
          3      > JMPZ_EX                                          ~9      ~9, ->7
    5     4    >   FETCH_IS                                         ~10     '_POST'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~11     ~10, 'nutritionProgress'
          6        BOOL                                             ~9      ~11
          7    > > JMPZ_EX                                          ~9      ~9, ->11
    6     8    >   FETCH_IS                                         ~12     '_POST'
          9        ISSET_ISEMPTY_DIM_OBJ                         0  ~13     ~12, 'nutrition'
         10        BOOL                                             ~9      ~13
         11    > > JMPZ_EX                                          ~9      ~9, ->15
         12    >   FETCH_IS                                         ~14     '_POST'
         13        ISSET_ISEMPTY_DIM_OBJ                         0  ~15     ~14, 'week'
         14        BOOL                                             ~9      ~15
         15    > > JMPZ                                                     ~9, ->61
    8    16    >   FETCH_R                      global              ~16     '_POST'
         17        FETCH_DIM_R                                      ~17     ~16, 'pid'
         18        CAST                                          4  ~18     ~17
         19        ASSIGN                                                   !1, ~18
    9    20        FETCH_R                      global              ~20     '_POST'
         21        FETCH_DIM_R                                      ~21     ~20, 'nutrition'
         22        ASSIGN                                                   !2, ~21
   10    23        FETCH_R                      global              ~23     '_POST'
         24        FETCH_DIM_R                                      ~24     ~23, 'nutritionProgress'
         25        CAST                                          5  ~25     ~24
         26        ASSIGN                                                   !3, ~25
   11    27        FETCH_R                      global              ~27     '_POST'
         28        FETCH_DIM_R                                      ~28     ~27, 'week'
         29        CAST                                          4  ~29     ~28
         30        ASSIGN                                                   !4, ~29
   12    31        ROPE_INIT                                     9  ~32     'INSERT+INTO+Goals+%28ParticipantID%2C+Type%2C+Description%2C+WeekNumber%2C+P%0Arogress%29+VALUES+%28%27'
   13    32        ROPE_ADD                                      1  ~32     ~32, !1
         33        ROPE_ADD                                      2  ~32     ~32, '%27%2C+%27NUTRITION%27%2C+%27'
         34        ROPE_ADD                                      3  ~32     ~32, !2
         35        ROPE_ADD                                      4  ~32     ~32, '%27%2C+%27'
         36        ROPE_ADD                                      5  ~32     ~32, !4
         37        ROPE_ADD                                      6  ~32     ~32, '%27%2C+'
         38        ROPE_ADD                                      7  ~32     ~32, !3
         39        ROPE_END                                      8  ~31     ~32, '%27%29%3B'
   12    40        ASSIGN                                                   !5, ~31
   14    41        INIT_FCALL_BY_NAME                                       'mysql_query'
         42        SEND_VAR_EX                                              !5
         43        DO_FCALL                                      0  $38     
         44        ASSIGN                                           ~39     !6, $38
         45      > JMPNZ_EX                                         ~39     ~39, ->50
         46    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         47        DO_FCALL                                      0  $40     
         48      > EXIT                                                     $40
         49*       BOOL                                             ~39     <true>
   15    50    > > JMPZ                                                     !6, ->56
   16    51    >   ASSIGN_DIM                                               !0, 'error'
         52        OP_DATA                                                  <false>
   17    53        ASSIGN_DIM                                               !0, 'message'
         54        OP_DATA                                                  'Nutrtition+goal+created+successfully%21'
         55      > JMP                                                      ->60
   19    56    >   ASSIGN_DIM                                               !0, 'error'
         57        OP_DATA                                                  <true>
   20    58        ASSIGN_DIM                                               !0, 'message'
         59        OP_DATA                                                  'Failed+to+create+nutrtition+goal%21'
         60    > > JMP                                                      ->65
   23    61    >   ASSIGN_DIM                                               !0, 'error'
         62        OP_DATA                                                  <true>
   24    63        ASSIGN_DIM                                               !0, 'message'
         64        OP_DATA                                                  'Things+are+missing%21'
   27    65    >   INIT_FCALL                                               'json_encode'
         66        SEND_VAR                                                 !0
         67        DO_ICALL                                         $47     
         68        ECHO                                                     $47
   28    69      > RETURN                                                   null

End of function createnewnutritiongoal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
296.61 ms | 1404 KiB | 15 Q