Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test xzopen() function : error conditions --SKIPIF-- <?php if (!extension_loade..

Decoded Output download

skip - XZ extension not loaded*** Testing xzopen() : error conditions ***

-- Testing xzopen() function with invalid mode --

Did this file decode correctly?

Original Code

--TEST--
Test xzopen() function : error conditions 
--SKIPIF--
<?php 
if (!extension_loaded("xz")) {
	print "skip - XZ extension not loaded"; 
}	 
?>
--FILE--
<?php
/* Prototype  : resource xzopen(string filename, string mode)
 * Description: Open a xz file and return a xz file pointer 
 * Source code: ext/xz/xz.c
 * Alias to functions: 
 */

echo "*** Testing xzopen() : error conditions ***\n";


//Test gzopen with one more than the expected number of arguments
echo "\n-- Testing xzopen() function with invalid mode --\n";
$filename = 'string_val';
$mode = 'a';
var_dump( xzopen($filename, $mode) );

?>
===DONE===
--EXPECTF--
*** Testing xzopen() : error conditions ***

-- Testing xzopen() function with invalid mode --

Warning: xzopen(): Can only open in read (r) or write (w) mode.%s
bool(false)
===DONE===

Function Calls

xzopen 1
extension_loaded 1

Variables

$mode a
$filename string_val

Stats

MD5 d0d3e63cdcf12ed92025047b997b901a
Eval Count 0
Decode Time 99 ms