Fix examples whose documented output doesn't match Run code#5718
Open
KentarouTakeda wants to merge 5 commits into
Open
Fix examples whose documented output doesn't match Run code#5718KentarouTakeda wants to merge 5 commits into
KentarouTakeda wants to merge 5 commits into
Conversation
withfragment.xml had no opening <?php, so pressing Run code printed the source instead of running it. getshortname.xml called getName() on the ReflectionConstant::getShortName() page, so it printed the fully qualified name.
saveXML() emits the declaration, but these screens either drop it entirely or drop the encoding the document declares.
These screens use indentation, spacing or a layout the functions never emit: "[0] => " where var_dump() writes "[0]=>" on its own line, hand alignment print_r() does not pad, and spaces where the data holds tabs.
Each of these differs from what the example prints: stale line numbers and offsets, a wrong ordering, a dropped semicolon, a missing line, screens quoting the example's own strings wrongly, and output split across lines that is really printed on one.
date('T') with no timestamp follows daylight saving, so the page showed
PST for half the year and PDT for the other half. Pinning a winter
moment makes the documented output true all year, so the <screen> is
unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every example that has a Run code button and declares its output with
&example.outputs;(832 of them) was run and compared against its<screen>.This PR is the subset where the fix needs no judgement: each hunk can be confirmed by clicking Run code on the page.
One commit per group:
<?phpso Run code prints the source instead of running it, one calls getName() on the getShortName() page.var_dump()/print_r()never produce: indentation,[0] =>for[0]=>, hand alignment, spaces where the data holds tabs.date('T')with no timestamp, so the page was right only half the year; the timestamp is now pinned and the screen is unchanged.Pages to reproduce this on
Click any page and press Run code: the output that appears is what this PR puts in the
<screen>. The static<screen>still shown on these pages is the "before" side of the diff, until the manual is rebuilt.Fix two broken examples
Fix the XML declaration in DOM blocks
Use the formatting var_dump() and print_r() actually produce
Fix values that do not match the actual output
Pin the timestamp in the date('T') example