1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 14:12:38 +02:00
Files
archived-php-src/ext/pgsql/tests/gh10672.phpt
George Peter Banyard 5f357f341d Fix GH-10672 (pg_lo_open segfaults in the strict_types mode)
We need to use the proper ZPP qualifier for zend_string

Closes GH-10677
2023-02-24 14:31:23 +00:00

40 lines
735 B
PHP

--TEST--
GH-10672 (pg_lo_open segfaults in the strict_types mode)
--EXTENSIONS--
pgsql
--SKIPIF--
<?php
include("skipif.inc");
?>
--FILE--
<?php
declare(strict_types=1);
include "config.inc";
$db = pg_connect($conn_str);
pg_query($db, "DROP TABLE IF EXISTS gh10672");
pg_query($db, "CREATE TABLE gh10672 (bar text);");
// Begin a transaction
pg_query($db, 'BEGIN');
// Create an empty large object
$oid = pg_lo_create($db);
if ($oid === false) {
die(pg_last_error($db));
}
// Open the large object for writing
$lob = pg_lo_open($db, $oid, 'w');
if ($oid === false) {
die(pg_last_error($db));
}
echo 'The large object has been opened successfully.', PHP_EOL;
?>
--EXPECT--
The large object has been opened successfully.