--TEST-- Pdo\Pgsql::setNoticeCallback() use F ZPP for trampoline callback and does not leak --EXTENSIONS-- pdo_pgsql --SKIPIF-- --FILE-- newInstanceWithoutConstructor(); } $db->setNoticeCallback($callback); } class T { public function z($m) { echo $m."\n"; } public function __call($m, $p) { echo "bah $m\n"; } } $t = new T; $rounds = [ [ $t, 'disp' ], 3, // Error; but then as the old callback is kept, it will be used in the call that follows the caught error. null, // No callback: clear everything. 'wouldAnyoneNameAFunctionThisWay', // So this one will crash and *no output will follow*. [ null, [ $t, 'disp' ] ], // Valid callback on an unvalid Pdo. [ $t, 'disp' ], ]; require __DIR__ . '/issue78621.inc'; ?> --EXPECTF-- bah disp Caught TypeError: %s: Argument #1 ($callback) %s bah disp Caught TypeError: %s: Argument #1 ($callback) %s Caught Error: %s object is uninitialized bah disp array(1) { [0]=> array(1) { ["a"]=> string(2) "oh" } } Done