3v4l.org

run code in 300+ PHP versions simultaneously
<?php function db_news_restart() { mysql_query("DROP TABLE IF EXISTS news"); mysql_query(" CREATE TABLE news ( id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, header longtext, text longtext, author longtext, lastedit longtext); "); } function db_news_create($header, $text, $author) { $set = array(); $set["header"] = "'" . mysql_real_escape_string($header) . "'"; $set["text"] = "'" . mysql_real_escape_string($text) . "'"; $set["author"] = "'" . mysql_real_escape_string($author) . "'"; $set["lastedit"] = "'" . time() . "'"; mysql_query("INSERT INTO news (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"); } function db_news_edit($id, $header, $text) { mysql_query("UPDATE news SET header = '" . mysql_real_escape_string($header) . "', text = '" . mysql_real_escape_string($text) . "' WHERE id = '" . mysql_real_escape_string($id) . "'") or die(mysql_error()); } function db_news_remove($id) { mysql_query("DELETE FROM news WHERE id = '" . mysql_real_escape_string($id) . "'") or die(mysql_error()); } function db_news_globalGET($id, $what) { $query = mysql_query("SELECT * FROM news WHERE id='" . mysql_real_escape_string($id) . "'"); $get = mysql_fetch_array($query, MYSQL_ASSOC); return $get[$what]; } function db_news_header($id) { return db_news_globalGET($id, "header"); } function db_news_text($id) { return db_news_globalGET($id, "text"); } function db_news_author($id) { return db_news_globalGET($id, "author"); } function db_news_lastedit($id) { return db_news_globalGET($id, "lastedit"); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E > > RETURN                                                   1

Function db_news_restart:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_restart
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL_BY_NAME                                       'mysql_query'
          1        SEND_VAL_EX                                              'DROP+TABLE+IF+EXISTS+news'
          2        DO_FCALL                                      0          
    5     3        INIT_FCALL_BY_NAME                                       'mysql_query'
          4        SEND_VAL_EX                                              '%0A++++++++CREATE+TABLE+news+%28%0A++++++++id+INT%2811%29+NOT+NULL+PRIMARY+KEY+AUTO_INCREMENT%2C+%0A++++++++header+longtext%2C+%0A++++++++text+longtext%2C+%0A++++++++author+longtext%2C+%0A++++++++lastedit+longtext%29%3B%0A++++'
          5        DO_FCALL                                      0          
   13     6      > RETURN                                                   null

End of function db_news_restart

Function db_news_create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_create
number of ops:  50
compiled vars:  !0 = $header, !1 = $text, !2 = $author, !3 = $set
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   16     3        ASSIGN                                                   !3, <array>
   17     4        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $6      
          7        CONCAT                                           ~7      '%27', $6
          8        CONCAT                                           ~8      ~7, '%27'
          9        ASSIGN_DIM                                               !3, 'header'
         10        OP_DATA                                                  ~8
   18    11        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         12        SEND_VAR_EX                                              !1
         13        DO_FCALL                                      0  $10     
         14        CONCAT                                           ~11     '%27', $10
         15        CONCAT                                           ~12     ~11, '%27'
         16        ASSIGN_DIM                                               !3, 'text'
         17        OP_DATA                                                  ~12
   19    18        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0  $14     
         21        CONCAT                                           ~15     '%27', $14
         22        CONCAT                                           ~16     ~15, '%27'
         23        ASSIGN_DIM                                               !3, 'author'
         24        OP_DATA                                                  ~16
   20    25        INIT_FCALL                                               'time'
         26        DO_ICALL                                         $18     
         27        CONCAT                                           ~19     '%27', $18
         28        CONCAT                                           ~20     ~19, '%27'
         29        ASSIGN_DIM                                               !3, 'lastedit'
         30        OP_DATA                                                  ~20
   22    31        INIT_FCALL_BY_NAME                                       'mysql_query'
         32        INIT_FCALL                                               'implode'
         33        SEND_VAL                                                 '%2C+'
         34        INIT_FCALL                                               'array_keys'
         35        SEND_VAR                                                 !3
         36        DO_ICALL                                         $21     
         37        SEND_VAR                                                 $21
         38        DO_ICALL                                         $22     
         39        CONCAT                                           ~23     'INSERT+INTO+news+%28', $22
         40        CONCAT                                           ~24     ~23, '%29+VALUES+%28'
         41        INIT_FCALL                                               'implode'
         42        SEND_VAL                                                 '%2C+'
         43        SEND_VAR                                                 !3
         44        DO_ICALL                                         $25     
         45        CONCAT                                           ~26     ~24, $25
         46        CONCAT                                           ~27     ~26, '%29'
         47        SEND_VAL_EX                                              ~27
         48        DO_FCALL                                      0          
   23    49      > RETURN                                                   null

End of function db_news_create

Function db_news_edit:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_edit
number of ops:  27
compiled vars:  !0 = $id, !1 = $header, !2 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   26     3        INIT_FCALL_BY_NAME                                       'mysql_query'
          4        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $3      
          7        CONCAT                                           ~4      'UPDATE+news+SET+header+%3D+%27', $3
          8        CONCAT                                           ~5      ~4, '%27%2C+%0A++++text+%3D+%27'
   27     9        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0  $6      
         12        CONCAT                                           ~7      ~5, $6
         13        CONCAT                                           ~8      ~7, '%27+WHERE+id+%3D+%27'
         14        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0  $9      
         17        CONCAT                                           ~10     ~8, $9
         18        CONCAT                                           ~11     ~10, '%27'
         19        SEND_VAL_EX                                              ~11
         20        DO_FCALL                                      0  $12     
         21      > JMPNZ_EX                                         ~13     $12, ->26
         22    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         23        DO_FCALL                                      0  $14     
         24      > EXIT                                                     $14
         25*       BOOL                                             ~13     <true>
   28    26    > > RETURN                                                   null

End of function db_news_edit

Function db_news_remove:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_remove
number of ops:  15
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   31     1        INIT_FCALL_BY_NAME                                       'mysql_query'
          2        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $1      
          5        CONCAT                                           ~2      'DELETE+FROM+news+WHERE+id+%3D+%27', $1
          6        CONCAT                                           ~3      ~2, '%27'
          7        SEND_VAL_EX                                              ~3
          8        DO_FCALL                                      0  $4      
          9      > JMPNZ_EX                                         ~5      $4, ->14
         10    >   INIT_FCALL_BY_NAME                                       'mysql_error'
         11        DO_FCALL                                      0  $6      
         12      > EXIT                                                     $6
         13*       BOOL                                             ~5      <true>
   32    14    > > RETURN                                                   null

End of function db_news_remove

Function db_news_globalget:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_globalGET
number of ops:  20
compiled vars:  !0 = $id, !1 = $what, !2 = $query, !3 = $get
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   35     2        INIT_FCALL_BY_NAME                                       'mysql_query'
          3        INIT_FCALL_BY_NAME                                       'mysql_real_escape_string'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      'SELECT+%2A+FROM+news+WHERE+id%3D%27', $4
          7        CONCAT                                           ~6      ~5, '%27'
          8        SEND_VAL_EX                                              ~6
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !2, $7
   36    11        INIT_FCALL_BY_NAME                                       'mysql_fetch_array'
         12        SEND_VAR_EX                                              !2
         13        FETCH_CONSTANT                                   ~9      'MYSQL_ASSOC'
         14        SEND_VAL_EX                                              ~9
         15        DO_FCALL                                      0  $10     
         16        ASSIGN                                                   !3, $10
   37    17        FETCH_DIM_R                                      ~12     !3, !1
         18      > RETURN                                                   ~12
   38    19*     > RETURN                                                   null

End of function db_news_globalget

Function db_news_header:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_header
number of ops:  7
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV                                             !0      
   41     1        INIT_FCALL                                               'db_news_globalget'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'header'
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
   42     6*     > RETURN                                                   null

End of function db_news_header

Function db_news_text:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_text
number of ops:  7
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
   45     1        INIT_FCALL                                               'db_news_globalget'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'text'
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
   46     6*     > RETURN                                                   null

End of function db_news_text

Function db_news_author:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_author
number of ops:  7
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   RECV                                             !0      
   49     1        INIT_FCALL                                               'db_news_globalget'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'author'
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
   50     6*     > RETURN                                                   null

End of function db_news_author

Function db_news_lastedit:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/v33It
function name:  db_news_lastedit
number of ops:  7
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   RECV                                             !0      
   53     1        INIT_FCALL                                               'db_news_globalget'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'lastedit'
          4        DO_FCALL                                      0  $1      
          5      > RETURN                                                   $1
   54     6*     > RETURN                                                   null

End of function db_news_lastedit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.76 ms | 1415 KiB | 23 Q