xref: /PHP-8.0/ext/mysqli/tests/gh8068.phpt (revision ef29ddcc)
1--TEST--
2GH-8068 (mysqli_fetch_object creates inaccessible properties)
3--SKIPIF--
4<?php
5require_once 'skipif.inc';
6require_once 'skipifconnectfailure.inc';
7?>
8--FILE--
9<?php
10require_once "connect.inc";
11mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
12$mysqli = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
13$res = $mysqli->query('SELECT 42');
14$obj = $res->fetch_object();
15var_dump(
16    $obj,
17    $obj->{42}
18);
19?>
20--EXPECT--
21object(stdClass)#4 (1) {
22  ["42"]=>
23  string(2) "42"
24}
25string(2) "42"
26