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://php://memory', 'r+' ); fwrite( $fp, $data ); fseek( $fp, 0 ); $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*', "1f8b08000000000000030bc94855282ccd4cce56482aca2fcf5348cbaf50c82acd2d2856c82f4b2d5228014ae72456552aa4e4a7eb0100e92590512c000000")));
Output for 5.3.28 - 5.3.29, 5.4.20 - 5.6.28, 7.0.0 - 7.1.0
Warning: fopen(compress.zlib://php://memory): failed to open stream: operation failed in /in/R4WPt on line 6 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/R4WPt on line 7 Warning: fseek() expects parameter 1 to be resource, boolean given in /in/R4WPt on line 8 Warning: fread() expects parameter 1 to be resource, boolean given in /in/R4WPt on line 14 bool(false)
Output for hhvm-3.10.0 - 3.12.0
Warning: cannot open a zlib stream for reading and writing at the same time! in /in/R4WPt on line 6 Warning: No such file or directory in /in/R4WPt on line 6 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/R4WPt on line 7 Warning: fseek() expects parameter 1 to be resource, boolean given in /in/R4WPt on line 8 Warning: fread() expects parameter 1 to be resource, boolean given in /in/R4WPt on line 14 bool(false)
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.19
Warning: fopen(compress.zlib://php://memory): failed to open stream: operation failed in /in/bZeJ3 on line 6 Warning: fwrite() expects parameter 1 to be resource, boolean given in /in/bZeJ3 on line 7 Warning: fseek() expects parameter 1 to be resource, boolean given in /in/bZeJ3 on line 8 Warning: fread() expects parameter 1 to be resource, boolean given in /in/bZeJ3 on line 14 bool(false)
Output for 5.2.7 - 5.2.17
Warning: fopen(compress.zlib://php://memory): failed to open stream: operation failed in /in/bZeJ3 on line 6 Warning: fwrite(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 7 Warning: fseek(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 14 bool(false)
Output for 5.2.1 - 5.2.6
Warning: fopen(compress.zlib://php://memory): failed to open stream: Inappropriate ioctl for device in /in/bZeJ3 on line 6 Warning: fwrite(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 7 Warning: fseek(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 14 bool(false)
Output for 4.3.5 - 5.2.0
Warning: fopen(compress.zlib://php://memory): failed to open stream: Success in /in/bZeJ3 on line 6 Warning: fwrite(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 7 Warning: fseek(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 14 bool(false)
Output for 4.3.3 - 4.3.4
Warning: fopen(compress.zlib://php://memory): failed to open stream: Success in /in/bZeJ3 on line 6 Warning: fwrite(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 7 Warning: fseek(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 14 NULL
Output for 4.3.2
Warning: fopen(compress.zlib://php://memory): failed to open stream: Inappropriate ioctl for device in /in/bZeJ3 on line 6 Warning: fwrite(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 7 Warning: fseek(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 14 NULL
Output for 4.3.1
Warning: fopen(compress.zlib://php://memory) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/bZeJ3 on line 6 Warning: fwrite(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 7 Warning: fseek(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/bZeJ3 on line 14 NULL
Output for 4.3.0
Warning: fopen(compress.zlib://php://memory) [http://www.php.net/function.fopen]: failed to create stream: Inappropriate ioctl for device in /in/R4WPt on line 6 Warning: fwrite(): supplied argument is not a valid stream resource in /in/R4WPt on line 7 Warning: fseek(): supplied argument is not a valid stream resource in /in/R4WPt on line 8 Warning: fread(): supplied argument is not a valid stream resource in /in/R4WPt on line 14 NULL