Skip to content

Add an appendix about numeric strings#215

Closed
Girgias wants to merge 7 commits intophp:masterfrom
Girgias:numeric-string-appendix
Closed

Add an appendix about numeric strings#215
Girgias wants to merge 7 commits intophp:masterfrom
Girgias:numeric-string-appendix

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented Nov 23, 2020

Add a dedicated appendix explaining numeric strings, drive-by fixes.

@cmb69
Copy link
Copy Markdown
Member

cmb69 commented Nov 23, 2020

Hmm, where is the appendix? :)

Copy link
Copy Markdown
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether the numeric-strings.xml file should better go into language/types/?

@Girgias
Copy link
Copy Markdown
Member Author

Girgias commented Nov 24, 2020

I wonder whether the numeric-strings.xml file should better go into language/types/?

I was thinking about that but it's not really a type, so I thought an appendix might be better. But that's easily changeable.

@cmb69
Copy link
Copy Markdown
Member

cmb69 commented Nov 24, 2020

Well, neither declarations nor type-juggling are types. :)

@Girgias
Copy link
Copy Markdown
Member Author

Girgias commented Nov 24, 2020

Well, neither declarations nor type-juggling are types. :)

That's true... let me rework it


<note>
<para>
A notice is thrown if an <type>object</type> is converted to <type>float</type>.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why this note exits, as the same applies for integers but there it's just declared undefined behaviour (which would also apply for objects...)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://github.com/php/doc-en/pull/156/files#diff-4af4f41802cf4b045bb14a24dfac1bea5f6bf1682797f0bf22c98925b8af0a60L92-R99. Apparently, that was not the case in PHP 4; could probably drop that note.

Comment on lines -77 to +79
The behaviour of an automatic conversion to <type>array</type> is currently
undefined.
An <type>array</type> cannot be coerced and will throw a
<classname>TypeError</classname> as of PHP 8.0.0.
Previously the behaviour was undefined.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realised that I probably misunderstood this note, probably should revert this.

@php-pulls php-pulls closed this in d494ffa Nov 27, 2020
@Girgias Girgias deleted the numeric-string-appendix branch November 27, 2020 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants