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

Software: Apache. PHP/8.3.27 

uname -a: Linux pdx1-shared-a4-04 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64 

uid=6659440(dh_z2jmpm) gid=2086089(pg10499364) groups=2086089(pg10499364)  

Safe-mode: OFF (not secure)

/usr/local/wp/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Syntax/   drwxr-xr-x
Free 713.95 GB of 879.6 GB (81.17%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     NewArrayUnpackingSniff.php (4.42 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * PHPCompatibility, an external standard for PHP_CodeSniffer.
 *
 * @package   PHPCompatibility
 * @copyright 2012-2020 PHPCompatibility Contributors
 * @license   https://opensource.org/licenses/LGPL-3.0 LGPL3
 * @link      https://github.com/PHPCompatibility/PHPCompatibility
 */

namespace PHPCompatibility\Sniffs\Syntax;

use PHPCompatibility\Helpers\ScannedCode;
use PHPCompatibility\Sniff;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
use PHPCSUtils\Tokens\Collections;
use PHPCSUtils\Utils\Arrays;
use PHPCSUtils\Utils\Context;
use PHPCSUtils\Utils\GetTokensAsString;

/**
 * Using the spread operator for unpacking arrays in array expressions is available since PHP 7.4.
 *
 * PHP version 7.4
 *
 * @link https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.unpack-inside-array
 * @link https://wiki.php.net/rfc/spread_operator_for_array
 *
 * @since 9.2.0
 * @since 10.0.0 This class is now `final`.
 */
final class NewArrayUnpackingSniff extends Sniff
{

    /**
     * Returns an array of tokens this test wants to listen for.
     *
     * @since 9.2.0
     *
     * @return array<int|string>
     */
    public function register()
    {
        return Collections::arrayOpenTokensBC();
    }

    /**
     * Processes this test, when one of its tokens is encountered.
     *
     * @since 9.2.0
     *
     * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
     * @param int                         $stackPtr  The position of the current token in the
     *                                               stack passed in $tokens.
     *
     * @return void
     */
    public function process(File $phpcsFile, $stackPtr)
    {
        if (ScannedCode::shouldRunOnOrBelow('7.3') === false) {
            return;
        }

        if (Context::inAttribute($phpcsFile, $stackPtr) === true) {
            // If the syntax is used within an attribute, it will be interpreted as a comment on PHP < 8.0, so not an issue.
            return;
        }

        /*
         * Determine the array opener & closer.
         */
        $openClose = Arrays::getOpenClose($phpcsFile, $stackPtr);
        if ($openClose === false) {
            // Parse error, live coding or short list, not short array.
            return;
        }

        $opener = $openClose['opener'];
        $closer = $openClose['closer'];
        $tokens = $phpcsFile->getTokens();

        $nestingLevel = 0;
        if (isset($tokens[($opener + 1)]['nested_parenthesis'])) {
            $nestingLevel = \count($tokens[($opener + 1)]['nested_parenthesis']);
        }

        $find                        = Collections::arrayOpenTokensBC();
        $find[\T_ELLIPSIS]           = \T_ELLIPSIS;
        $find[\T_OPEN_CURLY_BRACKET] = \T_OPEN_CURLY_BRACKET;

        for ($i = $opener; $i < $closer;) {
            $i = $phpcsFile->findNext($find, ($i + 1), $closer);
            if ($i === false) {
                return;
            }

            if (isset($tokens[$i]['bracket_closer']) === true) {
                // Skip over nested short arrays. These will be handled when the array opener
                // of the nested array is passed.
                $i = $tokens[$i]['bracket_closer'];
                continue;
            }

            if (isset($tokens[$i]['parenthesis_closer']) === true) {
                // Skip over nested long arrays. These will be handled when the array opener
                // of the nested array is passed.
                $i = $tokens[$i]['parenthesis_closer'];
                continue;
            }

            if ($tokens[$i]['code'] !== \T_ELLIPSIS) {
                // Shouldn't be possible. Live coding or parse error.
                continue;
            }

            // Ensure this is not function call variable unpacking.
            if (isset($tokens[$i]['nested_parenthesis'])
                && \count($tokens[$i]['nested_parenthesis']) > $nestingLevel
            ) {
                continue;
            }

            // Ok, found one.
            $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true);
            $snippet      = GetTokensAsString::compact($phpcsFile, $i, $nextNonEmpty, true);
            $phpcsFile->addError(
                'Array unpacking within array declarations using the spread operator is not supported in PHP 7.3 or earlier. Found: %s',
                $i,
                'Found',
                [$snippet]
            );
        }
    }
}

:: 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.0161 ]--