odbc_pconnect

FunctionParams and return types changed in PHP 8.4

Open a persistent database connection.

PHP 5
PHP 7
PHP 8.0
Improved
PHP 8.1
PHP 8.2
Changed
PHP 8.3
PHP 8.4
Improved
PHP 8.5
PHP 8.6

odbc_pconnect Function synopsis

odbc_pconnect(
    string $dsn,
    ?string $user = null,
    ?string $password = null,
    int $cursor_option = SQL_CUR_USE_DRIVER
  ): Odbc\Connection|false

Parameters

$dsn

Typestring

$user

OptionalType?stringDefault valuenull

$password

OptionalType?stringDefault valuenull

$cursor_option

OptionalTypeintDefault valueSQL_CUR_USE_DRIVER

Return value

TypeOdbc\Connection|false

Returns an ODBC connection, or false on failure.

Changes to the odbc_pconnect Function

PHP 8.4

  • Return type added: Odbc\Connection|false
  • Parameter type changed for parameter #2 ($user): string to ?string
  • Parameter default value added for position #2 ($user): null
  • Parameter type changed for parameter #3 ($password): string to ?string
  • Parameter default value added for position #3 ($password): null
  odbc_pconnect(
      string $dsn,
-     string $user,
+     ?string $user = null,
-     string $password,
+     ?string $password = null,
      int $cursor_option = SQL_CUR_USE_DRIVER
-   )
+   ): Odbc\Connection|false

PHP 8.2

PHP 8.0

  • Parameter type added for parameter #1 ($dsn): string
  • Parameter type added for parameter #2 ($user): string
  • Parameter type added for parameter #3 ($password): string
  • Parameter type added for parameter #4 ($cursor_option): int
  • Parameter default value added for position #4 ($cursor_option): SQL_CUR_USE_DRIVER
  odbc_pconnect(
-     $dsn,
+     string $dsn,
-     $user,
+     string $user,
-     $password,
+     string $password,
-     $cursor_option
+     int $cursor_option = SQL_CUR_USE_DRIVER
    )

odbc_pconnect Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported Yes
PHP 5.5Unsupported Yes
PHP 5.4Unsupported Yes
PHP 5.3Unsupported Yes