3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); function gzdecode_filler( $data, $length = 0 ) { $fp = fopen( 'compress.zlib://data:application/x-gzip;base64,' . base64_encode( $data ), 'r' ); $length = (int)$length; $max = 32768 * strlen( $data ); $max = $length ? min( $length, $max ) : $max; $decoded = fread( $fp, $max + 1 ); if ( $decoded === false || strlen( $decoded ) > $max ) { return false; } return $decoded; } var_dump(gzdecode_filler(pack('H*', "1f8b08000000000000030bc94855282ccd4cce56482aca2fcf5348cbaf50c82acd2d2856c82f4b2d5228014ae72456552aa4e4a7eb0100e92590522c000000")));
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
bool(false)
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
string(0) ""
Output for 4.3.5 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Warning: fopen(compress.zlib://data:application/x-gzip;base64,H4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFIsAAAA): failed to open stream: No such file or directory in /in/vlFs0 on line 6 Warning: fread(): supplied argument is not a valid stream resource in /in/vlFs0 on line 11 bool(false)
Output for 4.3.2 - 4.3.4
Warning: fopen(compress.zlib://data:application/x-gzip;base64,H4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFIsAAAA): failed to open stream: No such file or directory in /in/vlFs0 on line 6 Warning: fread(): supplied argument is not a valid stream resource in /in/vlFs0 on line 11 NULL
Output for 4.3.0 - 4.3.1
Warning: fopen(compress.zlib://data:application/x-gzip;base64,H4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFIsAAAA) [http://www.php.net/function.fopen]: failed to create stream: No such file or directory in /in/vlFs0 on line 6 Warning: fread(): supplied argument is not a valid stream resource in /in/vlFs0 on line 11 NULL

preferences:
238.33 ms | 402 KiB | 370 Q