From 1df8175b6153865e2f12394792e3ad4c7c8e48ea Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 31 May 2019 11:51:54 +0200 Subject: Convert fetch_resource warnings into TypeErrors More type checks that are not part of zpp and should generate a TypeError in PHP 8. --- ext/pgsql/tests/bug72197.phpt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ext/pgsql') diff --git a/ext/pgsql/tests/bug72197.phpt b/ext/pgsql/tests/bug72197.phpt index bf9c16978b..7732bfddfc 100644 --- a/ext/pgsql/tests/bug72197.phpt +++ b/ext/pgsql/tests/bug72197.phpt @@ -7,7 +7,11 @@ Bug #72197 pg_lo_create arbitrary read /* This shouldn't crash. */ $var1=-32768; $var2="12"; -pg_lo_create($var1, $var2); +try { + pg_lo_create($var1, $var2); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} /* This should work correctly. */ include('config.inc'); @@ -28,7 +32,7 @@ pg_close($conn); ?> ==DONE== --EXPECTF-- -Warning: pg_lo_create(): supplied resource is not a valid PostgreSQL link resource in %sbug72197.php on line %d%w +pg_lo_create(): supplied resource is not a valid PostgreSQL link resource%w int(%d) int(%d) ==DONE== -- cgit v1.2.1