Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * This file is part of the Zephir. * * (c) Phalcon Team <[email protected]..
Decoded Output download
<?php
/**
* This file is part of the Zephir.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Zephir\Optimizers\FunctionCall;
use Zephir\Call;
use Zephir\CompilationContext;
use Zephir\CompiledExpression;
use Zephir\Exception\CompilerException;
use Zephir\Optimizers\OptimizerAbstract;
use function count;
/**
* StripslashesOptimizer.
*
* Optimizes calls to 'stripslashes' using internal function
*/
class StripslashesOptimizer extends OptimizerAbstract
{
protected string $zephirMethod = 'zephir_stripslashes';
/**
* @param array $expression
* @param Call $call
* @param CompilationContext $context
*
* @return bool|CompiledExpression|mixed
*
* @throws CompilerException
*/
public function optimize(array $expression, Call $call, CompilationContext $context)
{
if (!isset($expression['parameters'])) {
return false;
}
if (count($expression['parameters']) > 1) {
return false;
}
/*
* Process the expected symbol to be returned
*/
$call->processExpectedReturn($context);
$symbolVariable = $call->getSymbolVariable();
$this->checkNotVariableString($symbolVariable, $expression);
$context->headersManager->add('kernel/string');
$symbolVariable->setDynamicTypes('string');
$resolvedParams = $call->getReadOnlyResolvedParams(
$expression['parameters'],
$context,
$expression
);
$this->checkInitSymbolVariable($call, $symbolVariable, $context);
$symbol = $context->backend->getVariableCode($symbolVariable);
$context->codePrinter->output(
$this->zephirMethod . '(' . $symbol . ', ' . $resolvedParams[0] . ');'
);
return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* This file is part of the Zephir.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Zephir\Optimizers\FunctionCall;
use Zephir\Call;
use Zephir\CompilationContext;
use Zephir\CompiledExpression;
use Zephir\Exception\CompilerException;
use Zephir\Optimizers\OptimizerAbstract;
use function count;
/**
* StripslashesOptimizer.
*
* Optimizes calls to 'stripslashes' using internal function
*/
class StripslashesOptimizer extends OptimizerAbstract
{
protected string $zephirMethod = 'zephir_stripslashes';
/**
* @param array $expression
* @param Call $call
* @param CompilationContext $context
*
* @return bool|CompiledExpression|mixed
*
* @throws CompilerException
*/
public function optimize(array $expression, Call $call, CompilationContext $context)
{
if (!isset($expression['parameters'])) {
return false;
}
if (count($expression['parameters']) > 1) {
return false;
}
/*
* Process the expected symbol to be returned
*/
$call->processExpectedReturn($context);
$symbolVariable = $call->getSymbolVariable();
$this->checkNotVariableString($symbolVariable, $expression);
$context->headersManager->add('kernel/string');
$symbolVariable->setDynamicTypes('string');
$resolvedParams = $call->getReadOnlyResolvedParams(
$expression['parameters'],
$context,
$expression
);
$this->checkInitSymbolVariable($call, $symbolVariable, $context);
$symbol = $context->backend->getVariableCode($symbolVariable);
$context->codePrinter->output(
$this->zephirMethod . '(' . $symbol . ', ' . $resolvedParams[0] . ');'
);
return new CompiledExpression('variable', $symbolVariable->getRealName(), $expression);
}
}
Function Calls
None |
Stats
MD5 | 793723e5df43b3640743f593843046e5 |
Eval Count | 0 |
Decode Time | 82 ms |