xref: /PHP-8.4/ext/pgsql/tests/pg_trace.phpt (revision c15988aa)
1--TEST--
2pg_trace
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php include("inc/skipif.inc"); ?>
7--FILE--
8<?php
9
10include('inc/config.inc');
11
12$db = pg_connect($conn_str);
13$tracefile = __DIR__ . '/trace.tmp';
14
15try {
16	pg_trace($tracefile, 'w', $db, 56432);
17} catch (ValueError $e) {
18	echo $e->getMessage() . PHP_EOL;
19}
20var_dump(pg_trace($tracefile, 'w', $db, 0));
21$res = pg_query($db, 'SELECT 1');
22
23?>
24--EXPECTF--
25pg_trace(): Argument #4 ($trace_mode) %s
26bool(true)
27