1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
--TEST--
PostgreSQL fetching default link automatically is deprecated
--EXTENSIONS--
pgsql
--SKIPIF--
<?php include("inc/skipif.inc"); ?>
--FILE--
<?php
include('inc/config.inc');
$db = pg_connect($conn_str);
// We don't care about warnings
ini_set('error_reporting', E_ALL&~E_WARNING);
// Special cases
pg_set_error_verbosity(PGSQL_ERRORS_TERSE);
pg_query_params('str', []);
pg_execute('str', []);
pg_lo_unlink(1);
// deprecated alias 'pg_lounlink',
pg_lo_open(1, 'r');
// deprecated alias 'pg_loopen',
pg_lo_export(1, '');
// deprecated alias 'pg_loexport',
$functions = [
'pg_dbname',
'pg_last_error',
// deprecated alias 'pg_errormessage',
'pg_options',
'pg_port',
'pg_tty',
'pg_host',
'pg_version',
'pg_parameter_status',
'pg_ping',
'pg_query',
'pg_exec',
'pg_prepare',
'pg_untrace',
'pg_lo_create',
// deprecated alias 'pg_locreate',
'pg_lo_import',
// deprecated alias 'pg_loimport',
'pg_set_client_encoding',
// deprecated alias 'pg_setclientencoding',
'pg_client_encoding',
// deprecated alias 'pg_clientencoding',
'pg_end_copy',
'pg_put_line',
'pg_escape_string',
'pg_escape_bytea',
'pg_escape_literal',
'pg_escape_identifier',
'pg_close',
];
foreach ($functions as $function) {
$args = [];
$argNum = 0;
retry:
try {
$function(...$args);
continue;
} catch (ArgumentCountError) {
$args[] = 'str';
++$argNum;
goto retry;
} catch (TypeError $e) {
if (str_contains($e->getMessage(), 'type array')) {
$args[$argNum] = [];
goto retry;
}
var_dump($e->getMessage());
} catch (\Error $e) {
echo $e->getMessage();
}
}
echo "END";
?>
--EXPECTF--
Deprecated: pg_set_error_verbosity(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_query_params(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_execute(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_lo_unlink(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_lo_open(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_lo_export(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_dbname(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_last_error(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_options(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_port(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_tty(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_host(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_version(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_parameter_status(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_ping(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_query(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_exec(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_prepare(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_untrace(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_lo_create(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_lo_import(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_set_client_encoding(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_client_encoding(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_end_copy(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_put_line(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_escape_bytea(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_escape_literal(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_escape_identifier(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
Deprecated: pg_close(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d
END
|