forked from prettier/plugin-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.php
More file actions
76 lines (69 loc) · 1.5 KB
/
new.php
File metadata and controls
76 lines (69 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
(new Translator(
$container,
new MessageFormatter(),
'en',
array(),
array('foo' => 'bar')
))
?>
<?php
(((new Translator(
$container,
new MessageFormatter(),
'en',
$someOtherVar,
array('foo' => 'bar')
))))
?>
<?php
(new Translator(
$container,
new MessageFormatter(),
'en',
$someOtherVar,
['foo' => 'bar']
))
?>
<?php
$var = new Foo();
$var = (new Foo());
$var = (new Foo())->c();
new Foo->prop;
new Foo->method();
new Foo->$var;
$var = (new class {
public function log($msg)
{
echo $msg;
}
});
$var = (new foo())->bar();
$var = (new foo())->bar()->foo();
$var = ((new foo())->bar())->foo();
$var = (((new foo())->bar())->foo());
$var = (((new foo())->bar())->foo())[0];
$var = ((((new foo())->bar())->foo())[0])[1];
$var = (((new foo())->bar())->foo())->baz();
$var = (new $foo())->bar;
$var = (new $bar->y)->x;
new SortOfLongClassName()->withALongMethodName()->andAnother()->toPushItPast80Chars();
$asdf =
new SortOfLongClassName()->withALongMethodName()
->andAnother()->toPushItPast80Chars();
$var = (new foo)[0];
$var = (new foo)[0]['string'];
$var = (new Foo)::foo;
$var = (new Foo)::$foo;
$var = new $a->b;
$var = new $a->b();
$var = (new $a)->b();
$var = ((new $a)->b());
(new class {})->foo;
(new class {})->foo();
(new class {})();
(new class {})['foo'];
$var = (new class {})->foo;
// Issue #2441: static property access should not add parens
$identifier = new Yii::$app->class([]);
$identifier = new Yii::$app()->class([]);