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::mapPhar filesize mismatch --EXTENSIONS-- phar --INI-- phar.require_hash=0 -..

Decoded Output download

--TEST--
Phar::mapPhar filesize mismatch
--EXTENSIONS--
phar
--INI--
phar.require_hash=0
--FILE--
<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php __HALT_COMPILER(); ?>";
// wrong crc32

$files = array();
$files['a'] = array('cont'=>'a', 'crc32'=>crc32('aX'));
include 'files/phar_test.inc';

echo file_get_contents($pname.'/a');
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line %d

Did this file decode correctly?

Original Code

--TEST--
Phar::mapPhar filesize mismatch
--EXTENSIONS--
phar
--INI--
phar.require_hash=0
--FILE--
<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php __HALT_COMPILER(); ?>";
// wrong crc32

$files = array();
$files['a'] = array('cont'=>'a', 'crc32'=>crc32('aX'));
include 'files/phar_test.inc';

echo file_get_contents($pname.'/a');
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line %d

Function Calls

None

Variables

None

Stats

MD5 a06ebde50124fd1633aacefab4071bdb
Eval Count 0
Decode Time 93 ms