3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); function gzdecode_filler( $data, $length = 0 ) { $fp = fopen( 'compress.zlib://data:application/x-gzip;base64,' . base64_encode( $data ), 'r' ); fseek( $fp, 0, SEEK_END ); var_dump( ftell( $fp ) ); $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*', "1f8b08000000000000030bc94855282ccd4cce56482aca2fcf5348cbaf50c82acd2d2856c82f4b2d5228014ae72456552aa4e4a7eb0100e92590512c0000001f8b08000000000000030bc94855282ccd4cce56482aca2fcf5348cbaf50c82acd2d2856c82f4b2d5228014ae72456552aa4e4a7eb0100e92590512c000000")));
Output for 5.2.9 - 5.6.28, 7.0.0 - 7.1.0
Warning: fseek(): SEEK_END is not supported in /in/CneNh on line 7 int(0) string(88) "The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog."
Output for hhvm-3.10.0 - 3.12.0
Warning: No such file or directory in /in/CneNh on line 6 Warning: No such file or directory in /in/CneNh on line 6 Warning: fseek() expects parameter 1 to be resource, boolean given in /in/CneNh on line 7 Warning: ftell() expects parameter 1 to be resource, boolean given in /in/CneNh on line 8 bool(false) Warning: fread() expects parameter 1 to be resource, boolean given in /in/CneNh on line 14 bool(false)
Output for 5.2.0 - 5.2.8
bool(false) string(88) "The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog."
Output for 4.3.5 - 5.1.6
Warning: fopen(compress.zlib://data:application/x-gzip;base64,H4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFEsAAAAH4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFEsAAAA): failed to open stream: No such file or directory in /in/CneNh on line 6 Warning: fseek(): supplied argument is not a valid stream resource in /in/CneNh on line 7 Warning: ftell(): supplied argument is not a valid stream resource in /in/CneNh on line 8 bool(false) Warning: fread(): supplied argument is not a valid stream resource in /in/CneNh on line 14 bool(false)
Output for 4.3.2 - 4.3.4
Warning: fopen(compress.zlib://data:application/x-gzip;base64,H4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFEsAAAAH4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFEsAAAA): failed to open stream: No such file or directory in /in/CneNh on line 6 Warning: fseek(): supplied argument is not a valid stream resource in /in/CneNh on line 7 Warning: ftell(): supplied argument is not a valid stream resource in /in/CneNh on line 8 NULL Warning: fread(): supplied argument is not a valid stream resource in /in/CneNh on line 14 NULL
Output for 4.3.0 - 4.3.1
Warning: fopen(compress.zlib://data:application/x-gzip;base64,H4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFEsAAAAH4sIAAAAAAAAAwvJSFUoLM1MzlZIKsovz1NIy69QyCrNLShWyC9LLVIoAUrnJFZVKqTkp+sBAOklkFEsAAAA) [http://www.php.net/function.fopen]: failed to create stream: No such file or directory in /in/CneNh on line 6 Warning: fseek(): supplied argument is not a valid stream resource in /in/CneNh on line 7 Warning: ftell(): supplied argument is not a valid stream resource in /in/CneNh on line 8 NULL Warning: fread(): supplied argument is not a valid stream resource in /in/CneNh on line 14 NULL