gzopen

FunctionParams changed in PHP 8.5

Open gz-file.

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

gzopen Function synopsis

gzopen(
    string $filename,
    string $mode,
    bool $use_include_path = false
  )

Parameters

$filename

Typestring

The file name.

$mode

Typestring

As in fopen (rb or wb) but can also include a compression level (wb9) or a strategy: f for filtered data as in wb6f, h for Huffman only compression as in wb1h. (See the description of deflateInit2 in zlib.h for more information about the strategy parameter.)

$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.

Changes to the gzopen Function

PHP 8.5

  • Parameter type changed for parameter #3 ($use_include_path): int to bool
  • Parameter default value changed for position #3 ($use_include_path): 0 to false
  gzopen(
      string $filename,
      string $mode,
-     int $use_include_path = 0
+     bool $use_include_path = false
    )

PHP 8.0

  • Parameter type added for parameter #1 ($filename): string
  • Parameter type added for parameter #2 ($mode): string
  • Parameter type added for parameter #3 ($use_include_path): int
  • Parameter default value added for position #3 ($use_include_path): 0
  gzopen(
-     $filename,
+     string $filename,
-     $mode,
+     string $mode,
-     $use_include_path
+     int $use_include_path = 0
    )

gzopen 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