Files
php-src/ext/pgsql/tests/bug46408.phpt
KentarouTakeda c15988aab3 ext/pgsql: Refactor tests (#12608)
This makes the tests independent of each other and allows them to be run in parallel.

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2023-11-06 22:36:52 +00:00

29 lines
625 B
PHP

--TEST--
Bug #46408 (Locale number format settings can cause pg_query_params to break with numerics)
--EXTENSIONS--
pgsql
--SKIPIF--
<?php
require_once('inc/skipif.inc');
if (false === setlocale(LC_ALL, "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8")) {
echo "skip Locale de-DE not present";
}
?>
--FILE--
<?php
require_once('inc/config.inc');
$dbh = pg_connect($conn_str);
setlocale(LC_ALL, "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8");
echo 3.5 , "\n";
pg_query_params($dbh, "SELECT $1::numeric", array(3.5));
pg_close($dbh);
echo "Done".PHP_EOL;
?>
--EXPECT--
3.5
Done