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 reliforp/reli-prof package. * * (c) sji <sji@sj-i..

Decoded Output download

<?php

/**
 * This file is part of the reliforp/reli-prof package.
 *
 * (c) sji <[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 Reli\Lib\PhpProcessReader\PhpMemoryReader\ReferenceContext;

use Reli\Lib\PhpProcessReader\PhpMemoryReader\MemoryLocation\ZendOpArrayHeaderMemoryLocation;

class UserFunctionDefinitionContext extends FunctionDefinitionContext
{
    public function __construct(
        public ZendOpArrayHeaderMemoryLocation $memory_location,
    ) {
    }

    public function getFunctionName(): string
    {
        return $this->memory_location->function_name;
    }

    public function getOpArrayAddress(): int
    {
        return $this->memory_location->address;
    }

    public function isClosureOf(UserFunctionDefinitionContext $context): bool
    {
        return $context->isThisContext(
            $this->memory_location->file,
            $this->memory_location->line_start,
        );
    }

    public function isThisContext(
        string $file,
        int $line,
    ): bool {
        if ($this->memory_location->file !== $file) {
            return false;
        }
        if ($this->memory_location->line_start > $line) {
            return false;
        }
        if ($this->memory_location->line_end < $line) {
            return false;
        }
        return true;
    }

    public function getContexts(): iterable
    {
        return ['#is_internal' => false];
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * This file is part of the reliforp/reli-prof package.
 *
 * (c) sji <[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 Reli\Lib\PhpProcessReader\PhpMemoryReader\ReferenceContext;

use Reli\Lib\PhpProcessReader\PhpMemoryReader\MemoryLocation\ZendOpArrayHeaderMemoryLocation;

class UserFunctionDefinitionContext extends FunctionDefinitionContext
{
    public function __construct(
        public ZendOpArrayHeaderMemoryLocation $memory_location,
    ) {
    }

    public function getFunctionName(): string
    {
        return $this->memory_location->function_name;
    }

    public function getOpArrayAddress(): int
    {
        return $this->memory_location->address;
    }

    public function isClosureOf(UserFunctionDefinitionContext $context): bool
    {
        return $context->isThisContext(
            $this->memory_location->file,
            $this->memory_location->line_start,
        );
    }

    public function isThisContext(
        string $file,
        int $line,
    ): bool {
        if ($this->memory_location->file !== $file) {
            return false;
        }
        if ($this->memory_location->line_start > $line) {
            return false;
        }
        if ($this->memory_location->line_end < $line) {
            return false;
        }
        return true;
    }

    public function getContexts(): iterable
    {
        return ['#is_internal' => false];
    }
}

Function Calls

None

Variables

None

Stats

MD5 94d1988aab0e1b2807b57c57e200ca65
Eval Count 0
Decode Time 111 ms