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-- Phar object: unset file (confirm disk file is changed) --EXTENSIONS-- phar --INI-..

Decoded Output download

--TEST--
Phar object: unset file (confirm disk file is changed)
--EXTENSIONS--
phar
--INI--
phar.readonly=0
phar.require_hash=0
--FILE--
<?php

$pharconfig = 0;

require_once 'files/phar_oo_test.inc';

$phar = new Phar($fname);
$phar->setInfoClass('SplFileObject');

$phar['f.php'] = 'hi';
var_dump(isset($phar['f.php']));
echo $phar['f.php'];
echo "
";
$md5 = md5_file($fname);
unset($phar['f.php']);
$md52 = md5_file($fname);
if ($md5 == $md52) echo 'File on disk has not changed';
var_dump(isset($phar['f.php']));

?>
--CLEAN--
<?php
unlink(__DIR__ . '/files/phar_oo_012_confirm.phar.php');
                ?>
?>
--EXPECT--
bool(true)
hi
bool(false)

Did this file decode correctly?

Original Code

--TEST--
Phar object: unset file (confirm disk file is changed)
--EXTENSIONS--
phar
--INI--
phar.readonly=0
phar.require_hash=0
--FILE--
<?php

$pharconfig = 0;

require_once 'files/phar_oo_test.inc';

$phar = new Phar($fname);
$phar->setInfoClass('SplFileObject');

$phar['f.php'] = 'hi';
var_dump(isset($phar['f.php']));
echo $phar['f.php'];
echo "\n";
$md5 = md5_file($fname);
unset($phar['f.php']);
$md52 = md5_file($fname);
if ($md5 == $md52) echo 'File on disk has not changed';
var_dump(isset($phar['f.php']));

?>
--CLEAN--
<?php
unlink(__DIR__ . '/files/phar_oo_012_confirm.phar.php');
__halt_compiler();
?>
--EXPECT--
bool(true)
hi
bool(false)

Function Calls

None

Variables

$pharconfig 0

Stats

MD5 4ed3c201a562c6b64d2cf1f02a37a2d2
Eval Count 0
Decode Time 92 ms