xref: /PHP-7.1/ext/mysqli/tests/bug28817.phpt (revision 113213f0)
1--TEST--
2Bug #28817 (problems with properties declared in the class extending MySQLi)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10	require_once("connect.inc");
11
12	class my_mysql extends mysqli {
13		public $p_test;
14
15		function __construct() {
16			$this->p_test[] = "foo";
17			$this->p_test[] = "bar";
18		}
19	}
20
21
22	$mysql = new my_mysql();
23
24	var_dump($mysql->p_test);
25	@var_dump($mysql->errno);
26
27	$mysql->connect($host, $user, $passwd, $db, $port, $socket);
28	$mysql->select_db("nonexistingdb");
29
30	var_dump($mysql->errno > 0);
31
32	$mysql->close();
33?>
34--EXPECTF--
35array(2) {
36  [0]=>
37  %s(3) "foo"
38  [1]=>
39  %s(3) "bar"
40}
41NULL
42bool(true)
43