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"; $conn = mysql_connect($servername, $username, $password); mysql_select_db($dbname); echo "connected successfully" . '<br>'; //read the json file content $jsondata = file_get_contents('http://127.0.0.1:8000/api/thesis/?format=json'); //convert json object to php array $data = json_decode($jsondata, true); var_dump($data); //get the thesis details //$id = $data['id']; //$author = $data['author']; //$type = $data['type']; $title = $data['title']; //$year = $data['year']; //insert into mysql table foreach($data as $title) { $sql = "INSERT INTO mea_thesis(title) VALUES('$title')"; } //debug if(!mysql_query($sql,$conn)) { die('Error : '.mysql_error()); } //database connection close mysql_close($conn); echo "Hello Munir :D"; //print $data["objects"]; //echo $data; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 36
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 36
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 47
Branch analysis from position: 43
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/jKAqL
function name:  (null)
number of ops:  52
compiled vars:  !0 = $servername, !1 = $username, !2 = $password, !3 = $dbname, !4 = $conn, !5 = $jsondata, !6 = $data, !7 = $title, !8 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%3C'
    3     1        ASSIGN                                                   !0, '192.129.1.209'
    4     2        ASSIGN                                                   !1, 'meaadmin'
    5     3        ASSIGN                                                   !2, 'Kasten_15%26'
    6     4        ASSIGN                                                   !3, 'typo3mea'
    7     5        INIT_FCALL_BY_NAME                                       'mysql_connect'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $13     
         10        ASSIGN                                                   !4, $13
    8    11        INIT_FCALL_BY_NAME                                       'mysql_select_db'
         12        SEND_VAR_EX                                              !3
         13        DO_FCALL                                      0          
   10    14        ECHO                                                     'connected+successfully%3Cbr%3E'
   12    15        INIT_FCALL                                               'file_get_contents'
         16        SEND_VAL                                                 'http%3A%2F%2F127.0.0.1%3A8000%2Fapi%2Fthesis%2F%3Fformat%3Djson'
         17        DO_ICALL                                         $16     
         18        ASSIGN                                                   !5, $16
   14    19        INIT_FCALL                                               'json_decode'
         20        SEND_VAR                                                 !5
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $18     
         23        ASSIGN                                                   !6, $18
   15    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !6
         26        DO_ICALL                                                 
   20    27        FETCH_DIM_R                                      ~21     !6, 'title'
         28        ASSIGN                                                   !7, ~21
   24    29      > FE_RESET_R                                       $23     !6, ->36
         30    > > FE_FETCH_R                                               $23, !7, ->36
   26    31    >   ROPE_INIT                                     3  ~25     'INSERT+INTO+mea_thesis%28title%29+%0AVALUES%28%27'
   27    32        ROPE_ADD                                      1  ~25     ~25, !7
         33        ROPE_END                                      2  ~24     ~25, '%27%29'
   26    34        ASSIGN                                                   !8, ~24
   24    35      > JMP                                                      ->30
         36    >   FE_FREE                                                  $23
   31    37        INIT_FCALL_BY_NAME                                       'mysql_query'
         38        SEND_VAR_EX                                              !8
         39        SEND_VAR_EX                                              !4
         40        DO_FCALL                                      0  $28     
         41        BOOL_NOT                                         ~29     $28
         42      > JMPZ                                                     ~29, ->47
   33    43    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         44        DO_FCALL                                      0  $30     
         45        CONCAT                                           ~31     'Error+%3A+', $30
         46      > EXIT                                                     ~31
   37    47    >   INIT_FCALL_BY_NAME                                       'mysql_close'
         48        SEND_VAR_EX                                              !4
         49        DO_FCALL                                      0          
   39    50        ECHO                                                     'Hello+Munir+%3AD'
   42    51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.1 ms | 1400 KiB | 19 Q