3v4l.org

run code in 300+ PHP versions simultaneously
<?php //set up the database connection $servername = "192.129.1.209"; $username = "meaadmin"; $password = "Kasten_15&"; $dbname = "typo3mea"; $dataurl = "http://127.0.0.1:8000/api/thesis?format=json"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } //read the json file content $jsondata = file_get_contents($dataurl); //convert json object to php array $data = json_decode($jsondata, true); echo file_get_contents($dataurl); if (empty($data)) { echo "empty"; } $b = count($data); echo $b; //insert into mysql table foreach($data->objects as $obj) { $sql = "INSERT INTO mea_thesis(title) VALUES('".$obj->title."')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } } echo "test"; $conn->close(); echo file_get_contents("http://google.com"); //echo phpinfo(); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 56
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 56
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
Branch analysis from position: 33
filename:       /in/s2Qal
function name:  (null)
number of ops:  65
compiled vars:  !0 = $servername, !1 = $username, !2 = $password, !3 = $dbname, !4 = $dataurl, !5 = $conn, !6 = $jsondata, !7 = $data, !8 = $b, !9 = $obj, !10 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '192.129.1.209'
    4     1        ASSIGN                                                   !1, 'meaadmin'
    5     2        ASSIGN                                                   !2, 'Kasten_15%26'
    6     3        ASSIGN                                                   !3, 'typo3mea'
    7     4        ASSIGN                                                   !4, 'http%3A%2F%2F127.0.0.1%3A8000%2Fapi%2Fthesis%3Fformat%3Djson'
   10     5        NEW                                              $16     'mysqli'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !3
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !5, $16
   13    12        FETCH_OBJ_R                                      ~19     !5, 'connect_error'
         13      > JMPZ                                                     ~19, ->17
   14    14    >   FETCH_OBJ_R                                      ~20     !5, 'connect_error'
         15        CONCAT                                           ~21     'Connection+failed%3A+', ~20
         16      > EXIT                                                     ~21
   18    17    >   INIT_FCALL                                               'file_get_contents'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $22     
         20        ASSIGN                                                   !6, $22
   20    21        INIT_FCALL                                               'json_decode'
         22        SEND_VAR                                                 !6
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $24     
         25        ASSIGN                                                   !7, $24
   21    26        INIT_FCALL                                               'file_get_contents'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $26     
         29        ECHO                                                     $26
   22    30        ISSET_ISEMPTY_CV                                         !7
         31      > JMPZ                                                     ~27, ->33
   23    32    >   ECHO                                                     'empty'
   25    33    >   COUNT                                            ~28     !7
         34        ASSIGN                                                   !8, ~28
   26    35        ECHO                                                     !8
   28    36        FETCH_OBJ_R                                      ~30     !7, 'objects'
         37      > FE_RESET_R                                       $31     ~30, ->56
         38    > > FE_FETCH_R                                               $31, !9, ->56
   29    39    >   FETCH_OBJ_R                                      ~32     !9, 'title'
         40        CONCAT                                           ~33     'INSERT+INTO+mea_thesis%28title%29+VALUES%28%27', ~32
         41        CONCAT                                           ~34     ~33, '%27%29'
         42        ASSIGN                                                   !10, ~34
   30    43        INIT_METHOD_CALL                                         !5, 'query'
         44        SEND_VAR_EX                                              !10
         45        DO_FCALL                                      0  $36     
         46        TYPE_CHECK                                    8          $36
         47      > JMPZ                                                     ~37, ->50
   31    48    >   ECHO                                                     'New+record+created+successfully'
         49      > JMP                                                      ->55
   33    50    >   CONCAT                                           ~38     'Error%3A+', !10
         51        CONCAT                                           ~39     ~38, '%3Cbr%3E'
         52        FETCH_OBJ_R                                      ~40     !5, 'error'
         53        CONCAT                                           ~41     ~39, ~40
         54        ECHO                                                     ~41
   28    55    > > JMP                                                      ->38
         56    >   FE_FREE                                                  $31
   36    57        ECHO                                                     'test'
   37    58        INIT_METHOD_CALL                                         !5, 'close'
         59        DO_FCALL                                      0          
   38    60        INIT_FCALL                                               'file_get_contents'
         61        SEND_VAL                                                 'http%3A%2F%2Fgoogle.com'
         62        DO_ICALL                                         $43     
         63        ECHO                                                     $43
   40    64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.95 ms | 1400 KiB | 17 Q