1--TEST--
2Pdo\Pgsql::setNoticeCallback()
3--EXTENSIONS--
4pdo
5pdo_pgsql
6--SKIPIF--
7<?php
8require __DIR__ . '/config.inc';
9require dirname(__DIR__, 2) . '/pdo/tests/pdo_test.inc';
10PDOTest::skip();
11?>
12--FILE--
13<?php
14
15require_once __DIR__ . "/config.inc";
16
17$db = new Pdo\Pgsql($config['ENV']['PDOTEST_DSN']);
18
19function disp($message) { echo trim($message)."\n"; }
20function attach($db, $callback) { $db->setNoticeCallback($callback); }
21
22$rounds = [
23    'disp', // Correct.
24    3, // Error, so the old callback is kept, and will be used in the call that follows the caught error.
25    null, // No callback. Hopefully this clears everything.
26    'wouldAnyoneNameAFunctionThatWay', // So this one will crash and *no output will follow*.
27];
28require __DIR__ . '/issue78621.inc';
29
30?>
31--EXPECTF--
32NOTICE:  I tampered your data, did you know?
33Caught TypeError: %s: Argument #1 ($callback) %s
34NOTICE:  I tampered your data, did you know?
35Caught TypeError: %s: Argument #1 ($callback) %s
36array(1) {
37  [0]=>
38  array(1) {
39    ["a"]=>
40    string(2) "oh"
41  }
42}
43Done
44