xref: /PHP-8.1/ext/pgsql/tests/gh8253.phpt (revision 0e6d6f83)
1--TEST--
2pg_insert() fails for references
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php
7include("skipif.inc");
8?>
9--FILE--
10<?php
11include "config.inc";
12
13function fee(&$a) {}
14$a = ["bar" => "testing"];
15fee($a["bar"]);
16
17$db = pg_connect($conn_str);
18pg_query($db, "DROP TABLE IF EXISTS gh8253");
19pg_query($db, "CREATE TABLE gh8253 (bar text);");
20pg_insert($db, "gh8253", $a);
21$res = pg_query($db, "SELECT * FROM gh8253");
22var_dump(pg_fetch_all($res));
23?>
24--EXPECT--
25array(1) {
26  [0]=>
27  array(1) {
28    ["bar"]=>
29    string(7) "testing"
30  }
31}
32