!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/psy/psysh/src/CodeCleaner/   drwxr-xr-x
Free 13.2 GB of 57.97 GB (22.77%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     StrictTypesPass.php (2.64 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of Psy Shell.
 *
 * (c) 2012-2020 Justin Hileman
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Psy\CodeCleaner;

use 
PhpParser\Node\Identifier;
use 
PhpParser\Node\Scalar\LNumber;
use 
PhpParser\Node\Stmt\Declare_;
use 
PhpParser\Node\Stmt\DeclareDeclare;
use 
Psy\Exception\FatalErrorException;

/**
 * Provide implicit strict types declarations for for subsequent execution.
 *
 * The strict types pass remembers the last strict types declaration:
 *
 *     declare(strict_types=1);
 *
 * ... which it then applies implicitly to all future evaluated code, until it
 * is replaced by a new declaration.
 */
class StrictTypesPass extends CodeCleanerPass
{
    const 
EXCEPTION_MESSAGE 'strict_types declaration must have 0 or 1 as its value';

    private 
$strictTypes false;
    private 
$atLeastPhp7;

    public function 
__construct()
    {
        
$this->atLeastPhp7 \version_compare(\PHP_VERSION'7.0''>=');
    }

    
/**
     * If this is a standalone strict types declaration, remember it for later.
     *
     * Otherwise, apply remembered strict types declaration to to the code until
     * a new declaration is encountered.
     *
     * @throws FatalErrorException if an invalid `strict_types` declaration is found
     *
     * @param array $nodes
     */
    
public function beforeTraverse(array $nodes)
    {
        if (!
$this->atLeastPhp7) {
            return; 
// @codeCoverageIgnore
        
}

        
$prependStrictTypes $this->strictTypes;

        foreach (
$nodes as $node) {
            if (
$node instanceof Declare_) {
                foreach (
$node->declares as $declare) {
                    
// For PHP Parser 4.x
                    
$declareKey $declare->key instanceof Identifier $declare->key->toString() : $declare->key;
                    if (
$declareKey === 'strict_types') {
                        
$value $declare->value;
                        if (!
$value instanceof LNumber || ($value->value !== && $value->value !== 1)) {
                            throw new 
FatalErrorException(self::EXCEPTION_MESSAGE0\E_ERRORnull$node->getLine());
                        }

                        
$this->strictTypes $value->value === 1;
                    }
                }
            }
        }

        if (
$prependStrictTypes) {
            
$first \reset($nodes);
            if (!
$first instanceof Declare_) {
                
$declare = new Declare_([new DeclareDeclare('strict_types', new LNumber(1))]);
                
\array_unshift($nodes$declare);
            }
        }

        return 
$nodes;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0051 ]--