Skip to content

Add initial version of the PHP 8.2 migration guide #1799

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

Merged
merged 36 commits into from
Sep 26, 2022

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Sep 6, 2022

Will need a doc-base change to be added to the live version.

This covers the UPGRADING file.

I think it is best to merge this ASAP and handle adding examples and links in other PRs as needed.

@Girgias Girgias force-pushed the 8.2-changelog branch 2 times, most recently from cb25bac to a6a8199 Compare September 6, 2022 16:42
Copy link
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.

Thank you very much!

Partial review done; I'll try to review the rest ASAP.

Copy link
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.

(more review to come :)


<para>
<function>glob</function> returns empty array if all paths are restricted by open_basedir.
Previously the error was returned but that behavior was not consistent and
Copy link
Member

Choose a reason for hiding this comment

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

The error was returned? What does that mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bukka can you clarify?
As I just copy pasted the wording from UPGRADING

Copy link
Member

Choose a reason for hiding this comment

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

Previously if all paths were restricted by open_basedir, false was returned and typical open basedir restriction warning was emitted. The consistency note means that there was no warning if just some paths were restricted.

Comment on lines +52 to +83
<para>
<function>dba_open</function> and <function>dba_popen</function>
now have the following enforced signature:
<methodsynopsis>
<type class="union"><type>resource</type><type>false</type></type><methodname>dba_open</methodname>
<methodparam><type>string</type><parameter>path</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>handler</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>permission</parameter><initializer>0644</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>map_size</parameter><initializer>0</initializer></methodparam>
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>flags</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
</para>
<para>
<function>dba_fetch</function>'s optional skip argument is now at the end
in line with PHP userland semantics. Its signature is now:
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>dba_fetch</methodname>
<methodparam><type class="union"><type>string</type><type>array</type></type><parameter>key</parameter></methodparam>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
<methodparam><type>int</type><parameter>skip</parameter></methodparam>
</methodsynopsis>

The overloaded signature:
<methodsynopsis>
<type class="union"><type>string</type><type>false</type></type><methodname>dba_fetch</methodname>
<methodparam><type class="union"><type>string</type><type>array</type></type><parameter>key</parameter></methodparam>
<methodparam><type>int</type><parameter>skip</parameter></methodparam>
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
is still accepted, but it is recommended to use the new standard variant.
</para>
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that we want to be that explicit in the migration guide. Maybe telling users about the signature changes, and then detailing on the respective pages is preferable to avoid duplication.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's better to have it in the migration guide, but maybe that's because I haven't gotten round to writing the doc changes for DBA.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, maybe put it in the migration guide, and later consider to move the details to the actual docs.

@Girgias
Copy link
Member Author

Girgias commented Sep 24, 2022

I think it's now finally ready.

Copy link
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 think some minor issues could be addressed, but overall this looks good to me. Thank you very much!

<para>
<methodname>SplFileObject::getChildren</methodname> now has a tentative
return type of <type>null</type>, previously it was
<type class="union"><type>RecursiveIterator</type><type>null</type></type>.
Copy link
Member

Choose a reason for hiding this comment

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

That may render badly, e.g.
Screenshot 2022-09-24 144805

Not sure if we should do something about that in the actual docs (might be something we want to improve in PhD).

<para>
The creation of dynamic properties is deprecated, unless the class opts in by
using the <code>#[\AllowDynamicProperties]</code> attribute.
<classname>stdClass</classname> allows dynamic properties.
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I guess we should either have a dedicated page for stdClass, or not to use the <classname> markup, but rather link to its documentation (whereever that is).

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #1846 to track this issue.

<para>
Usage of the <literal>QPrint</literal>, <literal>Base64</literal>,
<literal>Uuencode</literal>, and <literal>HTML-ENTITIES</literal>
'text encodings' is deprecated for all Mbstring functions.
Copy link
Member

Choose a reason for hiding this comment

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

All occurences of "MBString"/"Mbstring" should likely have the same case; I think the former is favorable.

@cmb69
Copy link
Member

cmb69 commented Sep 24, 2022

Oh, and don't forget to add the migration guide to doc-base/manual.xml.in after merging.

Girgias and others added 12 commits September 26, 2022 10:38
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
Those are a leftover from copy pasting the migration guide
Missed the new flags param
Girgias and others added 24 commits September 26, 2022 10:38
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Not all are there as some turn out to be undocumented
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
@Girgias Girgias merged commit 65716f4 into php:master Sep 26, 2022
@Girgias Girgias deleted the 8.2-changelog branch September 26, 2022 09:40
@Girgias Girgias added this to the PHP 8.2 milestone Nov 12, 2022
tiffany-taylor pushed a commit to tiffany-taylor/doc-en that referenced this pull request Jan 16, 2023
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
claudepache pushed a commit to claudepache/php-doc-en that referenced this pull request Jun 1, 2023
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
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.

4 participants