gzfile

FunctionParams changed in PHP 8.5

Read entire gz-file into an array.

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

gzfile Function synopsis

gzfile(string $filename, bool $use_include_path = false): array|false

Parameters

$filename

Typestring

The file name.

$use_include_path

OptionalTypeboolDefault valuefalse

You can set this optional parameter to 1, if you want to search for the file in the include_pathtoo.

Return value

Typearray|false

An array containing the file, one line per cell, empty lines included, and with newlines still attached, or false on failure.

Changes to the gzfile Function

PHP 8.5

  • Parameter type changed for parameter #2 ($use_include_path): int to bool
  • Parameter default value changed for position #2 ($use_include_path): 0 to false
- gzfile(string $filename, int $use_include_path = 0): array|false
+ gzfile(string $filename, bool $use_include_path = false): array|false

PHP 8.0

  • Return type added: array|false
  • Parameter type added for parameter #1 ($filename): string
  • Parameter type added for parameter #2 ($use_include_path): int
  • Parameter default value added for position #2 ($use_include_path): 0
- gzfile($filename, $use_include_path)
+ gzfile(string $filename, int $use_include_path = 0): array|false

gzfile Function Availability

PHP VersionAvailability
PHP 8.6Future Release Yes
PHP 8.5Upcoming Release Yes
PHP 8.4Supported (Latest) Yes
PHP 8.3Supported Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Security-Fixes Only 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