-
Notifications
You must be signed in to change notification settings - Fork 882
Update screens for output that changed with PHP itself #5720
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
base: master
Are you sure you want to change the base?
Changes from all commits
aad3d93
99304e8
410ad2f
a5e5417
90da1c9
8019374
5b3a466
d1e9f23
05846fc
f2738aa
84e7d83
d0013d0
96e2f6e
6f02892
ac23008
5ad2d0e
0f9e0a1
78a36c5
db1b881
f71c8be
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 |
|---|---|---|
|
|
@@ -527,7 +527,7 @@ var_dump($c); | |
| &example.outputs; | ||
| <screen> | ||
| <![CDATA[ | ||
| string(60) "A::__set_state(array( | ||
| string(61) "\A::__set_state(array( | ||
|
Member
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. I can't even remember what this change was. Is this something that we document or is this an implementation detail?
Contributor
Author
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. Documented and intentional — migration82 lists it under incompatible changes ("var_export() no longer omits the leading backslash for exported classes"). I dropped the split anyway. This example is about |
||
| 'var1' => 5, | ||
| 'var2' => 'foo', | ||
| ))" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,6 +178,9 @@ $c = fopen('/tmp/', 'r'); | |
| var_dump($a instanceof stdClass); // $a is an integer | ||
| var_dump($b instanceof stdClass); // $b is NULL | ||
| var_dump($c instanceof stdClass); // $c is a resource | ||
|
|
||
| // Prior to PHP 7.3.0, using a constant would trigger a compile-time fatal error with the following message: | ||
| // instanceof expects an object instance, constant given | ||
| var_dump(FALSE instanceof stdClass); | ||
| ?> | ||
| ]]> | ||
|
|
@@ -188,7 +191,7 @@ var_dump(FALSE instanceof stdClass); | |
| bool(false) | ||
| bool(false) | ||
| bool(false) | ||
| PHP Fatal error: instanceof expects an object instance, constant given | ||
| bool(false) | ||
|
Member
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. Ok, but we need to retain the error message. Perhaps split it into two outputs per version? Or just add a code comment on
Contributor
Author
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. Took the code comment. A split would mislead here: prior to 7.3 this is a compile-time error, so 7.2 prints the fatal line and nothing else — none of the three That's why the comment says "so nothing above ran". The 7.3 boundary itself is already covered by the example directly below, which uses |
||
| ]]> | ||
| </screen> | ||
| </example> | ||
|
|
||
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.
Same here, I am not actually sure what's changed. I can see that PHP 8 uses the parent class name, but is this important? Is this intentional or just an implementation detail?
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.
Intentional — migration80 lists it under incompatible changes, with examples for
ParentClass@anonymous,FirstInterface@anonymousandclass@anonymous.But the naming is not really why this hunk exists. The old screen printed
["Command line code0x104c5b612":"class@anonymous":private], where the property-name slot holds part of the class name. 7.4 prints["num":"class@anonymous":private]. It was a broken capture rather than an outdated one.