Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.116.62.169
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
nikic /
php-parser /
test /
PhpParser /
Delete
Unzip
Name
Size
Permission
Date
Action
Builder
[ DIR ]
drwxr-xr-x
2018-10-10 09:00
ErrorHandler
[ DIR ]
drwxr-xr-x
2018-10-10 09:00
Internal
[ DIR ]
drwxr-xr-x
2018-10-10 09:00
Lexer
[ DIR ]
drwxr-xr-x
2018-10-10 09:00
Node
[ DIR ]
drwxr-xr-x
2018-10-10 09:00
NodeVisitor
[ DIR ]
drwxr-xr-x
2018-10-10 09:00
Parser
[ DIR ]
drwxr-xr-x
2018-10-10 09:00
BuilderFactoryTest.php
11.11
KB
-rw-r--r--
2018-10-10 09:00
CodeParsingTest.php
4
KB
-rw-r--r--
2018-10-10 09:00
CodeTestAbstract.php
1021
B
-rw-r--r--
2018-10-10 09:00
CodeTestParser.php
1.89
KB
-rw-r--r--
2018-10-10 09:00
CommentTest.php
1.76
KB
-rw-r--r--
2018-10-10 09:00
ConstExprEvaluatorTest.php
4.06
KB
-rw-r--r--
2018-10-10 09:00
ErrorTest.php
3.53
KB
-rw-r--r--
2018-10-10 09:00
JsonDecoderTest.php
1.28
KB
-rw-r--r--
2018-10-10 09:00
LexerTest.php
9.18
KB
-rw-r--r--
2018-10-10 09:00
NameContextTest.php
3.06
KB
-rw-r--r--
2018-10-10 09:00
NodeAbstractTest.php
9.84
KB
-rw-r--r--
2018-10-10 09:00
NodeDumperTest.php
2.41
KB
-rw-r--r--
2018-10-10 09:00
NodeFinderTest.php
2.32
KB
-rw-r--r--
2018-10-10 09:00
NodeTraverserTest.php
15.23
KB
-rw-r--r--
2018-10-10 09:00
ParserFactoryTest.php
1.06
KB
-rw-r--r--
2018-10-10 09:00
ParserTest.php
7.46
KB
-rw-r--r--
2018-10-10 09:00
PrettyPrinterTest.php
12.14
KB
-rw-r--r--
2018-10-10 09:00
Save
Rename
<?php declare(strict_types=1); namespace PhpParser; use PhpParser\Node\Expr; use PhpParser\Node\Stmt; require_once __DIR__ . '/CodeTestAbstract.php'; class CodeParsingTest extends CodeTestAbstract { /** * @dataProvider provideTestParse */ public function testParse($name, $code, $expected, $modeLine) { if (null !== $modeLine) { $modes = array_fill_keys(explode(',', $modeLine), true); } else { $modes = []; } list($parser5, $parser7) = $this->createParsers($modes); list($stmts5, $output5) = $this->getParseOutput($parser5, $code, $modes); list($stmts7, $output7) = $this->getParseOutput($parser7, $code, $modes); if (isset($modes['php5'])) { $this->assertSame($expected, $output5, $name); $this->assertNotSame($expected, $output7, $name); } elseif (isset($modes['php7'])) { $this->assertNotSame($expected, $output5, $name); $this->assertSame($expected, $output7, $name); } else { $this->assertSame($expected, $output5, $name); $this->assertSame($expected, $output7, $name); } $this->checkAttributes($stmts5); $this->checkAttributes($stmts7); } public function createParsers(array $modes) { $lexer = new Lexer\Emulative(['usedAttributes' => [ 'startLine', 'endLine', 'startFilePos', 'endFilePos', 'startTokenPos', 'endTokenPos', 'comments' ]]); return [ new Parser\Php5($lexer), new Parser\Php7($lexer), ]; } // Must be public for updateTests.php public function getParseOutput(Parser $parser, $code, array $modes) { $dumpPositions = isset($modes['positions']); $errors = new ErrorHandler\Collecting; $stmts = $parser->parse($code, $errors); $output = ''; foreach ($errors->getErrors() as $error) { $output .= $this->formatErrorMessage($error, $code) . "\n"; } if (null !== $stmts) { $dumper = new NodeDumper(['dumpComments' => true, 'dumpPositions' => $dumpPositions]); $output .= $dumper->dump($stmts, $code); } return [$stmts, canonicalize($output)]; } public function provideTestParse() { return $this->getTests(__DIR__ . '/../code/parser', 'test'); } private function formatErrorMessage(Error $e, $code) { if ($e->hasColumnInfo()) { return $e->getMessageWithColumnInfo($code); } else { return $e->getMessage(); } } private function checkAttributes($stmts) { if ($stmts === null) { return; } $traverser = new NodeTraverser(); $traverser->addVisitor(new class extends NodeVisitorAbstract { public function enterNode(Node $node) { $startLine = $node->getStartLine(); $endLine = $node->getEndLine(); $startFilePos = $node->getStartFilePos(); $endFilePos = $node->getEndFilePos(); $startTokenPos = $node->getStartTokenPos(); $endTokenPos = $node->getEndTokenPos(); if ($startLine < 0 || $endLine < 0 || $startFilePos < 0 || $endFilePos < 0 || $startTokenPos < 0 || $endTokenPos < 0 ) { throw new \Exception('Missing location information on ' . $node->getType()); } if ($endLine < $startLine || $endFilePos < $startFilePos || $endTokenPos < $startTokenPos ) { // Nops and error can have inverted order, if they are empty if (!$node instanceof Stmt\Nop && !$node instanceof Expr\Error) { throw new \Exception('End < start on ' . $node->getType()); } } } }); $traverser->traverse($stmts); } }