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: phar:// file_get_contents --EXTENSIONS-- phar --INI-- phar.require_hash=0 -..
Decoded Output download
--TEST--
Phar: phar:// file_get_contents
--EXTENSIONS--
phar
--INI--
phar.require_hash=0
--FILE--
<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php __HALT_COMPILER(); ?>";
$files = array();
$files['a.php'] = '<?php echo "This is a
"; ?>';
$files['b.php'] = '<?php echo "This is b
"; ?>';
$files['b/c.php'] = '<?php echo "This is b/c
"; ?>';
include 'files/phar_test.inc';
var_dump(file_get_contents($pname . '/a.php'));
var_dump(file_get_contents($pname . '/b.php'));
var_dump(file_get_contents($pname . '/b/c.php'));
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECT--
string(28) "<?php echo "This is a
"; ?>"
string(28) "<?php echo "This is b
"; ?>"
string(30) "<?php echo "This is b/c
"; ?>"
Did this file decode correctly?
Original Code
--TEST--
Phar: phar:// file_get_contents
--EXTENSIONS--
phar
--INI--
phar.require_hash=0
--FILE--
<?php
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php __HALT_COMPILER(); ?>";
$files = array();
$files['a.php'] = '<?php echo "This is a\n"; ?>';
$files['b.php'] = '<?php echo "This is b\n"; ?>';
$files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
include 'files/phar_test.inc';
var_dump(file_get_contents($pname . '/a.php'));
var_dump(file_get_contents($pname . '/b.php'));
var_dump(file_get_contents($pname . '/b/c.php'));
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECT--
string(28) "<?php echo "This is a\n"; ?>"
string(28) "<?php echo "This is b\n"; ?>"
string(30) "<?php echo "This is b/c\n"; ?>"
Function Calls
None |
Stats
MD5 | f84f8cce37e0196455cd5a371b59eb49 |
Eval Count | 0 |
Decode Time | 85 ms |