File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ pgsqlSetNoticeCallback catches Postgres "raise notice".
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('pdo ' ) || !extension_loaded ('pdo_pgsql ' )) die ('skip not loaded ' );
6
+ require_once dirname (__FILE__ ) . '/../../../ext/pdo/tests/pdo_test.inc ' ;
7
+ require_once dirname (__FILE__ ) . '/config.inc ' ;
8
+ PDOTest::skip ();
9
+ ?>
10
+ --FILE--
11
+ <?php
12
+ function disp ($ message ) { echo trim ($ message )."\n" ; }
13
+ function attach ($ db )
14
+ {
15
+ $ db ->pgsqlSetNoticeCallback (function ($ message ) { echo trim ($ message )."\n" ; });
16
+ // https://github.com/php/php-src/pull/4823#pullrequestreview-335623806
17
+ $ eraseCallbackMemoryHere = (object )[1 ];
18
+ }
19
+ require dirname (__FILE__ ) . '/issue78621.inc ' ;
20
+ ?>
21
+ --EXPECT--
22
+ NOTICE: I tampered your data, did you know?
23
+ array(1) {
24
+ [0]=>
25
+ array(1) {
26
+ ["a"]=>
27
+ string(2) "oh"
28
+ }
29
+ }
30
+ Done
You can’t perform that action at this time.
0 commit comments