-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix syntax error when using readonly with dnf #9512
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
Bug GH-9500: Disjunctive Normal Form Types - readonly property followed by ( | ||
--FILE-- | ||
<?php | ||
class Dnf | ||
{ | ||
var A|(B&C) $a; | ||
var (B&C)|A $b; | ||
private A|(B&C) $c; | ||
private (B&C)|A $d; | ||
static A|(B&C) $e; | ||
static (B&C)|A $f; | ||
private static A|(B&C) $g; | ||
private static (B&C)|A $h; | ||
readonly private A|(B&C) $i; | ||
readonly private (B&C)|A $j; | ||
readonly A|(B&C) $k; | ||
readonly (B&C)|A $l; | ||
private readonly A|(B&C) $m; | ||
private readonly (B&C)|A $n; | ||
} | ||
?> | ||
DONE | ||
--EXPECT-- | ||
DONE |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,34 @@ function readonly() { | |
echo "Hi!\n"; | ||
} | ||
|
||
class A { | ||
const readonly = 'Const hi!'; | ||
|
||
static function readonly() { | ||
echo "Static hi!\n"; | ||
} | ||
} | ||
|
||
class B { | ||
public $readonly = 'Prop hi!'; | ||
|
||
function readonly() { | ||
echo "Instance hi!\n"; | ||
} | ||
} | ||
|
||
$b = new B(); | ||
|
||
readonly(); | ||
readonly (); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just unnecessary since this is no longer special-cased. This should still work. I can keep it if you prefer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No harm keeping it then :) |
||
echo A::readonly, "\n"; | ||
A::readonly(); | ||
$b->readonly(); | ||
echo $b->readonly, "\n"; | ||
|
||
?> | ||
--EXPECT-- | ||
Hi! | ||
Hi! | ||
Const hi! | ||
Static hi! | ||
Instance hi! | ||
Prop hi! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these more simple
static
forms are not in the test, I haven't tested it on this PR, but just to let you know :)