3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * SAE Mysql服务 * * 支持主从分离 * * @author Easychen <easychen@gmail.com> * @version $Id$ * @package sae * */ /** * Sae Mysql Class * * <code> * <?php * $mysql = new SaeMysql(); * * $sql = "SELECT * FROM `user` LIMIT 10"; * $data = $mysql->getData( $sql ); * $name = strip_tags( $_REQUEST['name'] ); * $age = intval( $_REQUEST['age'] ); * $sql = "INSERT INTO `user` ( `name` , `age` , `regtime` ) VALUES ( '" . $mysql->escape( $name ) . "' , '" . intval( $age ) . "' , NOW() ) "; * $mysql->runSql( $sql ); * if( $mysql->errno() != 0 ) * { * die( "Error:" . $mysql->errmsg() ); * } * * $mysql->closeDb(); * ?> * </code> * * @package sae * @author EasyChen * */ class SaeMysql { /** * 构造函数 * * @param bool $do_replication 是否支持主从分离,true:支持,false:不支持,默认为true * @return void * @author EasyChen */ function __construct( $do_replication = true ) { $this->port = 3307; $this->host = '.rdc.sae.sina.com.cn'; $this->accesskey = SAE_ACCESSKEY; $this->secretkey = SAE_SECRETKEY; $this->appname = 'app_' . $_SERVER['HTTP_APPNAME']; //set default charset as utf8 $this->charset = 'UTF8'; $this->do_replication = $do_replication; } /** * 设置keys * * 当需要连接其他APP的数据库时使用 * * @param string $akey AccessKey * @param string $skey SecretKey * @return void * @author EasyChen */ public function setAuth( $akey , $skey ) { $this->accesskey = $akey; $this->secretkey = $skey; } /** * 设置Mysql服务器端口 * * 当需要连接其他APP的数据库时使用 * * @param string $port * @return void * @author EasyChen */ public function setPort( $port ) { $this->port = 3307; $this->host = '.rdc.sae.sina.com.cn'; } /** * 设置Appname * * 当需要连接其他APP的数据库时使用 * * @param string $appname * @return void * @author EasyChen */ public function setAppname( $appname ) { $this->appname = 'app_' . $appname; } /** * 设置当前连接的字符集 , 必须在发起连接之前进行设置 * * @param string $charset 字符集,如GBK,GB2312,UTF8 * @return void */ public function setCharset( $charset ) { return $this->set_charset( $charset ); } /** * 同setCharset,向前兼容 * * @param string $charset * @return void * @ignore */ public function set_charset( $charset ) { $this->charset = $charset; } /** * 运行Sql语句,不返回结果集 * * @param string $sql * @return mysqli_result|bool */ public function runSql( $sql ) { return $this->run_sql( $sql ); } /** * 同runSql,向前兼容 * * @param string $sql * @return bool * @author EasyChen * @ignore */ public function run_sql( $sql ) { $this->last_sql = $sql; $dblink = $this->db_write(); if ($dblink === false) { return false; } $ret = mysqli_query( $dblink, $sql ); $this->save_error( $dblink ); return $ret; } /** * 运行Sql,以多维数组方式返回结果集 * * @param string $sql * @return array 成功返回数组,失败时返回false * @author EasyChen */ public function getData( $sql ) { return $this->get_data( $sql ); } /** * 同getData,向前兼容 * * @ignore */ public function get_data( $sql ) { $this->last_sql = $sql; $data = Array(); $i = 0; $dblink = $this->do_replication ? $this->db_read() : $this->db_write(); if ($dblink === false) { return false; } $result = mysqli_query( $dblink , $sql ); $this->save_error( $dblink ); if (is_bool($result)) { return $result; } else { while( $Array = mysqli_fetch_array( $result, MYSQL_ASSOC ) ) { $data[$i++] = $Array; } } mysqli_free_result($result); if( count( $data ) > 0 ) return $data; else return NULL; } /** * 运行Sql,以数组方式返回结果集第一条记录 * * @param string $sql * @return array 成功返回数组,失败时返回false * @author EasyChen */ public function getLine( $sql ) { return $this->get_line( $sql ); } /** * 同getLine,向前兼容 * * @param string $sql * @return array * @author EasyChen * @ignore */ public function get_line( $sql ) { $data = $this->get_data( $sql ); if ($data) { return @reset($data); } else { return false; } } /** * 运行Sql,返回结果集第一条记录的第一个字段值 * * @param string $sql * @return mixxed 成功时返回一个值,失败时返回false * @author EasyChen */ public function getVar( $sql ) { return $this->get_var( $sql ); } /** * 同getVar,向前兼容 * * @param string $sql * @return array * @author EasyChen * @ignore */ public function get_var( $sql ) { $data = $this->get_line( $sql ); if ($data) { return $data[ @reset(@array_keys( $data )) ]; } else { return false; } } /** * 同mysqli_affected_rows函数 * * @return int 成功返回行数,失败时返回-1 * @author Elmer Zhang */ public function affectedRows() { $result = isset($this->db_write) ? mysqli_affected_rows( $this->db_write ) : -1; return $result; } /** * 同mysqli_insert_id函数 * * @return int 成功返回last_id,失败时返回false * @author EasyChen */ public function lastId() { return $this->last_id(); } /** * 同lastId,向前兼容 * * @return int * @author EasyChen * @ignore */ public function last_id() { $result = mysqli_insert_id( $this->db_write( false ) ); return $result; } /** * 关闭数据库连接 * * @return bool * @author EasyChen */ public function closeDb() { return $this->close_db(); } /** * 同closeDb,向前兼容 * * @return bool * @author EasyChen * @ignore */ public function close_db() { if( isset( $this->db_read ) ) @mysqli_close( $this->db_read ); if( isset( $this->db_write ) ) @mysqli_close( $this->db_write ); } /** * 同mysqli_real_escape_string * * @param string $str * @return string * @author EasyChen */ public function escape( $str ) { if( isset($this->db_read) ) { $db = $this->db_read; } elseif( isset($this->db_write) ) { $db = $this->db_write; } else { $db = $this->db_read(); } return mysqli_real_escape_string( $db , $str ); } /** * 返回错误码 * * * @return int * @author EasyChen */ public function errno() { return $this->errno; } /** * 返回错误信息 * * @return string * @author EasyChen */ public function error() { return $this->error; } /** * 返回错误信息,error的别名 * * @return string * @author EasyChen */ public function errmsg() { return $this->error(); } /** * @ignore */ private function connect( $is_master = true ) { if ($this->port == 0) { $this->error = 13048; $this->errno = 'Not Initialized'; return false; } if( $is_master ) $host = 'w' . $this->host; else $host = 'r' . $this->host; $db = mysqli_init(); mysqli_options($db, MYSQLI_OPT_CONNECT_TIMEOUT, 5); if( !mysqli_real_connect( $db, $host , $this->accesskey , $this->secretkey , $this->appname , $this->port ) ) { $this->error = mysqli_connect_error(); $this->errno = mysqli_connect_errno(); return false; } mysqli_set_charset( $db, $this->charset); return $db; } /** * @ignore */ private function db_read() { if( isset( $this->db_read ) && mysqli_ping( $this->db_read ) ) { return $this->db_read; } else { if( !$this->do_replication ) return $this->db_write(); else { $this->db_read = $this->connect( false ); return $this->db_read; } } } /** * @ignore */ private function db_write( $reconnect = true ) { if( isset( $this->db_write ) && ( $reconnect == false || mysqli_ping( $this->db_write ) ) ) { return $this->db_write; } else { $this->db_write = $this->connect( true ); return $this->db_write; } } /** * @ignore */ private function save_error($dblink) { $this->error = mysqli_error($dblink); $this->errno = mysqli_errno($dblink); } private $error; private $errno; private $last_sql; } //Documentation generated on Tue, 25 Feb 2014 21:24:45 +0800 by phpDocumentor 1.4.3 $mysql = new SaeMysql();//sae内部类链接数据 $num = "SELECT * FROM `message` "; $mysql->runSql($num); $no=$mysql->affectedRows();//获取行数 echo $no; printf($no);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $mysql, !1 = $num, !2 = $no
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  477     0  E >   NEW                                              $3      'SaeMysql'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
  478     3        ASSIGN                                                   !1, 'SELECT+%2A+FROM+%60message%60+'
  479     4        INIT_METHOD_CALL                                         !0, 'runSql'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
  480     7        INIT_METHOD_CALL                                         !0, 'affectedRows'
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !2, $8
  481    10        ECHO                                                     !2
  482    11        INIT_FCALL                                               'printf'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class SaeMysql:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  __construct
number of ops:  21
compiled vars:  !0 = $do_replication
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   RECV_INIT                                        !0      <true>
   51     1        ASSIGN_OBJ                                               'port'
          2        OP_DATA                                                  3307
   52     3        ASSIGN_OBJ                                               'host'
          4        OP_DATA                                                  '.rdc.sae.sina.com.cn'
   54     5        FETCH_CONSTANT                                   ~4      'SAE_ACCESSKEY'
          6        ASSIGN_OBJ                                               'accesskey'
          7        OP_DATA                                                  ~4
   55     8        FETCH_CONSTANT                                   ~6      'SAE_SECRETKEY'
          9        ASSIGN_OBJ                                               'secretkey'
         10        OP_DATA                                                  ~6
   56    11        FETCH_R                      global              ~8      '_SERVER'
         12        FETCH_DIM_R                                      ~9      ~8, 'HTTP_APPNAME'
         13        CONCAT                                           ~10     'app_', ~9
         14        ASSIGN_OBJ                                               'appname'
         15        OP_DATA                                                  ~10
   59    16        ASSIGN_OBJ                                               'charset'
         17        OP_DATA                                                  'UTF8'
   61    18        ASSIGN_OBJ                                               'do_replication'
         19        OP_DATA                                                  !0
   62    20      > RETURN                                                   null

End of function __construct

Function setauth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  setAuth
number of ops:  7
compiled vars:  !0 = $akey, !1 = $skey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   74     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   76     2        ASSIGN_OBJ                                               'accesskey'
          3        OP_DATA                                                  !0
   77     4        ASSIGN_OBJ                                               'secretkey'
          5        OP_DATA                                                  !1
   78     6      > RETURN                                                   null

End of function setauth

Function setport:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  setPort
number of ops:  6
compiled vars:  !0 = $port
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   89     0  E >   RECV                                             !0      
   91     1        ASSIGN_OBJ                                               'port'
          2        OP_DATA                                                  3307
   92     3        ASSIGN_OBJ                                               'host'
          4        OP_DATA                                                  '.rdc.sae.sina.com.cn'
   94     5      > RETURN                                                   null

End of function setport

Function setappname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  setAppname
number of ops:  5
compiled vars:  !0 = $appname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  105     0  E >   RECV                                             !0      
  107     1        CONCAT                                           ~2      'app_', !0
          2        ASSIGN_OBJ                                               'appname'
          3        OP_DATA                                                  ~2
  108     4      > RETURN                                                   null

End of function setappname

Function setcharset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  setCharset
number of ops:  6
compiled vars:  !0 = $charset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  117     0  E >   RECV                                             !0      
  119     1        INIT_METHOD_CALL                                         'set_charset'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
  120     5*     > RETURN                                                   null

End of function setcharset

Function set_charset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  set_charset
number of ops:  4
compiled vars:  !0 = $charset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  129     0  E >   RECV                                             !0      
  131     1        ASSIGN_OBJ                                               'charset'
          2        OP_DATA                                                  !0
  132     3      > RETURN                                                   null

End of function set_charset

Function runsql:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  runSql
number of ops:  6
compiled vars:  !0 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  140     0  E >   RECV                                             !0      
  142     1        INIT_METHOD_CALL                                         'run_sql'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
  143     5*     > RETURN                                                   null

End of function runsql

Function run_sql:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  run_sql
number of ops:  19
compiled vars:  !0 = $sql, !1 = $dblink, !2 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  153     0  E >   RECV                                             !0      
  155     1        ASSIGN_OBJ                                               'last_sql'
          2        OP_DATA                                                  !0
  156     3        INIT_METHOD_CALL                                         'db_write'
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !1, $4
  157     6        TYPE_CHECK                                    4          !1
          7      > JMPZ                                                     ~6, ->9
  158     8    > > RETURN                                                   <false>
  160     9    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0  $7      
         13        ASSIGN                                                   !2, $7
  161    14        INIT_METHOD_CALL                                         'save_error'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0          
  162    17      > RETURN                                                   !2
  163    18*     > RETURN                                                   null

End of function run_sql

Function getdata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  getData
number of ops:  6
compiled vars:  !0 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  172     0  E >   RECV                                             !0      
  174     1        INIT_METHOD_CALL                                         'get_data'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
  175     5*     > RETURN                                                   null

End of function getdata

Function get_data:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 31
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 31
Branch analysis from position: 41
Branch analysis from position: 31
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
Branch analysis from position: 18
filename:       /in/VS3tJ
function name:  get_data
number of ops:  51
compiled vars:  !0 = $sql, !1 = $data, !2 = $i, !3 = $dblink, !4 = $result, !5 = $Array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  182     0  E >   RECV                                             !0      
  184     1        ASSIGN_OBJ                                               'last_sql'
          2        OP_DATA                                                  !0
  185     3        ASSIGN                                                   !1, <array>
  186     4        ASSIGN                                                   !2, 0
  187     5        FETCH_OBJ_R                                      ~9      'do_replication'
          6      > JMPZ                                                     ~9, ->11
          7    >   INIT_METHOD_CALL                                         'db_read'
          8        DO_FCALL                                      0  $10     
          9        QM_ASSIGN                                        ~11     $10
         10      > JMP                                                      ->14
         11    >   INIT_METHOD_CALL                                         'db_write'
         12        DO_FCALL                                      0  $12     
         13        QM_ASSIGN                                        ~11     $12
         14    >   ASSIGN                                                   !3, ~11
  188    15        TYPE_CHECK                                    4          !3
         16      > JMPZ                                                     ~14, ->18
  189    17    > > RETURN                                                   <false>
  191    18    >   INIT_FCALL_BY_NAME                                       'mysqli_query'
         19        SEND_VAR_EX                                              !3
         20        SEND_VAR_EX                                              !0
         21        DO_FCALL                                      0  $15     
         22        ASSIGN                                                   !4, $15
  193    23        INIT_METHOD_CALL                                         'save_error'
         24        SEND_VAR_EX                                              !3
         25        DO_FCALL                                      0          
  195    26        TYPE_CHECK                                   12          !4
         27      > JMPZ                                                     ~18, ->30
  196    28    > > RETURN                                                   !4
         29*       JMP                                                      ->41
  198    30    > > JMP                                                      ->34
  200    31    >   POST_INC                                         ~19     !2
         32        ASSIGN_DIM                                               !1, ~19
         33        OP_DATA                                                  !5
  198    34    >   INIT_FCALL_BY_NAME                                       'mysqli_fetch_array'
         35        SEND_VAR_EX                                              !4
         36        FETCH_CONSTANT                                   ~21     'MYSQL_ASSOC'
         37        SEND_VAL_EX                                              ~21
         38        DO_FCALL                                      0  $22     
         39        ASSIGN                                           ~23     !5, $22
         40      > JMPNZ                                                    ~23, ->31
  204    41    >   INIT_FCALL_BY_NAME                                       'mysqli_free_result'
         42        SEND_VAR_EX                                              !4
         43        DO_FCALL                                      0          
  206    44        COUNT                                            ~25     !1
         45        IS_SMALLER                                               0, ~25
         46      > JMPZ                                                     ~26, ->49
  207    47    > > RETURN                                                   !1
         48*       JMP                                                      ->50
  209    49    > > RETURN                                                   null
  210    50*     > RETURN                                                   null

End of function get_data

Function getline:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  getLine
number of ops:  6
compiled vars:  !0 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  219     0  E >   RECV                                             !0      
  221     1        INIT_METHOD_CALL                                         'get_line'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
  222     5*     > RETURN                                                   null

End of function getline

Function get_line:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  get_line
number of ops:  15
compiled vars:  !0 = $sql, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  232     0  E >   RECV                                             !0      
  234     1        INIT_METHOD_CALL                                         'get_data'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
  235     5      > JMPZ                                                     !1, ->13
  236     6    >   BEGIN_SILENCE                                    ~4      
          7        INIT_FCALL                                               'reset'
          8        SEND_REF                                                 !1
          9        DO_ICALL                                         $5      
         10        END_SILENCE                                              ~4
         11      > RETURN                                                   $5
         12*       JMP                                                      ->14
  238    13    > > RETURN                                                   <false>
  240    14*     > RETURN                                                   null

End of function get_line

Function getvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  getVar
number of ops:  6
compiled vars:  !0 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  249     0  E >   RECV                                             !0      
  251     1        INIT_METHOD_CALL                                         'get_var'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
  252     5*     > RETURN                                                   null

End of function getvar

Function get_var:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 19
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  get_var
number of ops:  21
compiled vars:  !0 = $sql, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  262     0  E >   RECV                                             !0      
  264     1        INIT_METHOD_CALL                                         'get_line'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
  265     5      > JMPZ                                                     !1, ->19
  266     6    >   BEGIN_SILENCE                                    ~4      
          7        INIT_FCALL                                               'reset'
          8        BEGIN_SILENCE                                    ~5      
          9        INIT_FCALL                                               'array_keys'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $6      
         12        END_SILENCE                                              ~5
         13        SEND_VAR_NO_REF                               0          $6
         14        DO_ICALL                                         $7      
         15        END_SILENCE                                              ~4
         16        FETCH_DIM_R                                      ~8      !1, $7
         17      > RETURN                                                   ~8
         18*       JMP                                                      ->20
  268    19    > > RETURN                                                   <false>
  270    20*     > RETURN                                                   null

End of function get_var

Function affectedrows:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  affectedRows
number of ops:  13
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  280     0  E >   ISSET_ISEMPTY_PROP_OBJ                                   'db_write'
          1      > JMPZ                                                     ~1, ->9
          2    >   INIT_FCALL_BY_NAME                                       'mysqli_affected_rows'
          3        CHECK_FUNC_ARG                                           
          4        FETCH_OBJ_FUNC_ARG                               $2      'db_write'
          5        SEND_FUNC_ARG                                            $2
          6        DO_FCALL                                      0  $3      
          7        QM_ASSIGN                                        ~4      $3
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~4      -1
         10    >   ASSIGN                                                   !0, ~4
  281    11      > RETURN                                                   !0
  282    12*     > RETURN                                                   null

End of function affectedrows

Function lastid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  lastId
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  292     0  E >   INIT_METHOD_CALL                                         'last_id'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
  293     3*     > RETURN                                                   null

End of function lastid

Function last_id:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  last_id
number of ops:  9
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  304     0  E >   INIT_FCALL_BY_NAME                                       'mysqli_insert_id'
          1        INIT_METHOD_CALL                                         'db_write'
          2        SEND_VAL_EX                                              <false>
          3        DO_FCALL                                      0  $1      
          4        SEND_VAR_NO_REF_EX                                       $1
          5        DO_FCALL                                      0  $2      
          6        ASSIGN                                                   !0, $2
  305     7      > RETURN                                                   !0
  306     8*     > RETURN                                                   null

End of function last_id

Function closedb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  closeDb
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  316     0  E >   INIT_METHOD_CALL                                         'close_db'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
  317     3*     > RETURN                                                   null

End of function closedb

Function close_db:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 9
filename:       /in/VS3tJ
function name:  close_db
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  328     0  E >   ISSET_ISEMPTY_PROP_OBJ                                   'db_read'
          1      > JMPZ                                                     ~0, ->9
  329     2    >   BEGIN_SILENCE                                    ~1      
          3        INIT_FCALL_BY_NAME                                       'mysqli_close'
          4        CHECK_FUNC_ARG                                           
          5        FETCH_OBJ_FUNC_ARG                               $2      'db_read'
          6        SEND_FUNC_ARG                                            $2
          7        DO_FCALL                                      0          
          8        END_SILENCE                                              ~1
  331     9    >   ISSET_ISEMPTY_PROP_OBJ                                   'db_write'
         10      > JMPZ                                                     ~4, ->18
  332    11    >   BEGIN_SILENCE                                    ~5      
         12        INIT_FCALL_BY_NAME                                       'mysqli_close'
         13        CHECK_FUNC_ARG                                           
         14        FETCH_OBJ_FUNC_ARG                               $6      'db_write'
         15        SEND_FUNC_ARG                                            $6
         16        DO_FCALL                                      0          
         17        END_SILENCE                                              ~5
  334    18    > > RETURN                                                   null

End of function close_db

Function escape:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VS3tJ
function name:  escape
number of ops:  20
compiled vars:  !0 = $str, !1 = $db
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  343     0  E >   RECV                                             !0      
  345     1        ISSET_ISEMPTY_PROP_OBJ                                   'db_read'
          2      > JMPZ                                                     ~2, ->6
  346     3    >   FETCH_OBJ_R                                      ~3      'db_read'
          4        ASSIGN                                                   !1, ~3
          5      > JMP                                                      ->14
  347     6    >   ISSET_ISEMPTY_PROP_OBJ                                   'db_write'
          7      > JMPZ                                                     ~5, ->11
  348     8    >   FETCH_OBJ_R                                      ~6      'db_write'
          9        ASSIGN                                                   !1, ~6
         10      > JMP                                                      ->14
  350    11    >   INIT_METHOD_CALL                                         'db_read'
         12        DO_FCALL                                      0  $8      
         13        ASSIGN                                                   !1, $8
  353    14    >   INIT_FCALL_BY_NAME                                       'mysqli_real_escape_string'
         15        SEND_VAR_EX                                              !1
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0  $10     
         18      > RETURN                                        

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.22 ms | 1428 KiB | 19 Q