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