Searched refs:new (Results 1 – 25 of 74) sorted by relevance
123
4 new ('a' . 'b');5 new (x);6 new (foo());7 new ('foo');8 new (x[0]);9 new (x->y);10 new ((x)::$y);15 new (x)();16 new (foo())();18 new (x[0])();[all …]
5 new class {};6 new class extends A implements B, C {};7 new class($a) extends A {13 new readonly class {};15 new class18 new class extends A implements B, C21 new class($a) extends A29 new readonly class
33 (new A)->b;34 (new A())->b();35 (new $$a)[$b];36 (new $a->b)->c;68 (new A())->b;69 (new A())->b();70 (new ${$a}())[$b];71 (new $a->b())->c;
13 $stmts[0]->expr->left = new Expr\BinaryOp\Plus(new Expr\Variable('a'), new Expr\Variable('b'));15 $stmts[1]->expr->right = new Expr\BinaryOp\Plus(new Expr\Variable('b'), new Expr\Variable('c'));17 $stmts[2]->expr->left = new Expr\BinaryOp\Plus(new Expr\Variable('a'), new Expr\Variable('b'));19 $stmts[3]->expr->cond = new Expr\Assign(new Expr\Variable('a'), new Expr\Variable('b'));20 $stmts[3]->expr->if = new Expr\Assign(new Expr\Variable('a'), new Expr\Variable('b'));21 $stmts[3]->expr->else = new Expr\Assign(new Expr\Variable('a'), new Expr\Variable('b'));23 $stmts[4]->expr->left = new Expr\BinaryOp\Plus(new Expr\Variable('a'), new Expr\Variable('b'));24 $stmts[5]->expr->left = new Expr\BinaryOp\Plus(new Expr\Variable('a'), new Expr\Variable('b'));45 new Foo();53 $stmts[1]->expr->name = new Expr\BinaryOp\Concat(new Expr\Variable('a'), new Expr\Variable('b'));[all …]
38 $stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('a'));39 $stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('b'));40 $stmts[1]->stmts[0]->params[] = new Node\Param(new Node\Expr\Variable('a'));42 $stmts[2]->expr->params[] = new Node\Param(new Node\Expr\Variable('a'));43 $stmts[2]->expr->params[] = new Node\Param(new Node\Expr\Variable('b'));46 $stmts[3]->expr->params[] = new Node\Param(new Node\Expr\Variable('a'));47 $stmts[3]->expr->params[] = new Node\Param(new Node\Expr\Variable('b'));75 new79 new class104 new[all …]
4 new class9 $new = $stmts[0]->expr;10 $new->class->extends = null;11 $new->args[] = new Expr\Variable('y');14 new class19 new class23 $new = $stmts[0]->expr;24 $new->class->name = new Node\Identifier('Anon1');27 new class
8 $stmts[] = new Stmt\Expression(new Expr\Variable('baz'));102 $stmts[0]->catches[] = new Stmt\Catch_([new Node\Name('Bar')], new Expr\Variable('bar'), []);114 $node = new Stmt\Expression(new Expr\Variable('baz'));128 $node = new Stmt\Expression(new Expr\Variable('baz'));155 $node = new Stmt\Expression(new Expr\Variable('baz'));169 $node = new Stmt\Expression(new Expr\Variable('baz'));187 $node = new Stmt\Expression(new Expr\Variable('baz'));250 new Stmt\Expression(new Expr\Variable('a')),251 new Stmt\Expression(new Expr\Variable('b')));267 new Stmt\Expression(new Expr\Variable('a')),[all …]
10 $node = new Expr\ArrayItem(new Scalar\String_('baz'), new Scalar\String_('c'));11 $node->setAttribute('comments', [new Comment\Doc(<<<COMMENT38 $node = new Expr\ArrayItem(new Scalar\String_('baz'), new Scalar\String_('c'));39 $node->setAttribute('comments', [new Comment("/* Block comment */")]);59 $node = new Expr\ArrayItem(new Scalar\String_('baz'), new Scalar\String_('c'));60 $node->setAttribute('comments', [new Comment("// Line comment")]);79 $node = new Expr\ArrayItem(new Scalar\String_('bar'), new Scalar\String_('b'));80 $node->setAttribute('comments', [new Comment("// Line comment")]);96 $node = new Expr\ArrayItem(new Scalar\String_('foo'), new Scalar\String_('a'));97 $node->setAttribute('comments', [new Comment("// Line comment")]);
77 $stmts[0]->returnType = new Node\Name('Foo');80 $stmts[0]->params[1]->default = new Expr\ConstFetch(new Node\Name('null'));81 $stmts[1]->expr->dim = new Expr\Variable('a');84 $stmts[4]->expr->if = new Expr\Variable('z');87 $stmts[7]->num = new Scalar\LNumber(2);88 $stmts[8]->num = new Scalar\LNumber(2);89 $stmts[9]->expr = new Expr\Variable('x');94 $stmts[11]->keyVar = new Expr\Variable('z');96 $stmts[13]->finally = new Stmt\Finally_([]);97 $stmts[14]->else = new Stmt\Else_([]);[all …]
6 $stmts[0] = new Stmt\If_(new Expr\Variable('a'), ['stmts' => $stmts]);17 $stmts[0] = new Stmt\If_(new Expr\Variable('a'), ['stmts' => $stmts]);30 $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('y'));48 $stmts[0]->expr = new Expr\StaticCall(new Node\Name\FullyQualified('Compat'), $call->name, $call->a…63 $stmts[0] = new Stmt\While_($stmts[0]->cond, $stmts[0]->stmts);
11 $stmts[0]->stmts[0]->stmts[] = new Stmt\Expression(new Node\Expr\Variable('foo'));30 $stmts[0]->stmts[0]->stmts[] = new Stmt\Expression(new Node\Expr\Variable('foo'));49 $stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment("/* I'm a new comment */")]);55 /* I'm a new comment */68 $stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment("// I'm a new comment")]);74 // I'm a new comment
11 $stmts[0]->stmts[0]->hooks[] = new Node\PropertyHook('set', new Scalar\Int_(123));30 $stmts[0]->stmts[0]->params[0]->hooks[] = new Node\PropertyHook('set', new Scalar\Int_(123));51 $stmts[0]->stmts[0]->hooks[0]->body[] = new Stmt\Expression(new Expr\Variable('b'));91 $stmts[0]->stmts[0]->hooks[0]->body = [new Stmt\Return_(new Scalar\Int_(24))];114 $stmts[0]->stmts[0]->hooks[0]->body = new Scalar\Int_(24);115 $stmts[0]->stmts[1]->hooks[0]->body = [new Stmt\Return_(new Scalar\Int_(24))];
27 new #[A] class {};32 $attrGroup = new Node\AttributeGroup([33 new Node\Attribute(new Node\Name('B'), []),78 new #[A] #[B] class {};100 new class {};105 $attrGroup = new Node\AttributeGroup([106 new Node\Attribute(new Node\Name('A'), []),108 $attrGroup2 = new Node\AttributeGroup([109 new Node\Attribute(new Node\Name('B'), []),150 new #[A] class {};[all …]
9 $array->items[] = new Expr\ArrayItem(new Expr\Variable('b'));23 $array->items[] = new Expr\ArrayItem(new Expr\Variable('c'), null, false, [], true);
4 $this->foo = new Foo;12 $stmts[2] = new Stmt\Expression(new Expr\MethodCall($var, $outerCall->name));15 $this->foo = new Foo;
9 $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('c'));23 $stmts[0]->stmts[] = new Stmt\Expression(new Expr\Variable('c'));
6 $stmts[0] = new Stmt\Use_([new Node\UseItem(new Node\Name('A\B'))]);
31 $stmts[0]->scalarType = new Node\Identifier('int');42 $stmts[0]->scalarType = new Node\Identifier('int');55 $stmts[0]->stmts[0]->expr = new Scalar\LNumber(1);70 $stmts[0]->stmts[] = new Node\Stmt\EnumCase('C');85 $stmts[0]->implements[] = new Node\Name('Z');96 $stmts[0]->implements[] = new Node\Name('Y');
31 * @param T[] $new New array35 public function diff(array $old, array $new): array { argument37 $new = \array_values($new);38 list($trace, $x, $y) = $this->calculateTrace($old, $new);39 return $this->extractDiff($trace, $x, $y, $old, $new);49 * @param T[] $new New array54 return $this->coalesceReplacements($this->diff($old, $new));59 * @param T[] $new62 private function calculateTrace(array $old, array $new): array { argument64 $m = \count($new);[all …]
19 public $new; variable in PhpParser\\Internal\\DiffElem24 * @param mixed $new Is null for remove operations26 public function __construct(int $type, $old, $new) { argument29 $this->new = $new;
5 new A;6 new A($b);9 new $a();10 new $a['b']();11 new A::$b();13 new $a->b();14 new $a->b->c();15 new $a->b['c']();17 // test regression introduces by new dereferencing syntax18 (new A);[all …]
5 new A()->foo;6 new A()->foo();7 new A()::FOO;8 new A()::foo();9 new A()::$foo;10 new A()[0];11 new A()();13 new class {}->foo;15 new class {}::FOO;18 new class {}[0];[all …]
1 Assigning new by reference (PHP 5 only)4 $a =& new B;25 $a =& new B;28 Cannot assign new by reference from 2:1 to 2:11
1 UVS new expressions4 new $className;5 new $array['className'];6 new $obj->className;7 new Test::$className;8 new $test::$className;9 new $weird[0]->foo::$className;
15 ## Adding support for new PHP syntax17 1. If necessary, add emulation support for new tokens.18 * Add a new subclass of `Lexer\TokenEmulator`. Take inspiration from existing classes.19 * Add the new class to the array in `Lexer\Emulative`.21 `provideTestReplaceKeywords()` for new reserved keywords and `provideTestLexNewFeatures()` for23 2. Add any new node classes that are needed.24 3. Add support for the new syntax in `grammar/php.y`. Regenerate the parser by running30 7. Does the new syntax feature namespaced names? If so, add support for name resolution in32 8. Does the new syntax require any changes to builders? Is so, make them :)
Completed in 28 milliseconds