set_include_path()

set_include_path() — Sets the include_path configuration option.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

Sets the include_path configuration option for the duration of the script.

Signature

set_include_path(string $include_path): string|false

Parameters

ParameterTypeWhat it takes
$include_pathstringThe new value for the include_path

Return value

Returns the old include_path on success or false on failure.

Example

A runnable snippet:

set_include_path('/usr/lib/pear'); // Or using ini_set() ini_set('include_path', '/usr/lib/pear');

See also

ini_set(), get_include_path()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page set_include_path() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.