<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.php.net/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.php.net/feed.php">
        <title>PHP Wiki</title>
        <description></description>
        <link>https://wiki.php.net/</link>
        <image rdf:resource="https://wiki.php.net/_media/wiki/dokuwiki.svg" />
       <dc:date>2026-11-19T03:29:27+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/grapheme_str_pad?rev=1795037084&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc?rev=1795017912&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/deprecations_php_8_7?rev=1794948619&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/openssl_get_channel_binding?rev=1794944594&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/working_groups?rev=1794865411&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/stream_errors?rev=1794859220&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/case_insensitive_ini_get_all?rev=1794806519&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/dtls_support_in_ext_openssl?rev=1794786432&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/todo/php86?rev=1794616811&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/friends?rev=1794615873&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/scope?rev=1794589998&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/prepared_literal_string_matching?rev=1794532895&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/context-managers-v2?rev=1794496350&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/curl_opensocketfunction?rev=1794487457&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/rfc/sunset_pecl?rev=1794425392&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.php.net/?image=rfc%3Asurface3d.png&amp;ns=rfc&amp;rev=1784468890&amp;tab_details=history&amp;media_do=diff&amp;do=media"/>
                <rdf:li rdf:resource="https://wiki.php.net/?image=rfc%3Ascaled_on_load_rotate.png&amp;ns=rfc&amp;rev=1784270844&amp;tab_details=history&amp;media_do=diff&amp;do=media"/>
                <rdf:li rdf:resource="https://wiki.php.net/?image=rfc%3Awatermarked.png&amp;ns=rfc&amp;rev=1784260645&amp;tab_details=history&amp;media_do=diff&amp;do=media"/>
                <rdf:li rdf:resource="https://wiki.php.net/?image=rfc%3Ascale_entropy_visual_check.png&amp;ns=rfc&amp;rev=1783998723&amp;tab_details=history&amp;media_do=diff&amp;do=media"/>
                <rdf:li rdf:resource="https://wiki.php.net/?image=rfc%3Atextcurve.png&amp;ns=rfc&amp;rev=1783692533&amp;tab_details=history&amp;media_do=diff&amp;do=media"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.php.net/_media/wiki/dokuwiki.svg">
        <title>PHP Wiki</title>
        <link>https://wiki.php.net/</link>
        <url>https://wiki.php.net/_media/wiki/dokuwiki.svg</url>
    </image>
    <item rdf:about="https://wiki.php.net/rfc/grapheme_str_pad?rev=1795037084&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-18T21:24:44+00:00</dc:date>
        <dc:creator>chrisabner (chrisabner@undisclosed.example.com)</dc:creator>
        <title>grapheme_str_pad - Add voting thread</title>
        <link>https://wiki.php.net/rfc/grapheme_str_pad?rev=1795037084&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/18 16:04&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 7:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 7:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Implementation: https://github.com/php/php-src/pull/25179&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Implementation: https://github.com/php/php-src/pull/25179&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: https://news-web.php.net/php.internals/132995&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: https://news-web.php.net/php.internals/132995&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Voting thread:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;TBD&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Voting thread:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;https://news-web.php.net/php.internals/133116&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Introduction =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Introduction =====&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc?rev=1795017912&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-18T16:05:12+00:00</dc:date>
        <dc:creator>chrisabner (chrisabner@undisclosed.example.com)</dc:creator>
        <title>rfc - grapheme_str_pad: move to voting</title>
        <link>https://wiki.php.net/rfc?rev=1795017912&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/17 19:42&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 14:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 14:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:invalid_filter_options|Add Filter\Filter and Filter\Flag Enums]] (2026-10-03)&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:invalid_filter_options|Add Filter\Filter and Filter\Flag Enums]] (2026-10-03)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * [[rfc:grapheme_str_pad|grapheme_str_pad()]] (2026-11-18)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Under Discussion =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Under Discussion =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 24:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 25:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:sunset_pecl|Sunset PECL]] (Created 2026-11-05, Discussion started 2026-11-05)&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:sunset_pecl|Sunset PECL]] (Created 2026-11-05, Discussion started 2026-11-05)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:context-managers-v2|Context Managers, version 2]] (Created 2026-10-23, Discussion started 2026-11-05)&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:context-managers-v2|Context Managers, version 2]] (Created 2026-10-23, Discussion started 2026-11-05)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * [[rfc:grapheme_str_pad|grapheme_str_pad()]] (Created 2026-11-03, Discussion started 2026-11-03)&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:password_bcrypt_wrap|Add PASSWORD_BCRYPT_WRAP]] (Created 2026-10-29, Discussion started 2026-10-29)&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:password_bcrypt_wrap|Add PASSWORD_BCRYPT_WRAP]] (Created 2026-10-29, Discussion started 2026-10-29)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:scope|Scope]] (Created 2026-10-23, Discussion started 2026-10-26)&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[rfc:scope|Scope]] (Created 2026-10-23, Discussion started 2026-10-26)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/deprecations_php_8_7?rev=1794948619&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-17T20:50:19+00:00</dc:date>
        <dc:creator>narf (narf@undisclosed.example.com)</dc:creator>
        <title>deprecations_php_8_7 - &quot;snefru&quot; alias, hash_pbkdf2 options array</title>
        <link>https://wiki.php.net/rfc/deprecations_php_8_7?rev=1794948619&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/10 19:36&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 17:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 17:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Deprecate the b prefix for binary strings&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Deprecate the b prefix for binary strings&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Deprecate &amp;lt;php&amp;gt;$algo&amp;lt;/php&amp;gt; integer values for &amp;lt;php&amp;gt;password_hash()&amp;lt;/php&amp;gt;, &amp;lt;php&amp;gt;password_needs_rehash()&amp;lt;/php&amp;gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Deprecate &amp;lt;php&amp;gt;$algo&amp;lt;/php&amp;gt; integer values for &amp;lt;php&amp;gt;password_hash()&amp;lt;/php&amp;gt;, &amp;lt;php&amp;gt;password_needs_rehash()&amp;lt;/php&amp;gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Deprecate &amp;#039;snefru&amp;#039; hash alias for &amp;#039;snefru256&amp;#039;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Deprecate &amp;lt;php&amp;gt;hash_pbkdf2()&amp;lt;/php&amp;gt; $options array.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposals =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposals =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 87:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 89:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Deprecated: Calling password_hash() with argument 2 ($algo) of type int is deprecated.\\&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Deprecated: Calling password_hash() with argument 2 ($algo) of type int is deprecated.\\&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Deprecated: Calling password_needs_rehash() with argument 2 ($algo) of type int is deprecated.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Deprecated: Calling password_needs_rehash() with argument 2 ($algo) of type int is deprecated.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;/blockquote&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;==== Deprecate &amp;#039;snefru&amp;#039; hash alias for &amp;#039;snefru256&amp;#039; ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Author: Andrey Andreev &amp;lt;narf@devilix.net&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Snefru is a legacy hash function that has 128-bit and 256-bit output variants. PHP has only ever supported the 256-bit version and first named it just &amp;lt;php&amp;gt;&amp;quot;snefru&amp;quot;&amp;lt;/php&amp;gt; back when it was introduced in PHP 5.1, while &amp;lt;php&amp;gt;&amp;quot;snefru256&amp;quot;&amp;lt;/php&amp;gt; was added with the Mhash compatibility layer shortly after. Today, &amp;lt;php&amp;gt;&amp;quot;snefru&amp;quot;&amp;lt;/php&amp;gt; is effectively an alias for &amp;lt;php&amp;gt;&amp;quot;snefru256&amp;quot;&amp;lt;/php&amp;gt; and it is the only such alias in &amp;#039;&amp;#039;ext/hash&amp;#039;&amp;#039;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;However unlikely it is for Snefru to be used today, the alias is ambiguous and naturally mistaken for the Snefru128 variant. A deprecation notice may also help uncover forgotten uses of Snefru and induce long-overdue transitions away from it.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;If accepted, calling any function from &amp;#039;&amp;#039;ext/hash&amp;#039;&amp;#039; with &amp;lt;php&amp;gt;&amp;quot;snefru&amp;quot;&amp;lt;/php&amp;gt; as the algorithm will emit a notice similar to:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;blockquote&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Deprecated: Use of &amp;#039;snefru&amp;#039; algorithm alias is deprecated; use &amp;#039;snefru256&amp;#039; instead.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;/blockquote&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;==== Deprecate hash_pbkdf2() $options array ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Author: Andrey Andreev &amp;lt;narf@devilix.net&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;As of PHP 8.1, &amp;lt;php&amp;gt;hash_pbkdf2()&amp;lt;/php&amp;gt; has a 7th parameter, &amp;#039;&amp;#039;array $options = []&amp;#039;&amp;#039;, which does nothing as it was added for MurmurHash3 and XXHash. Both of those are non-cryptographic hashes and therefore unusable with PBKDF2. Furthermore, PBKDF2 is entirely bound to the HMAC construct and already has discrete parameters for everything that should be customizable about it, so even theoretical future use isn&amp;#039;t plausible. The parameter seems to have been added by mistake while other &amp;#039;&amp;#039;ext/hash&amp;#039;&amp;#039; functions were being modified.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;If accepted, calling &amp;lt;php&amp;gt;hash_pbkdf2()&amp;lt;/php&amp;gt; with the 7th parameter set to any value will emit a notice similar to:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;blockquote&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Deprecated: Use of $options array with hash_pbkdf2() is deprecated.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/blockquote&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/blockquote&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/openssl_get_channel_binding?rev=1794944594&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-17T19:43:14+00:00</dc:date>
        <dc:creator>sjoerd (sjoerd@undisclosed.example.com)</dc:creator>
        <title>openssl_get_channel_binding</title>
        <link>https://wiki.php.net/rfc/openssl_get_channel_binding?rev=1794944594&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/06 16:14&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 4:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 4:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-10-30&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-10-30&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Sjoerd Langkemper, sjoerd-php@linuxonly.nl&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Sjoerd Langkemper, sjoerd-php@linuxonly.nl&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Status:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Under discussion&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Status:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Withdrawn&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Implementation: https://github.com/php/php-src/pull/24035&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Implementation: https://github.com/php/php-src/pull/24035&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: https://news-web.php.net/php.internals/132941&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: https://news-web.php.net/php.internals/132941&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/working_groups?rev=1794865411&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-16T21:43:31+00:00</dc:date>
        <dc:creator>ramsey (ramsey@undisclosed.example.com)</dc:creator>
        <title>working_groups</title>
        <link>https://wiki.php.net/rfc/working_groups?rev=1794865411&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/16 21:42&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Working Groups ======&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Working Groups ======&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Date: 2026-&lt;strong class=&quot;diff-mark&quot;&gt;05&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;25&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Date: 2026-&lt;strong class=&quot;diff-mark&quot;&gt;07&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;16&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Ben Ramsey, &amp;lt;ramsey@php.net&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Ben Ramsey, &amp;lt;ramsey@php.net&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Status: Under Discussion&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Status: Under Discussion&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/stream_errors?rev=1794859220&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-16T20:00:20+00:00</dc:date>
        <dc:creator>jordikroon (jordikroon@undisclosed.example.com)</dc:creator>
        <title>stream_errors - Document implementation commit</title>
        <link>https://wiki.php.net/rfc/stream_errors?rev=1794859220&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/08/24 10:11&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 629:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 629:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Implementation =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Implementation =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;After the project is implemented, this section will contain&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;https&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt;//github.com/php/php&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;src/&lt;/strong&gt;commit&lt;strong class=&quot;diff-mark&quot;&gt;/f2b371e747d26351cacba99d7fd696a5844e83fb&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;-&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the version(s) it was merged to &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - a link to the git&amp;#160;&lt;/strong&gt;commit&lt;strong class=&quot;diff-mark&quot;&gt;(s)&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== References =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== References =====&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/case_insensitive_ini_get_all?rev=1794806519&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-16T05:21:59+00:00</dc:date>
        <dc:creator>weilindu (weilindu@undisclosed.example.com)</dc:creator>
        <title>case_insensitive_ini_get_all - update status</title>
        <link>https://wiki.php.net/rfc/case_insensitive_ini_get_all?rev=1794806519&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/15 22:43&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 3:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 3:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-10-17&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-10-17&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Weilin Du, weilindu@php.net&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Weilin Du, weilindu@php.net&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Status:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Voting&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Status:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Implementated&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Implementation:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;TBD&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Implementation:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;https://github.com/php/php-src/pull/25448&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: [[https://externals.io/message/132226|Initial discussion]] [[https://news-web.php.net/php.internals/132875|Official RFC thread]]&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: [[https://externals.io/message/132226|Initial discussion]] [[https://news-web.php.net/php.internals/132875|Official RFC thread]]&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Voting thread: [[https://externals.io/message/132979|Voting thread]]&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Voting thread: [[https://externals.io/message/132979|Voting thread]]&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/dtls_support_in_ext_openssl?rev=1794786432&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-15T23:47:12+00:00</dc:date>
        <dc:creator>gianfriaur (gianfriaur@undisclosed.example.com)</dc:creator>
        <title>dtls_support_in_ext_openssl - fix Implementation section</title>
        <link>https://wiki.php.net/rfc/dtls_support_in_ext_openssl?rev=1794786432&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/15 23:41&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 270:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 270:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Implementation =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Implementation =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;TBD&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;After the RFC is implemented, this section should contain: &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - the version(s) it was merged into &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - a link to the git commit(s) &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - a link to the PHP manual entry for the feature&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== References =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== References =====&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/todo/php86?rev=1794616811&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-14T00:40:11+00:00</dc:date>
        <dc:creator>daniels (daniels@undisclosed.example.com)</dc:creator>
        <title>php86 - update RCs</title>
        <link>https://wiki.php.net/todo/php86?rev=1794616811&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/14 00:40&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 62:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 62:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Voting using STV (Single Transferable Vote) started on 31 March 2026 18:00:00 UTC. Voting will be open until 15 April 2026 18:00:00 UTC. Tiebreaking will be at the discretion of the prior branch RMs.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Voting using STV (Single Transferable Vote) started on 31 March 2026 18:00:00 UTC. Voting will be open until 15 April 2026 18:00:00 UTC. Tiebreaking will be at the discretion of the prior branch RMs.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Results: https://externals.io/message/130526#130645&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== 1st Preference ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== 1st Preference ====&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/friends?rev=1794615873&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-14T00:24:33+00:00</dc:date>
        <dc:creator>daniels (daniels@undisclosed.example.com)</dc:creator>
        <title>friends - update to target 8.7</title>
        <link>https://wiki.php.net/rfc/friends?rev=1794615873&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/06/08 18:39&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Friends ======&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Friends ======&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Version: 0.&lt;strong class=&quot;diff-mark&quot;&gt;4&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Version: 0.&lt;strong class=&quot;diff-mark&quot;&gt;5&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-05-04&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-05-04&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Daniel Scherzer, daniel.e.scherzer@gmail.com&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Daniel Scherzer, daniel.e.scherzer@gmail.com&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 223:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 223:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposed PHP Version(s) =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposed PHP Version(s) =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Next minor version (PHP 8.&lt;strong class=&quot;diff-mark&quot;&gt;6&lt;/strong&gt;).&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Next minor version (PHP 8.&lt;strong class=&quot;diff-mark&quot;&gt;7&lt;/strong&gt;).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== RFC Impact =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== RFC Impact =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 232:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 232:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Linters and IDEs will need to update for the new syntax.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Linters and IDEs will need to update for the new syntax.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Userland PHP libraries that have internal details exposed to other parts of the library via public methods may want to migrate to using friends once they require PHP 8.&lt;strong class=&quot;diff-mark&quot;&gt;6&lt;/strong&gt;+.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Userland PHP libraries that have internal details exposed to other parts of the library via public methods may want to migrate to using friends once they require PHP 8.&lt;strong class=&quot;diff-mark&quot;&gt;7&lt;/strong&gt;+.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To Existing Extensions ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To Existing Extensions ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 340:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 340:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * v0.3: dropped access to private parts, only allowing protected access&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * v0.3: dropped access to private parts, only allowing protected access&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * v0.4: improved discussion of inheritance of friendship with new example&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * v0.4: improved discussion of inheritance of friendship with new example&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * v0.5: updated to target PHP 8.7&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/scope?rev=1794589998&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-13T17:13:18+00:00</dc:date>
        <dc:creator>frodeborli (frodeborli@undisclosed.example.com)</dc:creator>
        <title>scope - 0.10: frame rule for fibers (as ext-scope 0.6.0); a new scope starts as a copy of its creator&#039;s state (from the discussion)</title>
        <link>https://wiki.php.net/rfc/scope?rev=1794589998&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/06 15:57&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Scope ======&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Scope ======&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Version: 0.&lt;strong class=&quot;diff-mark&quot;&gt;9.5&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Version: 0.&lt;strong class=&quot;diff-mark&quot;&gt;10&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Date: 2026-11-&lt;strong class=&quot;diff-mark&quot;&gt;06&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Date: 2026-11-&lt;strong class=&quot;diff-mark&quot;&gt;13&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Frode Børli, &amp;lt;frode@ennerd.com&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Frode Børli, &amp;lt;frode@ennerd.com&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Status: Under Discussion&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Status: Under Discussion&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 11:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 11:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Introduction =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Introduction =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;This RFC adds &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;:&amp;#160;&lt;/strong&gt;an object that identifies a unit of work&lt;strong class=&quot;diff-mark&quot;&gt;, such as&amp;#160;&lt;/strong&gt;an HTTP request, a queue job&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;or&amp;#160;&lt;/strong&gt;a CLI command.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;This RFC adds &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;an object that identifies a unit of work&lt;strong class=&quot;diff-mark&quot;&gt;:&amp;#160;&lt;/strong&gt;an HTTP request, a queue job&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;a CLI command.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;PHP has no object that represents a request, because until&amp;#160;&lt;/strong&gt;now a request has been one run of the engine from startup to shutdown. PHP increasingly runs long-lived&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;servers&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;handle&amp;#160;&lt;/strong&gt;many requests concurrently,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;some of them WebSockets that stay open&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;these need a common way&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;tell requests apart&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;C# and Java solve this with&amp;#160;&lt;/strong&gt;a request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope:&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;framework or container ties services to it&lt;/strong&gt;, for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;example&amp;#160;&lt;/strong&gt;one&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;PDO connection per request&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Until&amp;#160;&lt;/strong&gt;now a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;PHP&amp;#160;&lt;/strong&gt;request has been one run of the engine&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;from startup to shutdown&lt;strong class=&quot;diff-mark&quot;&gt;, so PHP never needed an object for it&lt;/strong&gt;. PHP increasingly runs&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;as a&amp;#160;&lt;/strong&gt;long-lived&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;handles&amp;#160;&lt;/strong&gt;many requests&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in one process, often&amp;#160;&lt;/strong&gt;concurrently,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with fibers. Such a server&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;every library running in it, needs to know which request the code that is running belongs&amp;#160;&lt;/strong&gt;to.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;PHP has no answer to that today. Each runtime invents its own (phasync has &amp;#039;&amp;#039;%%phasync::getContext()%%&amp;#039;&amp;#039;; others key state by &amp;#039;&amp;#039;%%Fiber::getCurrent()%%&amp;#039;&amp;#039;, which is wrong as soon as&amp;#160;&lt;/strong&gt;a request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;starts&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;second fiber)&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and a library written&amp;#160;&lt;/strong&gt;for one&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;runtime cannot use another&amp;#039;s&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;designed to complement Fibers&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;smallest possible primitive that PHP needs to further evolve asynchronous PHP&amp;#160;&lt;/strong&gt;in a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;way that&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;both backwards and forward compatible&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that answer,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;nothing more. It holds no values, runs nothing, and owns no fibers. Code asks for &amp;#039;&amp;#039;%%Scope::getCurrent()%%&amp;#039;&amp;#039; and gets&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;same object everywhere in the same request, including in the fibers and generators it starts, whichever library starts them. A container or library keeps per-request state&amp;#160;&lt;/strong&gt;in a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; keyed by it; the state is freed when the request&amp;#039;s scope&amp;#160;&lt;/strong&gt;is.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;It also gives request state an owner. Two secondary votes make&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;superglobals (&amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_POST%%&amp;#039;&amp;#039; and the others) and the session, and the default locale and default timezone, follow the current&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;. Async runtimes have long had to work around these being process-wide. Frameworks have tried to replace them with request objects, but that has fragmented the ecosystem: Symfony&amp;#039;s HttpKernel, PSR-7,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;PSR-7 itself used in different styles (double-pass middleware that is handed a response object, or PSR-15 handlers that return one). Code written for one does not run on another, while &amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%$_POST%%&amp;#039;&amp;#039; work everywhere. They are the most portable request API PHP has, so code will keep using them however many abstractions frameworks add. With &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; they stay safe to use when one process serves many requests&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Code that never creates a scope runs in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root&amp;#160;&lt;/strong&gt;scope and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;behaves exactly as today&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Code can create a scope, run code in it, and get&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;. Code that never creates one runs in the root scope, a single object for the whole request, so nothing changes for it. A server creates a scope per request it handles. That gives services the three lifetimes known from other platforms: singleton, scoped and transient. A framework keeps&amp;#160;&lt;/strong&gt;request state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in a &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; keyed by &amp;#039;&amp;#039;%%Scope&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt;:getCurrent()%%&amp;#039;&amp;#039;, and it is cleaned up as soon as&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;client&amp;#160;&lt;/strong&gt;request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ends. Most application code never touches &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;: the server creates the scopes,&amp;#160;&lt;/strong&gt;and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;container decides how its scoped services are keyed by them. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Two secondary votes use&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;to give&amp;#160;&lt;/strong&gt;request state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;an owner&lt;/strong&gt;: the request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;superglobals&amp;#160;&lt;/strong&gt;and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;session&amp;#160;&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;vote&amp;#160;&lt;/strong&gt;A), and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;default&amp;#160;&lt;/strong&gt;locale&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;timezone&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(vote B)&lt;/strong&gt;. They are the state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that concurrent&amp;#160;&lt;/strong&gt;requests in one&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;process currently overwrite&amp;#160;&lt;/strong&gt;for each&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;other&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;// A server runs each request in a scope of its own: &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;new Scope())-&amp;gt;run($handler, $request); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;// Code anywhere in that request can ask which request it belongs to: &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$this-&amp;gt;connections ??= new WeakMap(); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$db = $this-&amp;gt;connections[Scope::getCurrent()] ??= new PDO($dsn); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;long-running PHP server handles many requests in one process. Frameworks reset state between requests. Containers use runtime-specific identities to track request services. Event loops have their own way to track related work. PHP itself offers no common way to ask which request code is handling. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;There are three immediate uses for this. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Request-lifetime services.** A container needs to create one instance of a scoped service per request. Resetting the container works only when requests cannot overlap. Using &amp;#039;&amp;#039;%%Fiber::getCurrent(&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; as the key is also wrong: one request may start several fibers&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;they should not get separate sessions, database connections, or units of work. Loggers, tracers, and request caches have&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;same problem. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Engine request state.** PHP keeps superglobals, sessions, output buffers,&amp;#160;&lt;/strong&gt;locale&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;timezone&lt;strong class=&quot;diff-mark&quot;&gt;, error handlers, and ini settings in global state&lt;/strong&gt;. They are&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;reset between conventional requests, but two overlapping requests in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;same process cannot safely use different values. A scope provides an owner for this&amp;#160;&lt;/strong&gt;state&lt;strong class=&quot;diff-mark&quot;&gt;. Two secondary votes in this RFC move the request superglobals and session, and the default locale and timezone, into scopes. Other state is left for later RFCs. Class statics and &amp;#039;&amp;#039;%%$GLOBALS%%&amp;#039;&amp;#039; do not follow the scope: applications use them for caches and singletons, and keeping those warm across&amp;#160;&lt;/strong&gt;requests&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is why worker modes exist (see What follows the scope). Code that does not create scopes retains its current behavior. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Interoperability.** Runtimes provide their own request identity. For example, phasync uses &amp;#039;&amp;#039;%%phasync::getContext()%%&amp;#039;&amp;#039;. A library written for one runtime cannot use that identity&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;another. &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; gives them&amp;#160;&lt;/strong&gt;one&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;common identity. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A request can run in several fibers:&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;example, to perform parallel queries or stream a response. Those fibers should belong to the same request even when a library creates them. A scope is inherited when a fiber or generator is created. Each can therefore identify its request without relying on the scheduler. Request state belongs to the scope, not to the process or an individual fiber. This differs from the per-coroutine state proposed by the [[https://wiki.php.net/rfc/async_scheduler_abi|Concurrency Support in the PHP Engine]] RFC. Today fibers share output buffers, locale, and timezone. Giving&amp;#160;&lt;/strong&gt;each&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;coroutine its own empty copy would change that behavior, including for fibers within the same request. The two proposals can work together: schedulers can assign their coroutines to scopes, including coroutines that are not &amp;#039;&amp;#039;%%Fiber%%&amp;#039;&amp;#039; objects. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Other languages provide related mechanisms: Java&amp;#039;s &amp;#039;&amp;#039;%%ScopedValue%%&amp;#039;&amp;#039;, .NET&amp;#039;s &amp;#039;&amp;#039;%%ExecutionContext%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%AsyncLocal&amp;lt;T&amp;gt;%%&amp;#039;&amp;#039;, Python&amp;#039;s &amp;#039;&amp;#039;%%contextvars%%&amp;#039;&amp;#039;, Go&amp;#039;s &amp;#039;&amp;#039;%%context.Context%%&amp;#039;&amp;#039;, and Node&amp;#039;s &amp;#039;&amp;#039;%%AsyncLocalStorage%%&amp;#039;&amp;#039;. See Prior art. This RFC adds only an operation identity to PHP. Libraries and later RFCs decide what state to associate with it&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposal =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposal =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;proposal adds one final&amp;#160;&lt;/strong&gt;class&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and one method each to &amp;#039;&amp;#039;%%Fiber%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%Generator%%&amp;#039;&amp;#039;:&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;====&amp;#160;&lt;/strong&gt;The class&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;====&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;final class Scope&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;final class Scope&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;{&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;{&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; /** A new scope. It becomes current only inside run() or a closure from bind(). */&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function __construct() {}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function __construct() {}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; /**&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; /**&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;* Calls $callback&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with&amp;#160;&lt;/strong&gt;this scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;as the current scope,&amp;#160;&lt;/strong&gt;and returns its result. The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;previous&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;* Calls $callback&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in&amp;#160;&lt;/strong&gt;this scope and returns its result. The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;frame created for $callback,&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is restored when&amp;#160;&lt;/strong&gt;$callback returns or throws.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and every frame created from it, belong to this&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;. When&amp;#160;&lt;/strong&gt;$callback returns or throws&lt;strong class=&quot;diff-mark&quot;&gt;, &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160;* execution continues in the caller&amp;#039;s frame, which still belongs to its own scope&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*/&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*/&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function run(callable $callback, mixed ...$args): mixed {}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function run(callable $callback, mixed ...$args): mixed {}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; /**&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; /**&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;* Returns a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;new&amp;#160;&lt;/strong&gt;closure that runs&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$closure with&amp;#160;&lt;/strong&gt;this&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope as the current&amp;#160;&lt;/strong&gt;scope, whoever &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;* Returns a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;copy of $&lt;/strong&gt;closure that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;always&amp;#160;&lt;/strong&gt;runs&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in&amp;#160;&lt;/strong&gt;this scope, whoever&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;calls it: each call&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;calls it&lt;/strong&gt;, as run() does&lt;strong class=&quot;diff-mark&quot;&gt;, with any previous binding replaced&lt;/strong&gt;. The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;new closure&amp;#160;&lt;/strong&gt;keeps&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;creates its frame in this scope&lt;/strong&gt;, as run() does. The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;copy&amp;#160;&lt;/strong&gt;keeps $closure&amp;#039;s signature,&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*&amp;#160;&lt;/strong&gt;$closure&amp;#039;s signature&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(by-reference parameters, defaults, return type)&lt;/strong&gt;, $this and class&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*&amp;#160;&lt;/strong&gt;$this and class scope&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;$closure itself is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;unchanged. Binding a bound closure replaces &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;.&amp;#160;&lt;/strong&gt;$closure itself is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not modified, as with Closure::bind()&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160;* the binding&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*/&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160;*/&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function bind(Closure $closure): Closure {}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function bind(Closure $closure): Closure {}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; /** The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;In {main}&amp;#160;&lt;/strong&gt;outside any&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;run(), and in fibers and generators created there&lt;/strong&gt;, the root scope. */&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; /** The scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;of the frame that is executing&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Never null:&amp;#160;&lt;/strong&gt;outside any&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope&lt;/strong&gt;, the root scope. */&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public static function getCurrent(): Scope {}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public static function getCurrent(): Scope {}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; /** The scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that stands for code that is part&amp;#160;&lt;/strong&gt;of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;no operation. One&amp;#160;&lt;/strong&gt;object per PHP request&lt;strong class=&quot;diff-mark&quot;&gt;: in&amp;#160;&lt;/strong&gt;the CLI&lt;strong class=&quot;diff-mark&quot;&gt;, for the life of the process&lt;/strong&gt;. */&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; /** The scope of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;{main}: one&amp;#160;&lt;/strong&gt;object per PHP request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(per process under&amp;#160;&lt;/strong&gt;the CLI&lt;strong class=&quot;diff-mark&quot;&gt;)&lt;/strong&gt;. */&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public static function getRootScope(): Scope {}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public static function getRootScope(): Scope {}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;final class&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Fiber&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;final class&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Generator&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;{&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;{&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; /** The scope this&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fiber&amp;#160;&lt;/strong&gt;was&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;constructed&amp;#160;&lt;/strong&gt;in. */&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; /** The scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;of&amp;#160;&lt;/strong&gt;this&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generator&amp;#039;s frame: the scope it&amp;#160;&lt;/strong&gt;was&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;created&amp;#160;&lt;/strong&gt;in. */&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function getScope(): Scope {}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; public function getScope(): Scope {}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; // Existing methods unchanged.&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;==== The rule: a scope belongs to a stack frame ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;final class Generator &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;**&lt;strong class=&quot;diff-mark&quot;&gt;Every stack frame has a&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;. It is assigned when the frame is&amp;#160;&lt;/strong&gt;created&lt;strong class=&quot;diff-mark&quot;&gt;: the scope of the frame that created it, unless the frame is created by &amp;#039;&amp;#039;%%$scope-&amp;gt;run()%%&amp;#039;&amp;#039; or by calling a closure from &amp;#039;&amp;#039;%%$scope-&amp;gt;bind()%%&amp;#039;&amp;#039;, which give it &amp;#039;&amp;#039;%%$scope%%&amp;#039;&amp;#039;&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;It never changes while the frame exists. The current scope is the scope of the frame that is executing.*&lt;/strong&gt;* &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;{ &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; /&lt;/strong&gt;**&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;this generator was&amp;#160;&lt;/strong&gt;created&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in&lt;/strong&gt;. *&lt;strong class=&quot;diff-mark&quot;&gt;/&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;That is the whole model. Everything below follows from it, fibers and generators included. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160;public function getScope(): Scope&amp;#160;&lt;/strong&gt;{}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%&lt;/strong&gt;{&lt;strong class=&quot;diff-mark&quot;&gt;main&lt;/strong&gt;}&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039;&amp;#039;s frame has the root scope, so a program that never creates a scope runs entirely in the root scope. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;=== Functions and closures === &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Calling a function or closure creates a frame, which gets the caller&amp;#039;s scope. A closure does not capture a scope when it is defined: a closure is code, not a frame. The same closure runs in one scope when one request calls it, and in another when another request does.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Existing methods unchanged.&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;}&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$handler = function () { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; return Scope::getCurrent(); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;}; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$a = new Scope(); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$b = new Scope(); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;var_dump($a-&amp;gt;run($handler) === $a);&amp;#160; &amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;bool(true)&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;var_dump($b-&amp;gt;run($handler) === $b);&amp;#160; &amp;#160;// bool(true) &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;var_dump($handler() === Scope::getRootScope());&amp;#160; &amp;#160;// bool(true)&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;an identity&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not a&amp;#160;&lt;/strong&gt;container&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for values and not a task manager. One rule underlies the others:&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is bound when whatever will run the code is created&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A function call takes the&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current at the call&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and a &amp;#039;&amp;#039;%%Fiber%%&amp;#039;&amp;#039; or &amp;#039;&amp;#039;%%Generator%%&amp;#039;&amp;#039; object the scope current when the object is created. &amp;#039;&amp;#039;%%&lt;/strong&gt;run&lt;strong class=&quot;diff-mark&quot;&gt;()%%&amp;#039;&amp;#039; replaces&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for the duration of one call&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;In detail:&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;This&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;what applications need. They create route handlers, middleware&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;listeners and&amp;#160;&lt;/strong&gt;container&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;factories once, at startup, in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;, and call them during requests&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;If closures captured their creation&amp;#160;&lt;/strong&gt;scope,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;every handler would&amp;#160;&lt;/strong&gt;run&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root&amp;#160;&lt;/strong&gt;scope.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - &amp;#039;&amp;#039;%%$scope-&amp;gt;run&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;$callback)%%&amp;#039;&amp;#039; makes&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$scope%%&amp;#039;&amp;#039; the current scope while &amp;#039;&amp;#039;%%$callback%%&amp;#039;&amp;#039; runs, and restores the previous one afterwards, also when &amp;#039;&amp;#039;%%$callback%%&amp;#039;&amp;#039; throws. Calls nest: an inner &amp;#039;&amp;#039;%%run&lt;/strong&gt;()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;replaces the current scope until it returns. A scope keeps no link to the scope it was run from: a server that creates each scope while running in the previous one would otherwise keep the whole chain alive. Code that wants a hierarchy keeps one in a &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; from child to parent. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Internal functions that call back&amp;#160;&lt;/strong&gt;(&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;array_map&lt;/strong&gt;()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;usort&lt;/strong&gt;()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;preg_replace_callback&lt;/strong&gt;()%%&amp;#039;&amp;#039;)&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;create frames like any&amp;#160;&lt;/strong&gt;caller&lt;strong class=&quot;diff-mark&quot;&gt;, so callbacks&amp;#160;&lt;/strong&gt;run in the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with nothing to switch&lt;/strong&gt;. A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;destructor&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s frame is&amp;#160;&lt;/strong&gt;created&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;where&amp;#160;&lt;/strong&gt;the object is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;released&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;so it&amp;#160;&lt;/strong&gt;runs in the scope that is current&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;at&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;point&lt;/strong&gt;. An object that needs&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a particular scope for&amp;#160;&lt;/strong&gt;its&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;cleanup&amp;#160;&lt;/strong&gt;captures it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;at construction&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;calls&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$scope-&amp;gt;run()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in its destructor&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - A fiber belongs to the scope that is current when it is constructed&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for its whole life. The fiber holds a strong reference to its scope. Fibers that libraries construct on the application&amp;#039;s behalf join the operation without any cooperation from the library. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - A generator belongs to the scope that is current when it is created, that is, when the generator function is called, for its whole life, like a fiber. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - When a fiber or a generator runs, the current scope is its own: the scope it belongs to, or the scope of a&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;run&lt;/strong&gt;()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;call active inside it. Where it is resumed from doesn&amp;#039;t matter. Each fiber&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;each generator, and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;{main}%%&amp;#039;&amp;#039;, has its own current scope, saved and restored when execution switches between them. The current scope is therefore that of the innermost executing context, fiber or generator, together with any &amp;#039;&amp;#039;%%run&lt;/strong&gt;()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;active inside that context; a &amp;#039;&amp;#039;%%run(&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; active in a&amp;#160;&lt;/strong&gt;caller&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;never overrides the membership of a generator or fiber it resumes. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - Functions and closures&amp;#160;&lt;/strong&gt;run in the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;of their caller&lt;/strong&gt;. A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;closure returned by&amp;#160;&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;%%$scope-&amp;gt;bind($closure)%%&amp;#039;&amp;#039; runs in &amp;#039;&amp;#039;%%$scope%%&amp;#039;&amp;#039;, whoever calls it. &amp;#039;&amp;#039;%%bind()%%&amp;#039;&amp;#039; returns a new closure, with any previous binding replaced: &amp;#039;&amp;#039;%%$a-&amp;gt;bind($b-&amp;gt;bind($f))%%&amp;#039;&amp;#039; runs &amp;#039;&amp;#039;%%$f%%&amp;#039;&amp;#039; in &amp;#039;&amp;#039;%%$a%%&amp;#039;&amp;#039;. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - In &amp;#039;&amp;#039;%%{main}%%&amp;#039;&amp;#039;, outside any &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;, and in fibers and generators&amp;#160;&lt;/strong&gt;created&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;there,&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current scope is the root scope, &amp;#039;&amp;#039;%%Scope::getRootScope()%%&amp;#039;&amp;#039;. The root scope is a single&amp;#160;&lt;/strong&gt;object&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that lives from engine startup to shutdown: under the CLI that&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the whole process&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;under a SAPI that serves several requests per process, such as php-fpm, there is one root per request. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - A destructor&amp;#160;&lt;/strong&gt;runs in the scope that is current&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;when its object is released, like any other function. An object released during another operation&amp;#039;s &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; therefore runs its destructor in&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;operation&amp;#039;s scope&lt;/strong&gt;. An object that needs its&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;own scope at destruction&amp;#160;&lt;/strong&gt;captures it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;when it is constructed,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;runs its cleanup with&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$scope-&amp;gt;run()%%&amp;#039;&amp;#039;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The root&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is used when code is not running inside an explicitly created scope. It covers ordinary CLI and php&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;fpm execution and&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server loop.&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;Scope::getCurrent() !== Scope::getRootScope()&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;tests whether code is&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;an explicit operation.&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;getCurrent()&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;always returns an object, so callers never need a null case and can always use a scope as a&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;WeakMap&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;key&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;To run code outside an operation, call&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;Scope&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt;:getRootScope&lt;/strong&gt;()-&amp;gt;run($&lt;strong class=&quot;diff-mark&quot;&gt;f&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039;. State keyed by the root persists for the PHP request (for the lifetime of the process&amp;#160;&lt;/strong&gt;in a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;typical CLI program&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;=== run() === &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%$&lt;/strong&gt;scope-&lt;strong class=&quot;diff-mark&quot;&gt;&amp;gt;run($callback)%%&amp;#039;&amp;#039; creates&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;frame for&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$callback&lt;/strong&gt;%%&amp;#039;&amp;#039; in &amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$scope&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;instead of the caller&amp;#039;s. Frames that frame creates inherit&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$scope&lt;/strong&gt;%%&amp;#039;&amp;#039;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;When&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$callback%%&amp;#039;&amp;#039; returns or throws, execution is back in the caller&amp;#039;s frame, whose scope never changed. Nothing needs restoring; calls nest naturally&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$a-&amp;gt;run(function&amp;#160;&lt;/strong&gt;()&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;use ($b) { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; // in $a &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; $b&lt;/strong&gt;-&amp;gt;run(&lt;strong class=&quot;diff-mark&quot;&gt;function () { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // in&amp;#160;&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;b &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; }&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; //&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$&lt;/strong&gt;a&lt;strong class=&quot;diff-mark&quot;&gt;: this frame&amp;#039;s scope never changed &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;}&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; takes any callable, partial function applications included. The placeholder decides whether the call happens inside the scope:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; takes any callable, partial function applications included. The placeholder decides whether the call happens inside the scope:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 110:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 109:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Ordinary closures do not capture a&amp;#160;&lt;/strong&gt;scope.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Most applications create route handlers, middleware, listeners&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and container factories at startup, then call them during requests&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;If closures inherited their creation scope&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;those handlers would always run in the root scope&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;When a callback must run in&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;where&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;was registered&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the caller binds&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;explicitly&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;keeps no link to the scope it was run from (see Rejected Features)&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;=== Generators === &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Calling a generator function creates the generator&amp;#039;s frame&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;as calling any function creates a frame&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A &amp;#039;&amp;#039;%%Generator%%&amp;#039;&amp;#039; object //is// that frame&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;suspended between steps&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;So it has&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;of the code that called the generator function, and keeps&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;across every &amp;#039;&amp;#039;%%yield%%&amp;#039;&amp;#039;&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;whoever resumes&amp;#160;&lt;/strong&gt;it:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;listener&amp;#160;&lt;/strong&gt;= Scope&lt;strong class=&quot;diff-mark&quot;&gt;::getCurrent&lt;/strong&gt;()-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;bind&lt;/strong&gt;(function (&lt;strong class=&quot;diff-mark&quot;&gt;Event $e&lt;/strong&gt;) { &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;scope&amp;#160;&lt;/strong&gt;=&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;new&amp;#160;&lt;/strong&gt;Scope()&lt;strong class=&quot;diff-mark&quot;&gt;; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;// runs in the scope that registered it, whichever scope dispatches the event&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$gen = $scope&lt;/strong&gt;-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;run&lt;/strong&gt;(function () { &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;return (function () { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; while (true) { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; yield Scope::getCurrent(); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; } &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; })();&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;});&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;});&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;bus&lt;/strong&gt;-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;on&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;order.paid&amp;#039;&lt;/strong&gt;, $&lt;strong class=&quot;diff-mark&quot;&gt;listener&lt;/strong&gt;);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;var_dump(&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;gen&lt;/strong&gt;-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;current&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;) === $scope);&amp;#160; &amp;#160;// bool(true)&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;although the root scope resumed it &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;other = new Scope(&lt;/strong&gt;);&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$other-&amp;gt;run(fn() =&amp;gt; $gen-&amp;gt;next()); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;var_dump($gen-&amp;gt;current() === $scope);&amp;#160; &amp;#160;// bool(true)&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%bind()%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;similar&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;wrapping&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;closure in &amp;#039;&amp;#039;%%fn(&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;..$&lt;/strong&gt;a&lt;strong class=&quot;diff-mark&quot;&gt;) =&amp;gt; $scope&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;&amp;gt;run($closure, ...$a)%%&amp;#039;&amp;#039;. Unlike a userland wrapper, it preserves by-reference parameters, defaults, return type, &amp;#039;&amp;#039;%%$this%%&amp;#039;&amp;#039;&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;class scope. Fibers and generators created by&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;bound closure inherit the bound scope&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Node&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%AsyncLocalStorage.bind()%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the proposed JavaScript &amp;#039;&amp;#039;%%AsyncContext.Snapshot.wrap()%%&amp;#039;&amp;#039; have a similar purpose.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;This&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not a special case: it is the frame rule applied&amp;#160;&lt;/strong&gt;to a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;frame that outlives its call&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;It matters for streamed responses: an application returns&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;response&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;body generator from its request&lt;/strong&gt;, and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server consumes it later from its own loop&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The generator still sees its request&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;services, superglobals&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;connection:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The key rule is that a function keeps its current scope across &amp;#039;&amp;#039;%%yield%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%Fiber&lt;/strong&gt;::&lt;strong class=&quot;diff-mark&quot;&gt;suspend&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&lt;/strong&gt;&amp;#039;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Its scope changes only when it calls&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;%%run&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;or enters another execution context&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;. Resuming it from another scope does not change its scope.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;// In the application, inside the request&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;return new Response(body&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(function&amp;#160;&lt;/strong&gt;()&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;use ($db) { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; foreach ($db-&amp;gt;pdo()-&amp;gt;query(&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;SELECT ..&lt;/strong&gt;.&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;) as $row) {&amp;#160; &amp;#160;// this request&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s connection &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; yield json_encode&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;$row); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; } &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;}&lt;/strong&gt;)()&lt;strong class=&quot;diff-mark&quot;&gt;); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A scope does not wait for fibers, cancel work, or finish when&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;run()&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;returns. It stays alive while something references it: a fiber&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;queued callback&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;request object, or other value. The server releases its references when it is done. Once&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;becomes unreachable, &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; entries keyed by&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;can be collected&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;With&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;yield from&lt;/strong&gt;%%&amp;#039;&amp;#039;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the inner generator runs in its own frame&amp;#039;s scope&lt;/strong&gt;, the scope it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;was created in&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Libraries store per-&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;data&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a&amp;#160;&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; keyed by&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;Scope&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;. They do not need to share a registry or agree on keys. PHP 8.3 and later can also collect cycles where&amp;#160;&lt;/strong&gt;a &amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;WeakMap&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;value refers back to its key:&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;=== bind() === &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A closure has no&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;, so a closure registered&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;one request and called from another runs in the caller&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s. When that is wrong, the code that registers it binds it:&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$scope-&amp;gt;bind($closure)&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;returns&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;closure whose every call creates its frame in&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$scope&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;final class RequestServices&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;// Registered while handling an order request:&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;{ &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$bus-&amp;gt;on(&amp;#039;order.paid&amp;#039;, Scope::getCurrent()-&amp;gt;bind(function (Event $e)&amp;#160;&lt;/strong&gt;{ &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;private static ?WeakMap $services = null&lt;/strong&gt;;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;// runs in the order request&amp;#039;s scope, whichever scope dispatches the event &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;}))&lt;/strong&gt;;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; public static function get&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;string $id&lt;/strong&gt;):&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;object &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%bind&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; is to scopes what &amp;#039;&amp;#039;%%Closure&lt;/strong&gt;::&lt;strong class=&quot;diff-mark&quot;&gt;bind&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; is to &amp;#039;&amp;#039;%%&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;this%%&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;. It differs from&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;userland wrapper such as&amp;#160;&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;%%fn(...&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;a)&amp;#160;&lt;/strong&gt;=&lt;strong class=&quot;diff-mark&quot;&gt;&amp;gt; $scope-&amp;gt;run&lt;/strong&gt;($&lt;strong class=&quot;diff-mark&quot;&gt;closure, ...&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;a)%%&amp;#039;&amp;#039; in that the result keeps &amp;#039;&amp;#039;%%$closure%%&amp;#039;&amp;#039;&amp;#039;s by-reference parameters, defaults,&amp;#160;&lt;/strong&gt;return&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;type, &amp;#039;&amp;#039;%%&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;this%%&amp;#039;&amp;#039; and class&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;, and is the same kind of closure. Node&amp;#039;s &amp;#039;&amp;#039;%%AsyncLocalStorage.bind&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; and TC39&amp;#039;s &amp;#039;&amp;#039;%%AsyncContext.Snapshot.wrap()%%&amp;#039;&amp;#039; serve the same purpose.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; { &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $scope = Scope&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt;:getCurrent&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if (&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;scope === Scope::getRootScope()) { &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw new LogicException(&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;Not running inside&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;request scope&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; } &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;services ??&lt;/strong&gt;=&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;new WeakMap&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;services[&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;scope] ??= []; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;&lt;/strong&gt;return&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;self::$services[&lt;/strong&gt;$scope&lt;strong class=&quot;diff-mark&quot;&gt;][$id] ??= self::create&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;$id&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; }&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; private static function create(string $id): object&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;=== Fibers ===&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160;{&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;// application&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;specific &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A fiber is not a special case either. Constructing a fiber creates no frame; &amp;#039;&amp;#039;%%$fiber&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;&amp;gt;start()%%&amp;#039;&amp;#039; creates its first frame, and that frame gets the scope of the code that calls &amp;#039;&amp;#039;%%start()%%&amp;#039;&amp;#039;, like any call. From then on the fiber&amp;#039;s frames keep their scopes while it is suspended, and resuming it from another scope changes nothing:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; } &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;}&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;// In the server, for each request:&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;$scope = new Scope();&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;$scope = new Scope();&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;scope-&amp;gt;run&lt;/strong&gt;(function () { &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;fiber = new Fiber&lt;/strong&gt;(function () { &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$db = RequestServices&lt;/strong&gt;::&lt;strong class=&quot;diff-mark&quot;&gt;get&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;db&amp;#039;&lt;/strong&gt;);&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;created for this request&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;var_dump(Scope&lt;/strong&gt;::&lt;strong class=&quot;diff-mark&quot;&gt;getCurrent&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;)&lt;/strong&gt;);&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$scope&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$fiber = new&amp;#160;&lt;/strong&gt;Fiber&lt;strong class=&quot;diff-mark&quot;&gt;(function&amp;#160;&lt;/strong&gt;()&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;{&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; Fiber&lt;strong class=&quot;diff-mark&quot;&gt;::suspend&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;;&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;RequestServices&lt;/strong&gt;::&lt;strong class=&quot;diff-mark&quot;&gt;get&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;db&amp;#039;&lt;/strong&gt;);&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the same instance: same&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160;var_dump(Scope&lt;/strong&gt;::&lt;strong class=&quot;diff-mark&quot;&gt;getCurrent&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;)&lt;/strong&gt;);&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;still $&lt;/strong&gt;scope&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; }); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; $fiber-&amp;gt;start();&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;});&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;});&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;$scope-&amp;gt;run(fn() =&amp;gt; $fiber-&amp;gt;start());&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;// started in $scope: its first frame is $scope&amp;#039;s&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;(new Scope())-&amp;gt;run(fn() =&amp;gt; $fiber-&amp;gt;resume());&amp;#160; &amp;#160;// resumed from another scope: still $scope&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A container that currently keys services by&amp;#160;&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;%%Fiber::getCurrent&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;)%%&lt;/strong&gt;&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;can use &amp;#039;&amp;#039;%%Scope::getCurrent(&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; instead. That gives&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;same service to all fibers in one&amp;#160;&lt;/strong&gt;request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and also works&amp;#160;&lt;/strong&gt;without&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fibers&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A library that uses &amp;#039;&amp;#039;%%phasync::getContext&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;)%%&amp;#039;&amp;#039; today can use &amp;#039;&amp;#039;%%Scope&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt;:getCurrent(&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;%%&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039; instead and run under any runtime&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Most code starts a fiber where it constructs it, so a library&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s fibers&amp;#160;&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;an HTTP client&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s parallel requests, a driver&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s pool&lt;/strong&gt;)&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;belong to&amp;#160;&lt;/strong&gt;the request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that called the library,&amp;#160;&lt;/strong&gt;without&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the library doing anything&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;When starting is deferred to a scheduler, the scheduler runs the start as a queued callback, and an event loop already runs each callback in the scope it was queued from&amp;#160;&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;see Using a scope&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;event loops&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;, so the fiber again starts in the request&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s scope&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Code that hands&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fiber&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;something that starts it from&amp;#160;&lt;/strong&gt;another&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;wants&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fiber in&amp;#160;&lt;/strong&gt;its own,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;binds&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;closure&lt;/strong&gt;:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; is not serializable. It identifies work within one PHP process. To send&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;trace or request ID&amp;#160;&lt;/strong&gt;to another&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;process&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;store that ID as ordinary data associated with the scope&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;transmit&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ID. The receiver creates&amp;#160;&lt;/strong&gt;its own&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A scope has no start or end event and may be entered repeatedly&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;even from different fibers. In this example, one fiber inherits&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope when constructed; the other enters it explicitly&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;scope&amp;#160;&lt;/strong&gt;=&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;new Scope(); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;fiber&amp;#160;&lt;/strong&gt;= new Fiber(Scope::getCurrent()-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;bind&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;$work&lt;/strong&gt;));&amp;#160; &amp;#160;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;starts in this scope&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;whoever starts&amp;#160;&lt;/strong&gt;it&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$a = $scope-&amp;gt;run(fn() =&amp;gt;&amp;#160;&lt;/strong&gt;new Fiber(&lt;strong class=&quot;diff-mark&quot;&gt;fn() =&amp;gt;&amp;#160;&lt;/strong&gt;Scope::getCurrent()&lt;strong class=&quot;diff-mark&quot;&gt;));&amp;#160; &amp;#160;// constructed inside $scope &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$b = new Fiber(fn() =&amp;gt; $scope&lt;/strong&gt;-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;run(fn&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;) =&amp;gt; Scope::getCurrent()&lt;/strong&gt;));&amp;#160; &amp;#160;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;constructed outside&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;enters&amp;#160;&lt;/strong&gt;it&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$a-&amp;gt;start(); $b-&amp;gt;start(); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;var_dump($a-&amp;gt;getReturn() === $scope, $b-&amp;gt;getReturn() === $scope);&amp;#160; &amp;#160;// bool(true) bool(true)&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;====&amp;#160;&lt;/strong&gt;Fibers&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and generators ====&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Fibers&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;reused for many callbacks, as in Revolt&amp;#039;s callback fiber, need nothing: each callback is a new frame in the scope its loop runs it in.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A fiber inherits the&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current at construction. Existing fiber APIs do not change. &amp;#039;&amp;#039;%%Fiber::getScope()%%&amp;#039;&amp;#039; lets schedulers and other code inspect its membership.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== The root&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;====&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The scope is captured at construction, not at&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;start&lt;/strong&gt;()%%&amp;#039;&amp;#039;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;never changes&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Starting a fiber from another scope does not move it&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;Scope::getRootScope&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; is the scope of &amp;#039;&amp;#039;%%{main}&lt;/strong&gt;%%&amp;#039;&amp;#039;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;so of all code outside any &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;It lives as long as the PHP request&lt;/strong&gt;:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * under the CLI, that is the whole process&lt;/strong&gt;; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$fiber = new Fiber(fn() =&amp;gt; var_dump(Scope::getCurrent() === Scope::getRootScope()))&lt;/strong&gt;; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;* under php&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;fpm and other SAPIs that serve several requests per process, each request has its own root&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;, so nothing changes for code that never creates a scope.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$scope&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;&amp;gt;run(fn() =&amp;gt; $fiber-&amp;gt;start());&amp;#160; &amp;#160;// bool(true): the fiber was constructed outside any&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;If starting or resuming a fiber changed its membership&lt;/strong&gt;, a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fiber&lt;/strong&gt;&amp;#039;s request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;identity could change depending on who resumed&amp;#160;&lt;/strong&gt;it&lt;strong class=&quot;diff-mark&quot;&gt;. This proposal forbids that&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%getCurrent()%%&amp;#039;&amp;#039; always returns an object&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;so a scope can always be&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; key and callers never handle null. &amp;#039;&amp;#039;%%Scope::getCurrent() !== Scope::getRootScope()%%&amp;#039;&amp;#039; tells code whether it runs inside an explicit scope. A long-running server&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;own loop runs in the root scope and creates a scope for each&amp;#160;&lt;/strong&gt;request it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;handles&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;An event loop may need a service fiber that belongs to the loop rather than the request that caused its creation. It can construct that fiber in the loop&amp;#039;s own scope:&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== Lifetime ====&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A scope has no start or end event. It is an ordinary object: it stays alive while something references it&amp;#160;&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;a frame, a fiber, a generator, a queued callback, a request object&lt;/strong&gt;)&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and is freed when nothing does&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A server releases its references when the request is done; once the last fiber, generator and callback of that request is gone, the scope goes, and so do &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; entries keyed by it&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$this-&amp;gt;timerFiber = $this-&amp;gt;servicesScope-&amp;gt;run(fn&lt;/strong&gt;()&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;=&amp;gt; new Fiber($this-&amp;gt;runTimers(&lt;/strong&gt;..&lt;strong class=&quot;diff-mark&quot;&gt;.))); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Constructing a fiber allocates no stack;&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;start&lt;/strong&gt;()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;does&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A scope does not wait for fibers, cancel work or finish when&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;run&lt;/strong&gt;()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;returns. It may be entered any number of times, from any fiber&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Generators also capture the scope at creation, when the generator function is called.&amp;#160;&lt;/strong&gt;A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generator may be resumed by code from a different scope after each&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;yield&lt;/strong&gt;%%&amp;#039;&amp;#039;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Its&amp;#160;&lt;/strong&gt;request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;identity must not change in between:&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;A &amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;Scope&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is not serializable&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;It identifies work inside one process; to pass a trace or&amp;#160;&lt;/strong&gt;request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;id to another process, send the id.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;==&lt;strong class=&quot;diff-mark&quot;&gt;== What follows the scope, and what does not ====&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$db&amp;#160;&lt;/strong&gt;=&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$container-&amp;gt;get(PDO::class); &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;yield; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$db&amp;#160;&lt;/strong&gt;=&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$container-&amp;gt;get(PDO::class);&amp;#160; &amp;#160;// a different connection would be unexpected &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;This also matters&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;streamed responses&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The&amp;#160;&lt;/strong&gt;application&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;may create&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;response-body generator inside&amp;#160;&lt;/strong&gt;a request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;while&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server consumes&amp;#160;&lt;/strong&gt;it later&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;from&amp;#160;&lt;/strong&gt;its own&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;event loop&lt;/strong&gt;. The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generator still uses&amp;#160;&lt;/strong&gt;the request&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;services&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The primary vote moves no state at all: &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; is only an identity. Global variables and static properties never follow the scope, including under the secondary votes. Applications use them&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;caches, registries and singletons, and building those once and keeping them across requests is the reason to run as a long-lived server&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;If they followed the scope, every request would start cold. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;^State&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;^Belongs to&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ^Follows the scope&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;^ &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|class statics, function statics, &amp;#039;&amp;#039;%%$GLOBALS%%&amp;#039;&amp;#039;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|the&amp;#160;&lt;/strong&gt;application&lt;strong class=&quot;diff-mark&quot;&gt;, shared on purpose&amp;#160; |no&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|&amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_POST%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_COOKIE%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_FILES%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_SERVER%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; and ext/session&amp;#039;s state&amp;#160; |the request&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|yes, if vote A passes;&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;new scope starts as&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;copy of its creator&amp;#039;s&amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|default locale, default timezone&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the&amp;#160;&lt;/strong&gt;request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |yes, if vote B passes; a new scope starts as a copy of its creator&amp;#039;s&amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|output buffers, &amp;#039;&amp;#039;%%header()%%&amp;#039;&amp;#039;, error and exception handlers, &amp;#039;&amp;#039;%%ini_set()%%&amp;#039;&amp;#039; values&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;request&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|later, one RFC each&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;| &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|&amp;#039;&amp;#039;%%json_last_error()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%preg_last_error()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%error_get_last()%%&amp;#039;&amp;#039;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the call just made&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |no: see below&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;| &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|&amp;#039;&amp;#039;%%$_ENV%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%setlocale()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%chdir()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%umask()%%&amp;#039;&amp;#039;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the process&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|no&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|persistent connections (&amp;#039;&amp;#039;%%PDO::ATTR_PERSISTENT%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%pg_pconnect()%%&amp;#039;&amp;#039;, mysqli &amp;#039;&amp;#039;%%p:%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%pfsockopen()%%&amp;#039;&amp;#039;)&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|the process&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|later, on its own: see below&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Every kind of state that follows the scope starts, in a new scope, as a copy of the creator&amp;#039;s. That is one rule for the two votes here and for whatever later RFCs add, and&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is what lets them be added without disturbing code written before them: a scope that never mentions the new state sees its creator&amp;#039;s values, as it did while the state was process-wide, and only code that sets the state inside a scope sees a change, which is the containment a scope is for. Versions 0.9 to 0.9.5 of this text had a new scope start empty instead; the discussion showed that empty-start turns every&amp;#160;&lt;/strong&gt;later&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;addition into a behaviour change for code that merely reads the state, and that &amp;quot;empty&amp;quot; would need&amp;#160;&lt;/strong&gt;its own&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;definition for each kind of state. Response output is the one kind of state the copy rule does not fit, and is discussed under Future Scope&lt;/strong&gt;. The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;list there is the full picture this RFC takes the first step of. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Last-error functions need no isolation: fibers switch only when they suspend, so nothing runs between &amp;#039;&amp;#039;%%json_decode()%%&amp;#039;&amp;#039; and the &amp;#039;&amp;#039;%%json_last_error()%%&amp;#039;&amp;#039; that follows it. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Persistent connections are cached process-wide by their parameters, so two scopes can get the same database session at once, and a transaction in one would affect the other. A later RFC should lend a persistent connection to one scope at a time; until then, concurrent scopes should use non-persistent connections or a pool. This affects PDO, pgsql, mysqli and streams, and is not part of this RFC. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== Using a scope: request-lifetime services ==== &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; is not a service locator, and the RFC does not propose that application code look anything up through it. It is what a dependency injection container needs in order to offer the lifetime other platforms call //scoped//: one instance per request, shared by everything in that request, between a singleton (one per process) and a transient (one per resolution). Classes keep receiving their dependencies through their constructors; only the container, which code calls from&amp;#160;&lt;/strong&gt;the request&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;frames, sees the scope. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A complete PSR-11 container with the three lifetimes&lt;/strong&gt;:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;In the application, inside the request&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope:&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;final class Container implements Psr\Container\ContainerInterface &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;return new Response(body: (function () {&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;{ &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;foreach&amp;#160;&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;RequestServices&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt;:get(&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;db&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;)-&amp;gt;query(&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;...&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;) as&amp;#160;&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;row&lt;/strong&gt;) {&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; // the request&amp;#039;s connection&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; private array $shared = []; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;yield json_encode(&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;row&lt;/strong&gt;);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; private WeakMap $scoped;&amp;#160; &amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Scope =&amp;gt; that scope&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;services&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;/** @param array&amp;lt;string, array{Closure&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;self)&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;mixed,&amp;#160;&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;singleton&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;|&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;scoped&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;|&amp;#039;transient&amp;#039;}&amp;gt; $services */ &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; public function __construct(private array&amp;#160;&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;services&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160;&amp;#160;&lt;/strong&gt;{ &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $&lt;strong class=&quot;diff-mark&quot;&gt;this-&amp;gt;scoped = new WeakMap(&lt;/strong&gt;);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; }&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; }&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;})());&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; public function get(string $id): mixed &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; [$make, $lifetime] = $this-&amp;gt;services[$id] ?? throw new NotFound($id); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if (&amp;#039;scoped&amp;#039; === $lifetime) { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $mine = $this-&amp;gt;scoped[Scope::getCurrent()] ??= new ArrayObject(); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; return $mine[$id] ??= $make($this); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;&lt;/strong&gt;}&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return &amp;#039;singleton&amp;#039; === $lifetime ? $this-&amp;gt;shared[$id] ??= $make($this&lt;/strong&gt;)&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;: $make&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;$this&lt;/strong&gt;)&lt;strong class=&quot;diff-mark&quot;&gt;; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; } &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; public function has(string $id): bool &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return isset($this-&amp;gt;services[$id]&lt;/strong&gt;);&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; } &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;}&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A generator that delegates with&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;yield from&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;runs the inner generator&amp;#160;&lt;/strong&gt;in the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;inner generator&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;own&amp;#160;&lt;/strong&gt;scope, the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;one it was created in&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The container is built once, in the root scope, and is not bound to it:&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;get()&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;creates its frame&amp;#160;&lt;/strong&gt;in the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope of whoever calls it, so it sees the request&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope. The request&amp;#039;s scoped services are freed with that&amp;#160;&lt;/strong&gt;scope,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;without&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;container ever hearing that the request ended&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== Functions and closures ====&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A singleton must not keep a scoped service it received in its constructor, the same rule as .NET&amp;#039;s &amp;#039;&amp;#039;%%ValidateScopes%%&amp;#039;&amp;#039;. When a long-lived service needs a per-request resource, it depends on a small singleton that resolves the resource per scope, as Spring&amp;#039;s scoped proxies do:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Ordinary function and closure calls use the caller&amp;#039;s current scope. They do not capture one at definition time. Otherwise, handlers created during startup would always run in the root scope. Capturing at every closure call would also add unnecessary switches to calls such as &amp;#039;&amp;#039;%%array_map()%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%usort()%%&amp;#039;&amp;#039;.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;final class TenantConnection &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;{ &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; private WeakMap $byScope;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Code that wants a closure to run in a particular scope binds it with &amp;#039;&amp;#039;%%&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;scope&lt;/strong&gt;-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;bind&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039;.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; public function __construct(private Closure $open) {&amp;#160;&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;this&lt;/strong&gt;-&amp;gt;&lt;strong class=&quot;diff-mark&quot;&gt;byScope = new WeakMap&lt;/strong&gt;()&lt;strong class=&quot;diff-mark&quot;&gt;; }&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;====&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Callbacks&amp;#160;&lt;/strong&gt;====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; public function pdo(): PDO &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; { &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return $this-&amp;gt;byScope[Scope::getCurrent()] ??&lt;/strong&gt;=&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;($this-&amp;gt;open)(); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; } &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;} &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Libraries store per-scope data in their own &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039;s. They need no shared registry and no naming convention for keys, and only the code that holds a map can reach what is in it. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;===&lt;strong class=&quot;diff-mark&quot;&gt;= Using a scope: event loops&amp;#160;&lt;/strong&gt;====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;An event loop&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;can preserve&amp;#160;&lt;/strong&gt;the registering scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;when it queues a callback&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Fibers carry their scope; callbacks, which have none, do not.&amp;#160;&lt;/strong&gt;An event loop&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that queues callbacks keeps&amp;#160;&lt;/strong&gt;the registering scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with each&lt;/strong&gt;:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 235:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 288:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;This works for fiber-based and callback-based loops.&amp;#160;&lt;/strong&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;loop must preserve&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;explicitly for callbacks, but fibers inherit it automatically. A scope does not&amp;#160;&lt;/strong&gt;run&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;anything by itself&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;queue&amp;#039;s reference keeps the&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;alive until the callback has&amp;#160;&lt;/strong&gt;run.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The queue&amp;#039;s reference keeps&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;its per-scope state, alive until&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;callback is released. Scopes have reference-based lifetimes, not enforced task lifetimes.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== Secondary vote A:&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;request superglobals&amp;#160;&lt;/strong&gt;and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;session follow the scope ====&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== Secondary vote A&lt;/strong&gt;: the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;request superglobals follow&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope ====&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Six superglobals hold request data&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_POST%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_COOKIE%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_FILES%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%$_SERVER%%&amp;#039;&amp;#039;; &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; and ext/session hold&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;session. Today they are one set per process, so two overlapping requests overwrite each other&amp;#039;s input and session unless&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server avoids them altogether. &amp;#039;&amp;#039;%%$_ENV%%&amp;#039;&amp;#039; is process state and is not included.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The primary&amp;#160;&lt;/strong&gt;vote&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;adds the identity only. Two independent secondary votes move specific PHP state into scopes. Vote&amp;#160;&lt;/strong&gt;A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;covers request input and sessions.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;If&amp;#160;&lt;/strong&gt;vote A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;passes, each scope has its own set:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Six superglobals hold request data&lt;/strong&gt;: &amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_GET&lt;/strong&gt;%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_POST&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_COOKIE&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;$_FILES&lt;/strong&gt;%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$_SERVER%%&amp;#039;&amp;#039;. &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ext/&lt;/strong&gt;session&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;hold&amp;#160;&lt;/strong&gt;the session. &amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_ENV&lt;/strong&gt;%%&amp;#039;&amp;#039; is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;process state&amp;#160;&lt;/strong&gt;and is not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;included&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Today these values are shared between overlapping requests in one PHP process unless&amp;#160;&lt;/strong&gt;the server&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;replaces or avoids&amp;#160;&lt;/strong&gt;them.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;One request&amp;#160;&lt;/strong&gt;can&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;overwrite another&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;input or&amp;#160;&lt;/strong&gt;session.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * The root scope&amp;#039;s are the ones the SAPI populates, so nothing changes for code that never creates a scope. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * A new scope starts as a copy of the scope that is current when it is constructed&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the six arrays hold the same values, and the session is in the same state (the same id, status and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_SESSION&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;). The copy is PHP&amp;#039;s copy of an array: nothing is duplicated until one side writes&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and an object held in an array is the same instance in both scopes, as in any copied array. From then on the two are independent: an assignment inside the new scope changes only its own array, and the creator&amp;#039;s values stay as they were when the copy was made. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * The copy is what makes a scope safe to create anywhere. Code that runs inside a scope it knows nothing about, such as a legacy function that reads&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_GET&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_SESSION&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;forty calls below the&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;run()&lt;/strong&gt;%%&amp;#039;&amp;#039;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;sees the values its caller saw, and what it changes does not reach the caller. The same rule holds for every kind of state a later RFC adds to the scope: it starts as a copy, so code that never sets it is not affected by the addition, and code that does set it keeps the change to itself. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * A server that starts a request wants a fresh set, and gets one by constructing the request&amp;#039;s scope from its own loop, which runs in the root scope: under the CLI the root&amp;#039;s arrays are the CLI&amp;#039;s and no session is active, so the copy is as good as empty, and the server fills the six as it does today (see below). Code that wants a scope emptier than its creator&amp;#039;s assigns or unsets what it does not want to pass on. There is no constructor option for starting empty (see Rejected Features). &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * Reads and writes inside a scope use that scope&amp;#039;s arrays. All frames of the scope share them, in every fiber and generator. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is a per-scope array like the others&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not a live merge, as today. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$_SERVER%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;mixes request facts (&amp;#039;&amp;#039;%%REQUEST_URI%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%REQUEST_METHOD%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%HTTP_*%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%REMOTE_ADDR%%&amp;#039;&amp;#039;) with the environment (&amp;#039;&amp;#039;%%PATH%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%DOCUMENT_ROOT%%&amp;#039;&amp;#039;)&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A new scope&amp;#039;s is a copy of its creator&amp;#039;s like the others; constructed from the root scope, that is the environment, and the server writes the request&amp;#039;s own entries over it. Left shared, it would hold whichever request wrote it last. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * The session is the scope&amp;#039;s: &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; inside a scope starts that scope&amp;#039;s session, and its state (&lt;/strong&gt;&amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;, id, status, save handler&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;data) is the scope&amp;#039;s alone. The &amp;#039;&amp;#039;%%&lt;/strong&gt;session&lt;strong class=&quot;diff-mark&quot;&gt;.*%%&amp;#039;&amp;#039; ini settings, and &amp;#039;&amp;#039;%%session_name()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%session_set_cookie_params()%%&amp;#039;&amp;#039; and&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;other functions that set them, stay request-wide like any &amp;#039;&amp;#039;%%ini_set()%%&amp;#039;&amp;#039; value. The&amp;#160;&lt;/strong&gt;session&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is written and closed by &amp;#039;&amp;#039;%%session_write_close()%%&amp;#039;&amp;#039; inside the scope, or at the latest when the scope is freed with the session still active&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A scope constructed while a session is active holds a copy of it: the same id and status and a copy of&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_SESSION&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;. It does not open the session again, so a locking save handler&amp;#039;s lock&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not taken twice; the lock is held&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;released by the scope that opened the session. A &amp;#039;&amp;#039;%%session_write_close()%%&amp;#039;&amp;#039; in the copy writes its &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; under that id, and the scope that opened the session writes its own when it closes it, so the later write wins, as when code keeps a copy of &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; in a variable and restores it. That&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the same containment as for the six arrays: what the copy changes does&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;reach its creator&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The headers &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; sends belong to the scope&amp;#039;s response; until headers follow the scope (see Future Scope)&amp;#160;&lt;/strong&gt;the server&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;routes&amp;#160;&lt;/strong&gt;them&lt;strong class=&quot;diff-mark&quot;&gt;, as it routes the rest of each response&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * A session whose save handler locks&amp;#160;&lt;/strong&gt;can&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;be open in one scope of a process at a time. A second scope opening the same session id, as a browser&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;parallel requests do, would otherwise wait for a lock only the first scope can release, while the process waits and the first scope cannot run. &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; therefore throws a &amp;#039;&amp;#039;%%RuntimeException%%&amp;#039;&amp;#039; in that case, without the id in the message. A scope that holds a copy of an active&amp;#160;&lt;/strong&gt;session&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;has not opened it, and is not a second opening. Locks held by other processes or threads are waited for as today; handlers that do not lock behave as under php-fpm&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;If vote A passes, each scope has its own request arrays and session: &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;*&lt;/strong&gt;*The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server fills them, not&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;application&lt;/strong&gt;.*&lt;strong class=&quot;diff-mark&quot;&gt;* Whatever&amp;#160;&lt;/strong&gt;creates the request&amp;#039;s scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(Swerve&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;FrankenPHP&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;RoadRunner) populates&amp;#160;&lt;/strong&gt;it,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;once,&amp;#160;&lt;/strong&gt;in the same&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;place where&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fills&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;superglobals&amp;#160;&lt;/strong&gt;today.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;In this example&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;request&lt;/strong&gt;%%&amp;#039;&amp;#039; is the server&amp;#039;s own&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;parsed HTTP&amp;#160;&lt;/strong&gt;request and &amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;app&lt;/strong&gt;%%&amp;#039;&amp;#039; the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;application&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;entry point&lt;/strong&gt;:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;* The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root scope&amp;#039;s arrays are&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ones the SAPI populates: unchanged behaviour for every script that never creates a scope&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;*&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A new scope starts empty: the six arrays are empty and no session is active (&amp;#039;&amp;#039;%%session_status()%%&amp;#039;&amp;#039; is &amp;#039;&amp;#039;%%PHP_SESSION_NONE%%&amp;#039;&amp;#039;). Whoever&amp;#160;&lt;/strong&gt;creates the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope seeds it, as a server does for each&amp;#160;&lt;/strong&gt;request&lt;strong class=&quot;diff-mark&quot;&gt;. A new scope does not inherit its creator&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;values. A&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is created for a new unit of work&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;typically a request in a long-lived server; inherited values would have to be cleared for every request&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and a server that missed one would hand&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;to the next request. Code that should see the current request&amp;#039;s values does not create a scope: it already runs in the request&amp;#039;s scope&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and so do the fibers and generators it creates. An inherited copy would also be shallow: an object stored&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039; or &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; would be&amp;#160;&lt;/strong&gt;the same&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;instance in both scopes. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * An assignment to one of the six inside a scope changes only that scope&amp;#039;s array. Reads see the current scope&amp;#039;s array. All fibers and generators of the scope share&amp;#160;&lt;/strong&gt;it&lt;strong class=&quot;diff-mark&quot;&gt;, as&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;rules above give. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * &amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039; is a scope-local snapshot like the others, not a live merge: a scope that assigns &amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039; and relies on &amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039; assigns it too, as code that assigns &amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039; must&amp;#160;&lt;/strong&gt;today.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Leaving&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_REQUEST&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;shared while the three it&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;built from are per scope would give one request two inconsistent views of its input, which is why it is in the set. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * &amp;#039;&amp;#039;%%$_SERVER%%&amp;#039;&amp;#039; mixes request facts (&amp;#039;&amp;#039;%%REQUEST_URI%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%REQUEST_METHOD%%&amp;#039;&amp;#039;, the &amp;#039;&amp;#039;%%HTTP_*%%&amp;#039;&amp;#039; entries, &amp;#039;&amp;#039;%%REMOTE_ADDR%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%HTTPS%%&amp;#039;&amp;#039;) with the environment (&amp;#039;&amp;#039;%%PATH%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%DOCUMENT_ROOT%%&amp;#039;&amp;#039;, what the application put there while booting). A request&amp;#039;s scope starts with an empty &amp;#039;&amp;#039;%%$_SERVER%%&amp;#039;&amp;#039; like the others, and&amp;#160;&lt;/strong&gt;the server&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;writes both into it: the environment entries it wants the request to see, then the request&lt;/strong&gt;&amp;#039;s own&lt;strong class=&quot;diff-mark&quot;&gt;. Leaving it shared would leave a&amp;#160;&lt;/strong&gt;request&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s own URI, method, headers&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;client address to whichever request wrote them last: read after the request&amp;#039;s first suspension, they would be another request&amp;#039;s, silently. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * The session is the scope&amp;#039;s: &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; inside a scope starts that scope&amp;#039;s session, and its state (&lt;/strong&gt;&amp;#039;&amp;#039;%%$&lt;strong class=&quot;diff-mark&quot;&gt;_SESSION&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;session id and status, the save handler and its data) is the scope&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;alone. The session&amp;#039;s settings are not: the &amp;#039;&amp;#039;%%session.*%%&amp;#039;&amp;#039; ini entries, and &amp;#039;&amp;#039;%%session_name()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%session_set_cookie_params()%%&amp;#039;&amp;#039; and the other functions that write them, stay request-wide like any &amp;#039;&amp;#039;%%ini_set()%%&amp;#039;&amp;#039; value. A started session can&amp;#039;t have them changed, as today. All fibers and generators of the scope share it, as they share the scope&amp;#039;s other superglobals. A scope has no end state (see above), so the session is written and closed when the server calls &amp;#039;&amp;#039;%%session_write_close()%%&amp;#039;&amp;#039; inside the scope at the end of the request, or at the latest when the scope is destroyed with the session still active, as at the end of a request today. The headers &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; sends (&amp;#039;&amp;#039;%%Set-Cookie%%&amp;#039;&amp;#039;, the cache limiter&amp;#039;s) belong to the scope&amp;#039;s response: until per-scope headers have their own RFC (see Future Scope), a server that hosts several requests in one process must route them, as it already routes the rest of each response. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * A session whose save handler locks it while it is open can be active in only one scope of a process at a time. Otherwise a second scope opening the same session id, as a browser&amp;#039;s parallel requests do, would wait for a lock that only the first scope can release, and the first scope cannot run while the process waits. &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; therefore throws a &amp;#039;&amp;#039;%%RuntimeException%%&amp;#039;&amp;#039; when the save handler locks and the session id is active in another scope of the same process; the message does not contain the id. A lock held by another process or thread is not affected: &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; waits for it as today. Save handlers that do not lock behave as they do under php-fpm, races included. The &amp;#039;&amp;#039;%%read_and_close%%&amp;#039;&amp;#039; option of &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; avoids holding the lock while other scopes run, but it is not applied implicitly. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The server remains responsible for initializing request data. It can do so inside the scope&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$env&amp;#160; &amp;#160;= $_SERVER;&amp;#160;&amp;#160;&lt;/strong&gt;// the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;process&amp;#039;s environment&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;read once&amp;#160;&lt;/strong&gt;in the root scope &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;For each request&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server accepts&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;from its loop&amp;#160;&lt;/strong&gt;in the root scope&lt;strong class=&quot;diff-mark&quot;&gt;:&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$scope =&amp;#160;&lt;/strong&gt;new Scope()&lt;strong class=&quot;diff-mark&quot;&gt;; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;(&lt;/strong&gt;new Scope()&lt;strong class=&quot;diff-mark&quot;&gt;)&lt;/strong&gt;-&amp;gt;run(function () use ($request, $&lt;strong class=&quot;diff-mark&quot;&gt;app&lt;/strong&gt;) {&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; // a copy of the root&amp;#039;s: the CLI&amp;#039;s arrays, no session&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;$scope&lt;/strong&gt;-&amp;gt;run(function () use ($request, $&lt;strong class=&quot;diff-mark&quot;&gt;handler, $env&lt;/strong&gt;) {&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_GET&amp;#160; &amp;#160; = $request-&amp;gt;query;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_GET&amp;#160; &amp;#160; = $request-&amp;gt;query;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_POST&amp;#160; &amp;#160;= $request-&amp;gt;parsedBody;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_POST&amp;#160; &amp;#160;= $request-&amp;gt;parsedBody;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_COOKIE = $request-&amp;gt;cookies;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_COOKIE = $request-&amp;gt;cookies;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_FILES&amp;#160; = $request-&amp;gt;uploads;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; $_FILES&amp;#160; = $request-&amp;gt;uploads;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; $_SERVER = $request-&amp;gt;serverParams + $&lt;strong class=&quot;diff-mark&quot;&gt;env&lt;/strong&gt;; // the request&amp;#039;s entries over the environment &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; $_SERVER = $request-&amp;gt;serverParams + $&lt;strong class=&quot;diff-mark&quot;&gt;_SERVER&lt;/strong&gt;;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;// the request&amp;#039;s entries over the environment&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the copy brought&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; $&lt;strong class=&quot;diff-mark&quot;&gt;handler&lt;/strong&gt;-&amp;gt;handle();&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;/strong&gt;// every fiber&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;of&amp;#160;&lt;/strong&gt;this request&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;sees these; no other request does&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; $&lt;strong class=&quot;diff-mark&quot;&gt;app&lt;/strong&gt;-&amp;gt;handle();&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;//&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the application, and&amp;#160;&lt;/strong&gt;every fiber&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it starts, sees&amp;#160;&lt;/strong&gt;this request&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s values&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;});&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;});&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Two scopes&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;can&amp;#160;&lt;/strong&gt;hold different values at the same time:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A scope created to guard the current state rather than to start a request, as a test or a plugin host does around code it does not trust with its superglobals, needs no setup at all: the code inside sees what the creator sees, and leaves it as it found it. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Two scopes hold different values at the same time&lt;strong class=&quot;diff-mark&quot;&gt;, and the root&amp;#039;s are untouched&lt;/strong&gt;:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 277:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 329:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;$b-&amp;gt;run(fn() =&amp;gt; $_GET = [&amp;#039;page&amp;#039; =&amp;gt; &amp;#039;2&amp;#039;]);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;$b-&amp;gt;run(fn() =&amp;gt; $_GET = [&amp;#039;page&amp;#039; =&amp;gt; &amp;#039;2&amp;#039;]);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;$a-&amp;gt;run(fn() =&amp;gt; var_dump($_GET[&amp;#039;page&amp;#039;]));&amp;#160; &amp;#160;// string(1) &amp;quot;1&amp;quot;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;$a-&amp;gt;run(fn() =&amp;gt; var_dump($_GET[&amp;#039;page&amp;#039;]));&amp;#160; &amp;#160;// string(1) &amp;quot;1&amp;quot;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;var_dump($_GET);&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;// the SAPI&amp;#039;s array&lt;strong class=&quot;diff-mark&quot;&gt;:&amp;#160;&lt;/strong&gt;unchanged&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;var_dump($_GET);&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;// the SAPI&amp;#039;s array&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;unchanged&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**References and globals.**&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%$GLOBALS[&amp;#039;_GET&amp;#039;]%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%global $_GET%%&amp;#039;&amp;#039; refer to the current scope&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;value&lt;/strong&gt;. A reference taken&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;before switching scopes&lt;/strong&gt;, such as &amp;#039;&amp;#039;%%$g = &amp;amp;$_GET%%&amp;#039;&amp;#039;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;continues&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;refer to the earlier&amp;#160;&lt;/strong&gt;array&lt;strong class=&quot;diff-mark&quot;&gt;. Switching scopes changes the global binding, not existing references&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#039;&amp;#039;%%$GLOBALS[&amp;#039;_GET&amp;#039;]%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%global $_GET%%&amp;#039;&amp;#039; refer to the current scope&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;array&lt;/strong&gt;. A reference taken&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in one scope&lt;/strong&gt;, such as &amp;#039;&amp;#039;%%$g = &amp;amp;$_GET%%&amp;#039;&amp;#039;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;keeps referring&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that scope&amp;#039;s&amp;#160;&lt;/strong&gt;array&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;after a switch&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;**Implementation.**&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;In&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;engine each&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;holds its own&amp;#160;&lt;/strong&gt;six &amp;#039;&amp;#039;%%zval%%&amp;#039;&amp;#039;s,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and the current scope is&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;pointer in the executor globals&lt;/strong&gt;. The global symbol table&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s entries for the six,&amp;#160;&lt;/strong&gt;and &amp;#039;&amp;#039;%%PG(http_globals)%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;, resolve through the current scope, so a scope switch changes where these values are read from: nothing is moved, copied or compared,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a switch costs a few pointer stores, the same whatever the scopes hold. Reads and writes retain their current cost, plus one pointer load.&amp;#160;&lt;/strong&gt;ext/session&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;reaches its&amp;#160;&lt;/strong&gt;state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(&amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039;, the id, the status, the save handler and its data) through&amp;#160;&lt;/strong&gt;the current scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the same way. The extension cannot change where the engine reads these values&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;so it moves them between&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;symbol table&amp;#160;&lt;/strong&gt;and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scopes at every switch instead; its measurements below are an upper bound for the engine. The extension&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;tests cover &amp;#039;&amp;#039;%%PG(http_globals)%%&amp;#039;&amp;#039;, the lazily created auto-globals, &amp;#039;&amp;#039;%%unset($_GET)%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%global $_GET%%&amp;#039;&amp;#039;; the php-src implementation must pass the same tests&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Under ZTS&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;each thread has its own symbol table&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root scope&lt;/strong&gt;. Whether a save handler locks is declared by a new field of &amp;#039;&amp;#039;%%ps_module%%&amp;#039;&amp;#039;: the files handler sets it,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and modules such as the&amp;#160;&lt;/strong&gt;PECL redis and memcached&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;handlers&amp;#160;&lt;/strong&gt;can set it from their&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;own&amp;#160;&lt;/strong&gt;locking settings&lt;strong class=&quot;diff-mark&quot;&gt;. A&amp;#160;&lt;/strong&gt;user handler&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;built on&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%SessionHandler%%&amp;#039;&amp;#039; locks when the handler it wraps does&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;other user handlers are taken not to lock.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;**Implementation.**&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Constructing a scope copies&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s&amp;#160;&lt;/strong&gt;six &amp;#039;&amp;#039;%%zval%%&amp;#039;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and ext/session&amp;#039;s state into it&lt;/strong&gt;, a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;reference count increment per array, as for any array copy&lt;/strong&gt;. The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;engine swaps the six entries of the&amp;#160;&lt;/strong&gt;global symbol table&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(&lt;/strong&gt;and &amp;#039;&amp;#039;%%PG(http_globals)%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;)&amp;#160;&lt;/strong&gt;and ext/session&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s&amp;#160;&lt;/strong&gt;state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;when&amp;#160;&lt;/strong&gt;the current scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;changes&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;saving&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;outgoing scope&amp;#039;s&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;loading&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;incoming one&lt;/strong&gt;&amp;#039;s.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;No array is duplicated until one side writes&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;reads and writes cost what they cost today&lt;/strong&gt;. Whether a save handler locks is declared by a new field of &amp;#039;&amp;#039;%%ps_module%%&amp;#039;&amp;#039;: the files handler sets it, PECL redis and memcached can set it from their locking settings&lt;strong class=&quot;diff-mark&quot;&gt;, a&amp;#160;&lt;/strong&gt;user handler&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;extending&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%SessionHandler%%&amp;#039;&amp;#039; locks when the handler it wraps does&lt;strong class=&quot;diff-mark&quot;&gt;, and&amp;#160;&lt;/strong&gt;other user handlers are taken not to lock.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Why include them now?** These are the request values that long-running servers already need to isolate. Moving them first tests the scope-switching mechanism against existing PHP behavior. The same approach can later apply to other engine state. Vote A covers request input and sessions together. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;The extension implements this vote&lt;strong class=&quot;diff-mark&quot;&gt;, on by default&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;switchable with&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;scope.superglobals=0&lt;/strong&gt;%%&amp;#039;&amp;#039; (and &amp;#039;&amp;#039;%%scope.session=0%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for&amp;#160;&lt;/strong&gt;the session)&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;so it can be evaluated on its own; its current release starts a new scope empty&lt;/strong&gt;, and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;copy follows in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;next&lt;/strong&gt;. The userland polyfill does the same when an event loop reports scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;changes&lt;/strong&gt;; https://fiber-interop.github.io/conformance.html&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(&lt;/strong&gt;column &amp;quot;Scope state&amp;quot;) shows which&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;event&amp;#160;&lt;/strong&gt;loops can report every&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;change&amp;#160;&lt;/strong&gt;and which cannot, which is the case for doing it in the engine.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Reference implementation.**&amp;#160;&lt;/strong&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;accompanying&amp;#160;&lt;/strong&gt;extension implements this vote&lt;strong class=&quot;diff-mark&quot;&gt;: the six arrays are swapped in the symbol table (&lt;/strong&gt;and &amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;PG(http_globals)&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;) at every scope change together with ext/session&amp;#039;s state&amp;#160;&lt;/strong&gt;(&lt;strong class=&quot;diff-mark&quot;&gt;version 0.9 of this text changed the rule for a new scope from inheriting its creator&amp;#039;s arrays to starting empty, and added the session; the extension and the polyfill implement this since 0.4.0,&amp;#160;&lt;/strong&gt;and &amp;#039;&amp;#039;%%scope.session=0%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;leaves&amp;#160;&lt;/strong&gt;the session&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;process-wide&lt;/strong&gt;), and the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;lazily created auto-globals are forced at&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;first scope creation so a later-compiled &amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039; read cannot re-arm the engine&amp;#039;s JIT callback over a scope&amp;#039;s array. It is on by default and can be turned off with &amp;#039;&amp;#039;%%scope.superglobals=0%%&amp;#039;&amp;#039; so this vote can be evaluated independently&lt;/strong&gt;. The userland polyfill does the same when an event loop reports&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a change of&amp;#160;&lt;/strong&gt;scope;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the interoperability project where this is measured across event loops (&lt;/strong&gt;https://fiber-interop.github.io/conformance.html&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;column &amp;quot;Scope state&amp;quot;) shows which loops can report every&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;switch&amp;#160;&lt;/strong&gt;and which cannot, which is the case for doing it in the engine.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Secondary vote B: the default locale and timezone follow the scope ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Secondary vote B: the default locale and timezone follow the scope ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#039;&amp;#039;%%Locale::getDefault()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Locale::setDefault()%%&amp;#039;&amp;#039; (ext/intl)&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;and &amp;#039;&amp;#039;%%date_default_timezone_get()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%date_default_timezone_set()%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;, currently&amp;#160;&lt;/strong&gt;operate on&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ambient settings shared by requests in the same&amp;#160;&lt;/strong&gt;process.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Vote&amp;#160;&lt;/strong&gt;B&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;makes those&amp;#160;&lt;/strong&gt;defaults follow the scope&lt;strong class=&quot;diff-mark&quot;&gt;. The&amp;#160;&lt;/strong&gt;root&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;retains&amp;#160;&lt;/strong&gt;the SAPI&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;settings. A&amp;#160;&lt;/strong&gt;new scope starts&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;from the ini defaults rather than copying&amp;#160;&lt;/strong&gt;its creator&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;values. Changing either&amp;#160;&lt;/strong&gt;setting&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;affects&amp;#160;&lt;/strong&gt;only the current scope.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The implementation swaps the current values when the&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;changes&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#039;&amp;#039;%%Locale::getDefault()%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;/&lt;/strong&gt;&amp;#039;&amp;#039;%%Locale::setDefault()%%&amp;#039;&amp;#039; (ext/intl) and &amp;#039;&amp;#039;%%date_default_timezone_get()%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;/&lt;/strong&gt;&amp;#039;&amp;#039;%%date_default_timezone_set()%%&amp;#039;&amp;#039; operate on&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;one&amp;#160;&lt;/strong&gt;process&lt;strong class=&quot;diff-mark&quot;&gt;-wide setting today, so two concurrent requests cannot use different defaults&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;If vote&amp;#160;&lt;/strong&gt;B&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;passes, these&amp;#160;&lt;/strong&gt;defaults follow the scope&lt;strong class=&quot;diff-mark&quot;&gt;: the&amp;#160;&lt;/strong&gt;root&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;keeps&amp;#160;&lt;/strong&gt;the SAPI&amp;#039;s&lt;strong class=&quot;diff-mark&quot;&gt;, a&amp;#160;&lt;/strong&gt;new scope starts&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with&amp;#160;&lt;/strong&gt;its creator&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current defaults, and&amp;#160;&lt;/strong&gt;setting&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;either changes&amp;#160;&lt;/strong&gt;only the current scope&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%ini_set(&amp;#039;date.timezone&amp;#039;)%%&amp;#039;&amp;#039; stays request-wide: a&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that has set its own timezone ignores it, one that has not, and a copy of one that has not, follows it, as does &amp;#039;&amp;#039;%%intl.default_locale%%&amp;#039;&amp;#039;&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Reference implementation.**&amp;#160;&lt;/strong&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;accompanying&amp;#160;&lt;/strong&gt;extension implements this vote too&lt;strong class=&quot;diff-mark&quot;&gt;:&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;default&amp;#160;&lt;/strong&gt;timezone is one pointer swap&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;of ext/date&amp;#039;s current string&amp;#160;&lt;/strong&gt;per scope change; the locale, whose globals ext/intl does not expose&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;to other extensions&lt;/strong&gt;, is applied through&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%intl.default_locale%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ini entry&amp;#160;&lt;/strong&gt;only when&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the entering scope&amp;#039;s locale&amp;#160;&lt;/strong&gt;differs&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;from the live one (in&amp;#160;&lt;/strong&gt;core&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it would be the same&amp;#160;&lt;/strong&gt;plain&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;swap as the timezone)&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%scope.locale_timezone=0%%&amp;#039;&amp;#039; turns it off. Two details the text above leaves open, decided in the implementation&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;tested: &amp;#039;&amp;#039;%%ini_set(&amp;#039;&lt;/strong&gt;date&lt;strong class=&quot;diff-mark&quot;&gt;.timezone&amp;#039;)%%&amp;#039;&amp;#039; stays request-wide (a scope that has set its&amp;#160;&lt;/strong&gt;own&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;timezone ignores it; one that never did follows it)&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a new scope starts with the ini value of &amp;#039;&amp;#039;%%date.timezone%%&amp;#039;&amp;#039; (or &amp;quot;unset&amp;quot;, that is the ini fallback) and &amp;#039;&amp;#039;%%intl.default_locale%%&amp;#039;&amp;#039;, not with its creator&lt;/strong&gt;&amp;#039;s.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(Version 0.9 of this text changed this from inheriting the creator&amp;#039;s values; the extension and the polyfill implement it since 0.4.0.)&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;The extension implements this vote too&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(&amp;#039;&amp;#039;%%scope.locale_timezone=0%%&amp;#039;&amp;#039; turns it off); as under vote A, its current release starts a new scope from the ini values, and&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;copy follows in the next. The&amp;#160;&lt;/strong&gt;timezone is one pointer swap per scope change; the locale, whose globals ext/intl does not expose, is applied through &amp;#039;&amp;#039;%%intl.default_locale%%&amp;#039;&amp;#039; only when&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it&amp;#160;&lt;/strong&gt;differs&lt;strong class=&quot;diff-mark&quot;&gt;. In&amp;#160;&lt;/strong&gt;core&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;both are&amp;#160;&lt;/strong&gt;plain&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;swaps&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;This is a separate vote because ext/intl&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ext/&lt;/strong&gt;date&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;have their&amp;#160;&lt;/strong&gt;own&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;maintainers&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ICU&lt;/strong&gt;&amp;#039;s&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;process-wide default needs their review&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Applications already set locale and timezone per request. Without isolation, two concurrent requests cannot reliably use different defaults. This is a separate vote because ext/intl and ext/date have different implementation details and maintainers. ICU&amp;#039;s process-wide default and timezone validation also need review.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;===== Why in core =====&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== What follows the scope&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;what&amp;#160;&lt;/strong&gt;does not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;====&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The identity can almost be built in userspace&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;phasync has done so for two years: a context attached to each fiber, inherited by the fibers it starts. It&amp;#160;&lt;/strong&gt;does not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;quite work:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Only state that belongs&amp;#160;&lt;/strong&gt;to a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;logical operation should follow&amp;#160;&lt;/strong&gt;its scope. A global&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;variable is not automatically request&amp;#160;&lt;/strong&gt;state.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - **Generators cross fibers.** A generator passed from one request&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;another, concurrent one can produce one value in one fiber and the next in another. From userspace, the only way to know which request&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generator belongs to is to pass an identifying token into it. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - **Every runtime has&amp;#160;&lt;/strong&gt;its&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;own.** phasync, Amp and ReactPHP each tie code to a request their own way, so a library has to pick one or carry adapters for all. The fragmentation exists because core has no common identity. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - **Cost.** In the engine the current&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is a pointer saved and restored at fiber and generator switches&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;In userspace every lookup goes through the runtime, and generators cannot be followed at all. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - **Superglobals.** Only the engine can make &amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039; and the session follow the request (vote&amp;#160;&lt;/strong&gt;A&lt;strong class=&quot;diff-mark&quot;&gt;). Removing the process-wide nature of superglobals answers one of the oldest criticisms of PHP, without asking any code to change. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; - **No store.** The engine adds only the identity. A &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; that stored values would invite a&amp;#160;&lt;/strong&gt;global&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;service locator with string keys; a &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; per library keeps&amp;#160;&lt;/strong&gt;state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;private to the code that owns it&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;^State&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;^Belongs to&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ^Follows&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;^ &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;What remains is&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;class of bug every platform meets when&amp;#160;&lt;/strong&gt;one&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;process serves thousands of concurrent requests&lt;/strong&gt;: shared resources need&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;limits&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;pools&lt;/strong&gt;. Scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;does&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;cause&amp;#160;&lt;/strong&gt;that&lt;strong class=&quot;diff-mark&quot;&gt;; concurrency does&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|&amp;#039;&amp;#039;%%$_GET%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_POST%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_COOKIE%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_FILES%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_REQUEST%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_SERVER%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; and ext/session&amp;#039;s state&amp;#160; |the request&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|yes (vote A); a new scope starts empty&amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|default locale, default timezone&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the operation&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|yes (vote B)&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|output buffers, error and exception handlers, &amp;#039;&amp;#039;%%ini_set()%%&amp;#039;&amp;#039; values&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the operation&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|later,&amp;#160;&lt;/strong&gt;one&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;RFC each&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;| &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|&amp;#039;&amp;#039;%%json_last_error()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%preg_last_error()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%error_get_last()%%&amp;#039;&amp;#039;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the call just made&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |no&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;see below&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;| &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|class statics, function statics, &amp;#039;&amp;#039;%%$GLOBALS%%&amp;#039;&amp;#039;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|the application,&amp;#160;&lt;/strong&gt;shared&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;on purpose&amp;#160; &amp;#160; &amp;#160; &amp;#160; |no&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|&amp;#039;&amp;#039;%%$_ENV%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%setlocale()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%chdir()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%umask()%%&amp;#039;&amp;#039;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the process&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|no&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;|persistent&amp;#160;&lt;/strong&gt;resources&lt;strong class=&quot;diff-mark&quot;&gt;: &amp;#039;&amp;#039;%%PDO::ATTR_PERSISTENT%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%pg_pconnect()%%&amp;#039;&amp;#039;, mysqli &amp;#039;&amp;#039;%%p:%%&amp;#039;&amp;#039; hosts, &amp;#039;&amp;#039;%%pfsockopen()%%&amp;#039;&amp;#039;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; |the process, lent to one scope at a time&amp;#160; |later, on its own: see below&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; | &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Last-error functions do not&amp;#160;&lt;/strong&gt;need&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope isolation in this design: fibers switch only when suspended, so a call to &amp;#039;&amp;#039;%%json_decode()%%&amp;#039;&amp;#039; immediately followed by &amp;#039;&amp;#039;%%json_last_error()%%&amp;#039;&amp;#039; is not interrupted by another fiber. Reading another coroutine&amp;#039;s last error is not a supported pattern. Class and function statics, and ordinary &amp;#039;&amp;#039;%%$GLOBALS%%&amp;#039;&amp;#039; entries, stay shared because applications use them for caches, registries,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;singletons&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Statics that hold request data, such as a current user or a cache derived from the request, are already wrong in today&amp;#039;s worker modes; &amp;#039;&amp;#039;%%&lt;/strong&gt;Scope&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; gives that code a key to move the data to. Virtualizing them for legacy compatibility is a different feature. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Persistent connections are process-wide. PHP caches them in &amp;#039;&amp;#039;%%EG(persistent_list)%%&amp;#039;&amp;#039;, usually by connection parameters. Two scopes can obtain the same underlying database session at once. A transaction started in one scope could then affect the other scope&amp;#039;s queries and rollback. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A future RFC should ensure that two live scopes never use the same persistent connection concurrently, while allowing a connection to return to the pool after cleanup. That work affects PDO, pgsql, mysqli, and streams, and is&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;part of this RFC. Until then, concurrent scopes should use non-persistent connections, for example through a pool. Code&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;never creates scopes keeps its current behavior&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Prior art =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Prior art =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Other&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;languages already propagate execution context, though their APIs and inheritance rules differ: &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Other&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;platforms give&amp;#160;&lt;/strong&gt;each&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;unit&amp;#160;&lt;/strong&gt;of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;work an identity&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;follows&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;across&amp;#160;&lt;/strong&gt;asynchronous&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;boundaries&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;let containers&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;libraries&lt;/strong&gt;, not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;application&amp;#160;&lt;/strong&gt;code,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;use it:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Python:** &amp;#039;&amp;#039;%%contextvars%%&amp;#039;&amp;#039; ([[https://peps.python.org/pep-0567/|PEP 567]], Python 3.7). &amp;#039;&amp;#039;%%Context.run()%%&amp;#039;&amp;#039; calls a function in a given context, and asyncio runs&amp;#160;&lt;/strong&gt;each&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;task in a copy&amp;#160;&lt;/strong&gt;of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the context&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;was current when the task was created. Making generators keep a context of their own was proposed in [[https://peps.python.org/pep-0568/|PEP 568]], which is deferred. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **JavaScript:** Node.js has &amp;#039;&amp;#039;%%AsyncLocalStorage%%&amp;#039;&amp;#039;, with &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;. The TC39 [[https://github.com/tc39/proposal-async-context|AsyncContext]] proposal (Stage 2) moves the mechanism into the language, including &amp;#039;&amp;#039;%%AsyncContext.Snapshot%%&amp;#039;&amp;#039; for running a callback in the context&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;was captured in, because userland solutions such as Zone.js can&amp;#039;t follow &amp;#039;&amp;#039;%%async%%&amp;#039;&amp;#039;/&amp;#039;&amp;#039;%%await%%&amp;#039;&amp;#039; without transpilation. Generators restore the context that was current when they were created, as in this RFC; other functions run in their caller&amp;#039;s context. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Java:** &amp;#039;&amp;#039;%%InheritableThreadLocal%%&amp;#039;&amp;#039; values are inherited when a thread is constructed. Scoped values ([[https://openjdk.org/jeps/506|JEP 506]], JDK 25) are bound for the duration of a &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; call and inherited by the child threads of a &amp;#039;&amp;#039;%%StructuredTaskScope%%&amp;#039;&amp;#039;. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **.NET:** &amp;#039;&amp;#039;%%ExecutionContext%%&amp;#039;&amp;#039; is captured when&amp;#160;&lt;/strong&gt;asynchronous&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;work is started and restored when it runs&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%ExecutionContext.Run()%%&amp;#039;&amp;#039; runs a callback inside a given context, the same shape as &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; here. &amp;#039;&amp;#039;%%AsyncLocal&amp;lt;T&amp;gt;%%&amp;#039;&amp;#039; (.NET Framework 4.6) holds &amp;quot;ambient data that is local to a given asynchronous control flow&amp;quot;&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;flows with it. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Kotlin:** a coroutine inherits the &amp;#039;&amp;#039;%%CoroutineContext%%&amp;#039;&amp;#039; of the coroutine that launches it. &amp;#039;&amp;#039;%%launch(Job())%%&amp;#039;&amp;#039; starts one that is independent of its parent. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Swift:** task-local values ([[https://github.com/swiftlang/swift-evolution/blob/main/proposals/0311-task-locals.md|SE-0311]]&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Swift 5.5) are bound for the duration of a closure and inherited by child tasks, and&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;by detached tasks. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Go:** &amp;#039;&amp;#039;%%context.Context%%&amp;#039;&amp;#039; is passed explicitly, as a function parameter. That works in Go because its standard library and ecosystem adopted the convention. PHP&amp;#039;s libraries have no such convention, and fibers are created inside&amp;#160;&lt;/strong&gt;code&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that has no parameter to pass a context through. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Service containers.** ASP.NET Core&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Spring, and Jakarta CDI all support services tied to request or dependency-injection scopes. In PHP, Laravel supports scoped bindings and Symfony resets services between requests in long-running workers. These mechanisms have no shared language-level operation identity. &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; would give frameworks and libraries one.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;**&lt;strong class=&quot;diff-mark&quot;&gt;Earlier PHP proposals&lt;/strong&gt;.**&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The&amp;#160;&lt;/strong&gt;[[https://&lt;strong class=&quot;diff-mark&quot;&gt;wiki&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;php.net&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;rfc&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;fibers&lt;/strong&gt;|&lt;strong class=&quot;diff-mark&quot;&gt;Fibers RFC&lt;/strong&gt;]]&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;added the minimum needed&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;userland coroutines and left scheduling to libraries. It discussed synchronization&amp;#160;&lt;/strong&gt;of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;shared state but did not distinguish shared application state from state owned&amp;#160;&lt;/strong&gt;by a request.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The&amp;#160;&lt;/strong&gt;[[https://&lt;strong class=&quot;diff-mark&quot;&gt;wiki&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;php.net&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;rfc&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;async_scheduler_abi&lt;/strong&gt;|&lt;strong class=&quot;diff-mark&quot;&gt;Concurrency Support&lt;/strong&gt;]] RFC&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;proposes per&lt;/strong&gt;-coroutine&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;engine state&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;including output buffering&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;This RFC instead assigns request state to an operation that may contain several fibers or coroutines&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;These&amp;#160;&lt;/strong&gt;are&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;different ownership models&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;**.&lt;strong class=&quot;diff-mark&quot;&gt;NET:&lt;/strong&gt;**&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%ExecutionContext%%&amp;#039;&amp;#039; flows across &amp;#039;&amp;#039;%%await%%&amp;#039;&amp;#039;; &amp;#039;&amp;#039;%%AsyncLocal&amp;lt;T&amp;gt;%%&amp;#039;&amp;#039; holds &amp;quot;ambient data that is local to a given asynchronous control flow&amp;quot;. &amp;#039;&amp;#039;%%Microsoft.Extensions.DependencyInjection%%&amp;#039;&amp;#039; has &amp;#039;&amp;#039;%%ServiceLifetime.Scoped%%&amp;#039;&amp;#039;, ASP.NET Core creates one &amp;#039;&amp;#039;%%IServiceScope%%&amp;#039;&amp;#039; per request, and &amp;#039;&amp;#039;%%ValidateScopes%%&amp;#039;&amp;#039; rejects a scoped service injected into a singleton. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Java:** Spring&amp;#039;s &amp;#039;&amp;#039;%%@RequestScope%%&amp;#039;&amp;#039; and Jakarta CDI&amp;#039;s &amp;#039;&amp;#039;%%@RequestScoped%%&amp;#039;&amp;#039; give singletons a proxy that finds the current request&amp;#039;s instance through a &amp;#039;&amp;#039;%%ThreadLocal%%&amp;#039;&amp;#039;. Scoped values (&lt;/strong&gt;[[https://&lt;strong class=&quot;diff-mark&quot;&gt;openjdk&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;org&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;jeps&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;506&lt;/strong&gt;|&lt;strong class=&quot;diff-mark&quot;&gt;JEP 506&lt;/strong&gt;]]&lt;strong class=&quot;diff-mark&quot;&gt;, JDK 25) are bound&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the duration&amp;#160;&lt;/strong&gt;of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; call and inherited&amp;#160;&lt;/strong&gt;by&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the threads of&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%StructuredTaskScope%%&amp;#039;&amp;#039;, including virtual threads. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **JavaScript:** Node&amp;#039;s &amp;#039;&amp;#039;%%AsyncLocalStorage%%&amp;#039;&amp;#039;, with &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%bind()%%&amp;#039;&amp;#039;; NestJS&amp;#039;s&amp;#160;&lt;/strong&gt;request&lt;strong class=&quot;diff-mark&quot;&gt;-scoped providers and awilix&amp;#039;s &amp;#039;&amp;#039;%%createScope()%%&amp;#039;&amp;#039; use it&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;TC39&amp;#039;s&amp;#160;&lt;/strong&gt;[[https://&lt;strong class=&quot;diff-mark&quot;&gt;github&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;com&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;tc39&lt;/strong&gt;/&lt;strong class=&quot;diff-mark&quot;&gt;proposal-async-context&lt;/strong&gt;|&lt;strong class=&quot;diff-mark&quot;&gt;AsyncContext&lt;/strong&gt;]]&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(Stage 2) puts it in the language. Generators keep the context they were created in, as in this&amp;#160;&lt;/strong&gt;RFC&lt;strong class=&quot;diff-mark&quot;&gt;; other functions run in their caller&amp;#039;s. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Python:** &amp;#039;&amp;#039;%%contextvars%%&amp;#039;&amp;#039; ([[https://peps.python.org/pep&lt;/strong&gt;-&lt;strong class=&quot;diff-mark&quot;&gt;0567/|PEP 567]]), with &amp;#039;&amp;#039;%%Context.run()%%&amp;#039;&amp;#039;; asyncio runs each task in a copy of the context current when it was created. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Kotlin and Swift:** a&amp;#160;&lt;/strong&gt;coroutine&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;inherits its launcher&amp;#039;s &amp;#039;&amp;#039;%%CoroutineContext%%&amp;#039;&amp;#039;; Swift task-locals ([[https://github.com/swiftlang/swift-evolution/blob/main/proposals/0311-task-locals.md|SE-0311]]) are inherited by child tasks&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not detached ones&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Go:** &amp;#039;&amp;#039;%%context&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;Context%%&amp;#039;&amp;#039; is passed explicitly as the first parameter of every function. That works because Go&amp;#039;s ecosystem adopted it from the start. PHP&amp;#039;s has not, and fibers&amp;#160;&lt;/strong&gt;are&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;created inside code that has no parameter to pass a context through&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;%%Scope%%&amp;#039;&amp;#039; carries an identity&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not a table of values. &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039; provides per-scope storage&amp;#160;&lt;/strong&gt;without&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;adding&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;general-purpose storage API to PHP core&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;In PHP, Laravel&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s scoped bindings and Symfony&lt;/strong&gt;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s service resetting do the same job for workers that serve one request at a time&lt;/strong&gt;, without a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;shared identity&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;The [[https://wiki.php.net/rfc/true_async_scope|Async Scope]] proposal also uses the name //Scope//&lt;strong class=&quot;diff-mark&quot;&gt;. Its scope controls&amp;#160;&lt;/strong&gt;a group of coroutines&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and their&amp;#160;&lt;/strong&gt;lifetime&lt;strong class=&quot;diff-mark&quot;&gt;. This RFC&amp;#039;s&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;only identifies an operation; it&amp;#160;&lt;/strong&gt;owns no execution&lt;strong class=&quot;diff-mark&quot;&gt;. A&amp;#160;&lt;/strong&gt;scheduler could use both. //Context// was&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;also&amp;#160;&lt;/strong&gt;considered, but&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;commonly&amp;#160;&lt;/strong&gt;implies a collection of values and already&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;appears in PHP&amp;#160;&lt;/strong&gt;stream contexts&lt;strong class=&quot;diff-mark&quot;&gt;. Both names have the same backward-compatibility footprint: 3 of 100 sampled PHP files on GitHub declare a global &amp;#039;&amp;#039;%%class Context%%&amp;#039;&amp;#039;, and 3 of 100 a global &amp;#039;&amp;#039;%%class Scope%%&amp;#039;&amp;#039;&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Earlier PHP proposals.** The [[https://wiki.php.net/rfc/fibers|Fibers RFC]] left scheduling to libraries and did not distinguish application state from request state. The [[https://wiki.php.net/rfc/async_scheduler_abi|Concurrency Support]] RFC gives each coroutine its own engine state; this RFC gives it to the request, which may span several fibers that today share output buffers, locale and timezone. The two can work together: a scheduler can assign its coroutines to scopes.&amp;#160;&lt;/strong&gt;The [[https://wiki.php.net/rfc/true_async_scope|Async Scope]] proposal also uses the name //Scope//&lt;strong class=&quot;diff-mark&quot;&gt;, for&amp;#160;&lt;/strong&gt;a group of coroutines&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;whose&amp;#160;&lt;/strong&gt;lifetime&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it controls; this&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; owns no execution&lt;strong class=&quot;diff-mark&quot;&gt;, and a&amp;#160;&lt;/strong&gt;scheduler could use both. //Context// was considered, but implies a collection of values and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is&amp;#160;&lt;/strong&gt;already&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;used by&amp;#160;&lt;/strong&gt;stream contexts.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Backward Incompatible Changes =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Backward Incompatible Changes =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;A class named &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in the global namespace&amp;#160;&lt;/strong&gt;can no longer be declared&lt;strong class=&quot;diff-mark&quot;&gt;. Classes named &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a&amp;#160;&lt;/strong&gt;namespace are unaffected. Of the first 100 results of a GitHub code search for PHP files declaring &amp;#039;&amp;#039;%%class Scope%%&amp;#039;&amp;#039;, 88 are namespaced&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;and 2&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;declare it in the&amp;#160;&lt;/strong&gt;global&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;namespace:&amp;#160;&lt;/strong&gt;a toy interpreter&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in a multi-language repository&lt;/strong&gt;, and a project last changed in 2018&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(&lt;/strong&gt;a second sample on 2026-10-14 found 3 of 100). None of the top 1000 Composer packages (Packagist&amp;#039;s list of 2026-10-26&lt;strong class=&quot;diff-mark&quot;&gt;, latest stable versions&lt;/strong&gt;, 998&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;downloaded and&amp;#160;&lt;/strong&gt;parsed with nikic/php-parser) declares a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;class, interface, trait or enum named&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;global namespace, or aliases one to it.&amp;#160;&lt;/strong&gt;34 declarations in 14 packages&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;are namespaced (&lt;/strong&gt;among them&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Laravel&amp;#039;s&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Illuminate\Database\Eloquent\Scope%%&amp;#039;&amp;#039;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Sentry and league/fractal) and&amp;#160;&lt;/strong&gt;are&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;unaffected; the one non-&lt;/strong&gt;namespaced&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;file that refers to &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; imports &amp;#039;&amp;#039;%%PHPStan\Analyser\Scope%%&amp;#039;&amp;#039; with &amp;#039;&amp;#039;%%use%%&amp;#039;&amp;#039;&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;A class named &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; can no longer be declared in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the global&amp;#160;&lt;/strong&gt;namespace&lt;strong class=&quot;diff-mark&quot;&gt;; namespaced classes&amp;#160;&lt;/strong&gt;are unaffected. Of the first 100 results of a GitHub code search for PHP files declaring &amp;#039;&amp;#039;%%class Scope%%&amp;#039;&amp;#039;, 88 are namespaced and 2 global&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(&lt;/strong&gt;a toy interpreter, and a project last changed in 2018&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;a second sample on 2026-10-14 found 3 of 100). None of the top 1000 Composer packages (Packagist&amp;#039;s list of 2026-10-26, 998 parsed with nikic/php-parser) declares&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;or aliases&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;global&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;the 34 declarations in 14 packages&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;among them &amp;#039;&amp;#039;%%Illuminate\Database\Eloquent\Scope%%&amp;#039;&amp;#039;, are namespaced.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposed PHP Version(s) =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposed PHP Version(s) =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 345:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 381:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== RFC Impact =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== RFC Impact =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;====&amp;#160;&lt;/strong&gt;To the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Ecosystem ====&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**&lt;/strong&gt;To the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;ecosystem.** IDEs, language servers and static analysers need stubs for &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%Generator::getScope()%%&amp;#039;&amp;#039;; no syntax changes. Libraries can adopt &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; today through the polyfill &amp;#039;&amp;#039;%%fiber-interop/scope%%&amp;#039;&amp;#039;, which declares the class on PHP 8.2 and later. Code that keys state by &amp;#039;&amp;#039;%%Fiber::getCurrent()%%&amp;#039;&amp;#039; can key it by &amp;#039;&amp;#039;%%Scope::getCurrent()%%&amp;#039;&amp;#039;.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;IDEs, language servers and static analysers need stubs&amp;#160;&lt;/strong&gt;for the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; class and&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;two new &amp;#039;&amp;#039;%%getScope()%%&amp;#039;&amp;#039; methods&lt;/strong&gt;;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;nothing in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;syntax changes. Libraries can adopt &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; before it ships: the polyfill &amp;#039;&amp;#039;%%fiber-interop/&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;%%&amp;#039;&amp;#039; declares the same class on PHP 8.2 and later when the engine doesn&amp;#039;t, and event loops adopt it with the callback pattern above. Containers, loggers and tracers that key state by &amp;#039;&amp;#039;%%Fiber::getCurrent()%%&amp;#039;&amp;#039; today can key it by &amp;#039;&amp;#039;%%Scope::getCurrent()%%&amp;#039;&lt;/strong&gt;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;instead&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**To SAPIs.** None&amp;#160;&lt;/strong&gt;for the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;primary vote. Under vote A, SAPIs keep populating&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;superglobals as now&lt;/strong&gt;;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;they become&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root&amp;#160;&lt;/strong&gt;scope&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;s&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;====&amp;#160;&lt;/strong&gt;To&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;SAPIs ====&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**&lt;/strong&gt;To&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;existing extensions.** None for the primary vote. Vote B touches ext/intl and ext/date.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;None for the primary proposal: code outside any scope runs in the root scope and sees what it sees today. Under secondary vote A, the six request superglobals and the session are the SAPI&amp;#039;s in the root scope and follow the scope elsewhere, a new scope starting empty; SAPIs keep populating them as now. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**&lt;/strong&gt;To&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;opcache&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;**&amp;#160;&lt;/strong&gt;None.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;**&lt;/strong&gt;New&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;constants,&amp;#160;&lt;/strong&gt;php.ini&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;defaults.**&amp;#160;&lt;/strong&gt;None.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;====&amp;#160;&lt;/strong&gt;To&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Existing Extensions ==== &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;None until the follow-up RFCs: this RFC converts no extension state, and extensions never need to handle the absence of a scope&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Secondary vote B touches ext/intl (&amp;#039;&amp;#039;%%Locale%%&amp;#039;&amp;#039;) and ext/date (default timezone). &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;==== To Opcache ==== &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;None.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;====&amp;#160;&lt;/strong&gt;New&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Constants ==== &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;None. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;====&amp;#160;&lt;/strong&gt;php.ini&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Defaults ==== &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;None.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Open Issues =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Open Issues =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;**Session locking within a process.** This RFC&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;proposes that&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;throws&amp;#160;&lt;/strong&gt;when a locking&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;save&amp;#160;&lt;/strong&gt;handler&amp;#039;s session id is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;active&amp;#160;&lt;/strong&gt;in another scope of the process. The alternative is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;to let both&amp;#160;&lt;/strong&gt;scopes share one session&lt;strong class=&quot;diff-mark&quot;&gt;:&amp;#160;&lt;/strong&gt;one &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; and one lock&lt;strong class=&quot;diff-mark&quot;&gt;. That avoids the&amp;#160;&lt;/strong&gt;error, but&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;gives up the&amp;#160;&lt;/strong&gt;isolation&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;vote A otherwise provides. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;**Session locking within a process.** This RFC&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;has&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;throw&amp;#160;&lt;/strong&gt;when a locking handler&amp;#039;s session id is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;open&amp;#160;&lt;/strong&gt;in another scope of the process. The alternative is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for the two&amp;#160;&lt;/strong&gt;scopes&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;to&amp;#160;&lt;/strong&gt;share one session&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;one &amp;#039;&amp;#039;%%$_SESSION%%&amp;#039;&amp;#039; and one lock&lt;strong class=&quot;diff-mark&quot;&gt;: no&amp;#160;&lt;/strong&gt;error, but&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;no&amp;#160;&lt;/strong&gt;isolation&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;either&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Apart from this, the remaining work is implementation validation. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The extension has phpt tests for the described rules and secondary votes on PHP 8.2 through 8.5, NTS and ZTS, with and without opcache, and they also pass under the tracing and the function JIT on PHP 8.5. On ZTS builds, tests with the parallel extension run scopes in several threads at once. The php-src implementation still needs to be written and tested. It will put the current scope in executor globals and is planned before voting&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Unaffected PHP Functionality =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Unaffected PHP Functionality =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Code that never creates a &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; runs in the root scope and behaves exactly as before.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Functions and closures run in the scope of their caller,&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Fiber%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Generator%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;behave as before&amp;#160;&lt;/strong&gt;apart from&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the added&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%getScope()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;method&lt;/strong&gt;, and state not covered by the secondary votes stays process-wide&lt;strong class=&quot;diff-mark&quot;&gt;. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Code that never creates a &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; runs in the root scope and behaves exactly as before. &amp;#039;&amp;#039;%%Fiber%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;behaves as before,&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Generator%%&amp;#039;&amp;#039; apart from &amp;#039;&amp;#039;%%getScope()%%&amp;#039;&amp;#039;, and state not covered by the secondary votes stays process-wide.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;===== Discussion ===== &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The primary proposal adds the identity. The secondary votes cover only the state listed above. Output buffering, error handlers, and ini values could also be converted now, but each has its own behavior and implementation issues. Combining them would make the primary vote depend on those decisions. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Keeping those conversions separate lets each subsystem be reviewed on its own. The cost is that applications may need temporary workarounds until more state follows scopes. Either approach can preserve ordinary code&amp;#039;s behavior outside explicit scopes. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Each subsystem must decide how a new scope starts: with fresh state or a copy of its creator&amp;#039;s state. Votes A and B use fresh request state and ini defaults. Output buffering is deferred&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Future Scope =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Future Scope =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;PHP exposes useful ambient state without requiring context objects: for example, &amp;#039;&amp;#039;%%json_last_error()%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%header()%%&amp;#039;&amp;#039;. The long-term goal is to keep that API while allowing several operations to coexist safely in one process.&amp;#160;&lt;/strong&gt;Each&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;additional&amp;#160;&lt;/strong&gt;kind of state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;should be evaluated separately and leave code outside explicit scopes unchanged. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Each kind of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;request&amp;#160;&lt;/strong&gt;state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;can&amp;#160;&lt;/strong&gt;follow the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in its own&amp;#160;&lt;/strong&gt;RFC,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;leaving&amp;#160;&lt;/strong&gt;code&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;outside explicit&amp;#160;&lt;/strong&gt;scopes&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;unchanged&lt;/strong&gt;:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;State that could&amp;#160;&lt;/strong&gt;follow the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;includes: &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * output buffering; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * error and exception handlers, &amp;#039;&amp;#039;%%ini_set()%%&amp;#039;&amp;#039; values and shutdown functions; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * the SAPI&amp;#039;s response side, &amp;#039;&amp;#039;%%header()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%headers_list()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%headers_sent()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%http_response_code()%%&amp;#039;&amp;#039; and the sink that receives the response body: an&amp;#160;&lt;/strong&gt;RFC&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that exposes these SAPI integration points to userland&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;bound to the scope, so that a server can supply them per request; it is the same RFC that supplies the bottom of a request scope&amp;#039;s output stack (see output buffering below). &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;**Output buffering.** &amp;#039;&amp;#039;%%ob_start()%%&amp;#039;&amp;#039; is used both for request output and for capturing output from a piece of&amp;#160;&lt;/strong&gt;code&lt;strong class=&quot;diff-mark&quot;&gt;, such as a template. Request output belongs to the operation; all its fibers should write to the same output stack. Capture instead belongs to an execution block. A future RFC could make request output follow the scope and add a separate &amp;#039;&amp;#039;%%ob_context_run(callable): string%%&amp;#039;&amp;#039; for structured capture. The latter would prevent a suspended capture from accidentally popping another fiber&amp;#039;s buffer with &amp;#039;&amp;#039;%%ob_get_clean()%%&amp;#039;&amp;#039;. The output RFC must also define the request&amp;#039;s output sink and what nested&amp;#160;&lt;/strong&gt;scopes&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;inherit. None of that is proposed here. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Another RFC will propose an internal API for per-scope engine and extension state. It would let extensions allocate one value per scope, with the root holding the existing request state. A compatibility bridge could swap module globals on scope changes. The current extension prototypes both approaches. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Within one scope, all fibers continue to share that state. The difference is that a different operation cannot overwrite it. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Per-scope storage is left to containers and libraries, which build it on &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039;. Language support, such as an attribute that keys a static property by the current scope, could follow if a common pattern emerges. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Some state belongs to the operating system and cannot cheaply follow a scope&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%setlocale()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%chdir()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%umask()%%&amp;#039;&amp;#039;, environment variables, and C syslog&amp;#039;s &amp;#039;&amp;#039;%%openlog()%%&amp;#039;&amp;#039; identity. Per-scope versions would need emulation. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;A later RFC can also add operations on an operation as a whole, for example: &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;PHP&amp;gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Fiber::cancelScope($scope);&amp;#160; &amp;#160;// illustration only: not part of this RFC &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Cancellation would need&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;define&amp;#160;&lt;/strong&gt;when a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fiber observes cancellation&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;how running&amp;#160;&lt;/strong&gt;and not&lt;strong class=&quot;diff-mark&quot;&gt;-yet-started&amp;#160;&lt;/strong&gt;fibers&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;behave&lt;/strong&gt;, and how &amp;#039;&amp;#039;%%finally%%&amp;#039;&amp;#039; and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;cleanup work. It would also need&amp;#160;&lt;/strong&gt;a way to find&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;all fibers in&amp;#160;&lt;/strong&gt;a scope&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;this RFC&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;only stores the scope on each fiber. Cancellation is&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;part of this proposal&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Headers and the response body are not values&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;copy.** A header set inside a scope, or a byte echoed there, must still reach the one response the request has; a new scope that started with a copy of its creator&amp;#039;s header list and output stack, and discarded them&amp;#160;&lt;/strong&gt;when&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it went, would lose them. They are&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;sink that the creator of the scope supplies, by default its own, not state the copy rule can carry. That is why they need the integration points below rather than this RFC&amp;#039;s copy rule&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;why they are&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a vote here. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Output buffering.** &amp;#039;&amp;#039;%%ob_start()%%&amp;#039;&amp;#039; serves request output, which belongs to the request and all its&amp;#160;&lt;/strong&gt;fibers, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;capture of a piece of code&amp;#039;s output (a template), which belongs to that block. A future RFC could make request output follow the scope and add a separate structured capture, such as &amp;#039;&amp;#039;%%ob_context_run(callable): string%%&amp;#039;&amp;#039;, so a suspended capture cannot pop another fiber&amp;#039;s buffer. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **The response:** &amp;#039;&amp;#039;%%header()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%headers_list()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%headers_sent()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%http_response_code()%%&amp;#039;&amp;#039; and the sink that receives the body, exposed so that a server can supply them per scope. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Error and exception handlers, &amp;#039;&amp;#039;%%ini_set()%%&amp;#039;&amp;#039; values and shutdown functions.** &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **An internal API for per-scope extension state:** module globals with a scope&amp;#039;s lifetime, allocated when a scope first touches them, the root holding today&amp;#039;s request state. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Persistent connections** lent to one scope at a time. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Operations on a scope as a whole**, such as cancellation. That needs its own design: when a fiber observes it,&amp;#160;&lt;/strong&gt;how &amp;#039;&amp;#039;%%finally%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;runs,&amp;#160;&lt;/strong&gt;and a way to find a scope&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s fibers, which&amp;#160;&lt;/strong&gt;this RFC&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;does&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;keep&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The [[https://wiki.php.net/rfc/async_scheduler_abi|Concurrency Support]] RFC introduces engine coroutines that need not be&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;Fiber&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;objects. A scheduler built on it would give those coroutines&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;same&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;membership&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;State owned by the operating system (&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;setlocale()&lt;/strong&gt;%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;, &amp;#039;&amp;#039;%%chdir()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%umask()%%&amp;#039;&amp;#039;,&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;environment, syslog&amp;#039;s identity) cannot cheaply follow a&amp;#160;&lt;/strong&gt;scope.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Voting Choices =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Voting Choices =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 423:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 415:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Primary vote, 2/3 majority:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Primary vote, 2/3 majority:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;lt;doodle title=&amp;quot;Add Scope&lt;strong class=&quot;diff-mark&quot;&gt;, Fiber::getScope()&amp;#160;&lt;/strong&gt;and Generator::getScope() as described in this RFC?&amp;quot; voteType=&amp;quot;single&amp;quot; closed=&amp;quot;true&amp;quot; closeon=&amp;quot;tbd&amp;quot;&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;doodle title=&amp;quot;Add Scope and Generator::getScope() as described in this RFC?&amp;quot; voteType=&amp;quot;single&amp;quot; closed=&amp;quot;true&amp;quot; closeon=&amp;quot;tbd&amp;quot;&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* Yes&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* Yes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* No&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* No&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 429:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 421:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/doodle&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/doodle&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Secondary votes, 50%+1 each, counted only if the primary passes; B does not depend on A:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Secondary votes, 50%+1 each, counted only if the primary&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;vote&amp;#160;&lt;/strong&gt;passes; B does not depend on A:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;lt;doodle title=&amp;quot;A. Should $_GET, $_POST, $_COOKIE, $_FILES, $_REQUEST, $_SERVER and the session ($_SESSION and ext/session&amp;#039;s state) follow the current scope as described, a new scope starting&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;empty&lt;/strong&gt;?&amp;quot; voteType=&amp;quot;single&amp;quot; closed=&amp;quot;true&amp;quot; closeon=&amp;quot;tbd&amp;quot;&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;doodle title=&amp;quot;A. Should $_GET, $_POST, $_COOKIE, $_FILES, $_REQUEST, $_SERVER and the session ($_SESSION and ext/session&amp;#039;s state) follow the current scope as described, a new scope starting&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;as a copy of its creator&amp;#039;s&lt;/strong&gt;?&amp;quot; voteType=&amp;quot;single&amp;quot; closed=&amp;quot;true&amp;quot; closeon=&amp;quot;tbd&amp;quot;&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* Yes&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* Yes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* No&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* No&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 442:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 434:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/doodle&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/doodle&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Generators are&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;part of&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;main proposal rather than a separate&amp;#160;&lt;/strong&gt;vote. Leaving them out would&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not keep options open:&amp;#160;&lt;/strong&gt;generators&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;would&amp;#160;&lt;/strong&gt;run in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;of whatever code advances&amp;#160;&lt;/strong&gt;them,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;existing&amp;#160;&lt;/strong&gt;code would come to depend on that, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;capturing the scope&amp;#160;&lt;/strong&gt;later would&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;itself&amp;#160;&lt;/strong&gt;be a backward incompatible change.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Generators are&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;primary&amp;#160;&lt;/strong&gt;vote&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;because they follow from the frame rule&lt;/strong&gt;. Leaving them out would&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;make&amp;#160;&lt;/strong&gt;generators run in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;whatever&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;resumes&amp;#160;&lt;/strong&gt;them, code would come to depend on that, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fixing it&amp;#160;&lt;/strong&gt;later would be a backward incompatible change.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Patches and Tests =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Patches and Tests =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;An extension implementing this RFC, including both secondary votes, is released for PHP 8.2 to 8.5 as&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%fiber-interop/ext-scope%%&amp;#039;&amp;#039; 0.&lt;strong class=&quot;diff-mark&quot;&gt;5&lt;/strong&gt;.0 (https://github.com/fiber-interop/ext-scope, &amp;#039;&amp;#039;%%pie install fiber-interop/ext-scope%%&amp;#039;&amp;#039;), with phpt tests for each rule&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in this text. A userland polyfill&amp;#160;&lt;/strong&gt;with the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;same class&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;tests is&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%fiber-interop/scope%%&amp;#039;&amp;#039; 0.&lt;strong class=&quot;diff-mark&quot;&gt;4&lt;/strong&gt;.0. A pull request against php-src master will accompany the RFC before the vote.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#039;&amp;#039;%%fiber-interop/ext-scope%%&amp;#039;&amp;#039; 0.&lt;strong class=&quot;diff-mark&quot;&gt;6&lt;/strong&gt;.0&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;implements this RFC, including the frame rule for fibers and both secondary votes, with one difference: a new scope starts empty there, and the copy rule of this version follows in its next release. It is released for PHP 8.2 to 8.5&amp;#160;&lt;/strong&gt;(https://github.com/fiber-interop/ext-scope, &amp;#039;&amp;#039;%%pie install fiber-interop/ext-scope%%&amp;#039;&amp;#039;), with phpt tests for each rule&lt;strong class=&quot;diff-mark&quot;&gt;, on NTS and ZTS,&amp;#160;&lt;/strong&gt;with&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and without opcache, under&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;tracing&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;function JIT on 8.5, and with the parallel extension running scopes in several threads. The polyfill&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%fiber-interop/scope%%&amp;#039;&amp;#039; 0.&lt;strong class=&quot;diff-mark&quot;&gt;6&lt;/strong&gt;.0&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;has the same class and tests, and is released together with the extension&lt;/strong&gt;. A pull request against php-src master will accompany the RFC before the vote.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Implementation =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Implementation =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;engine stores&amp;#160;&lt;/strong&gt;the current scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for &amp;#039;&amp;#039;%%{main}%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for each fiber&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generator. It&amp;#160;&lt;/strong&gt;restores&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;that value when execution switches. Fibers and generators also store&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;they captured at creation.&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;rule is stated per frame, but&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;engine does not store a scope in every frame. All frames between two switch points share a scope, so it keeps one&amp;#160;&lt;/strong&gt;current&lt;strong class=&quot;diff-mark&quot;&gt;-&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;pointer in the executor globals,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;saves&amp;#160;&lt;/strong&gt;and restores&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it only where&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;executing frame can change to one with a different&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;saves&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current scope&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;installs the new one&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;calls&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;callback,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;restores&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;old&amp;#160;&lt;/strong&gt;scope.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A fiber may suspend inside nested&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;run&lt;/strong&gt;()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;calls, so&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;saved values must survive suspension and be visible to&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;cycle collector. Fatal-error bailouts also restore the saved&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;before continuing the bailout&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and a call to a bound closure save&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;pointer&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;set it&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and restore it when&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;call returns or throws (&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;before a fatal-error bailout continues); &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * a fiber stores&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;while it is suspended, and a generator its frame&amp;#039;s scope; switching into one loads its scope, switching out saves it&lt;/strong&gt;. &amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;start&lt;/strong&gt;()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is an ordinary call:&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fiber&amp;#039;s first frame gets&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;caller&amp;#039;s&amp;#160;&lt;/strong&gt;scope.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;tests cover, among other things:&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Ordinary calls pay nothing.&amp;#160;&lt;/strong&gt;The&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;saved pointers of a fiber suspended inside nested &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; calls are visible to the cycle collector.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;a fiber that suspends inside &amp;#039;&amp;#039;%%$scope-&amp;gt;run()%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;: the resuming code keeps its own scope,&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the fiber finds its&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;again when resumed&lt;/strong&gt;;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The tests cover, among other things:&amp;#160;&lt;/strong&gt;a fiber that suspends inside &amp;#039;&amp;#039;%%$scope-&amp;gt;run()%%&amp;#039;&amp;#039; and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is resumed from another&amp;#160;&lt;/strong&gt;scope; a fiber&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;started&amp;#160;&lt;/strong&gt;in one scope that suspends inside another&amp;#039;s &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; and is then dropped&lt;strong class=&quot;diff-mark&quot;&gt;, with&amp;#160;&lt;/strong&gt;both scopes collected afterwards, also through cycles; a fatal error inside nested &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; calls with fibers suspended&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in them&lt;/strong&gt;; generators consumed from&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;other scopes&amp;#160;&lt;/strong&gt;across&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;many&amp;#160;&lt;/strong&gt;yields and through &amp;#039;&amp;#039;%%yield from%%&amp;#039;&amp;#039;; a generator inside a fiber that suspends while the generator is inside &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;and&lt;strong class=&quot;diff-mark&quot;&gt;, for vote&amp;#160;&lt;/strong&gt;A&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%unset($_GET)%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%global $_GET%%&amp;#039;&amp;#039; in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scopes&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;a fiber&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;constructed&amp;#160;&lt;/strong&gt;in one scope that suspends inside another&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope&lt;/strong&gt;&amp;#039;s &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;and is then dropped&lt;strong class=&quot;diff-mark&quot;&gt;:&amp;#160;&lt;/strong&gt;both scopes&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;stay reachable while the fiber is suspended, and are&amp;#160;&lt;/strong&gt;collected afterwards, also through cycles;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;a fatal error inside nested &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; calls&lt;strong class=&quot;diff-mark&quot;&gt;, with the cycle collector enabled, followed by request shutdown, including&amp;#160;&lt;/strong&gt;with fibers suspended&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;inside &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;&lt;/strong&gt;;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;generators&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;created in one scope and&amp;#160;&lt;/strong&gt;consumed from&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;another,&amp;#160;&lt;/strong&gt;across&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;several&amp;#160;&lt;/strong&gt;yields and through &amp;#039;&amp;#039;%%yield from%%&amp;#039;&amp;#039;;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;a generator&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;running&amp;#160;&lt;/strong&gt;inside a fiber that suspends while the generator is inside&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;call: the generator&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the fiber both find their scope again when resumed. (&lt;/strong&gt;A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generator can&amp;#039;t &amp;#039;&amp;#039;%%yield%%&amp;#039;&amp;#039; while a &amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; call is active in its own body: a &amp;#039;&amp;#039;%%yield%%&amp;#039;&amp;#039; inside the callback makes the callback a generator.) &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; *&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%unset($_GET)%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;inside a scope does not affect another scope or the root;&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%global $_GET%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;inside a function called&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a scope binds to that scope&amp;#039;s array; a scope that only reads the arrays owns no copies&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;An extension cannot add fields&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;directly&amp;#160;&lt;/strong&gt;to native fiber and generator objects&lt;strong class=&quot;diff-mark&quot;&gt;. The&amp;#160;&lt;/strong&gt;prototype&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;therefore&amp;#160;&lt;/strong&gt;keeps each one&amp;#039;s scope in a &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039;, follows fibers through the fiber switch observer, and compiles scope switches into generator bodies&lt;strong class=&quot;diff-mark&quot;&gt;; ordinary calls pay nothing&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Measured on&amp;#160;&lt;/strong&gt;PHP 8.5.12, x86-64,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with&amp;#160;&lt;/strong&gt;opcache on&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and the&amp;#160;&lt;/strong&gt;JIT off&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(&lt;/strong&gt;median of 5 runs&lt;strong class=&quot;diff-mark&quot;&gt;)&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;An extension cannot add fields to native fiber and generator objects&lt;strong class=&quot;diff-mark&quot;&gt;, so the&amp;#160;&lt;/strong&gt;prototype keeps each one&amp;#039;s scope in a &amp;#039;&amp;#039;%%WeakMap%%&amp;#039;&amp;#039;, follows fibers through the fiber switch observer, and compiles scope switches into generator bodies. PHP 8.5.12, x86-64, opcache on&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;JIT off&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;median of 5 runs:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ^Without^With the extension^&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; ^Without^With the extension^&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 471:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 459:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;|Generator step in another scope (switch in and back out)|n/a&amp;#160; &amp;#160; |~240 ns&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;|Generator step in another scope (switch in and back out)|n/a&amp;#160; &amp;#160; |~240 ns&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;|&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;The last row&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is a generator created in one scope and stepped from another, so every step&amp;#160;&lt;/strong&gt;switches the six superglobals, the session,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;the locale and timezone in and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;back&amp;#160;&lt;/strong&gt;out&lt;strong class=&quot;diff-mark&quot;&gt;. It&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the cost of interleaving operations,&amp;#160;&lt;/strong&gt;paid only when the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope changes&lt;strong class=&quot;diff-mark&quot;&gt;. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;The last row switches the six superglobals, the session, the locale and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the&amp;#160;&lt;/strong&gt;timezone in and out&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;on every step; it&amp;#160;&lt;/strong&gt;is paid only when the scope changes. In core,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fibers&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generators hold the&amp;#160;&lt;/strong&gt;scope pointer directly&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;the php-src patch will include its own measurements.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;These figures measure the extension&amp;#039;s approach, not the proposed php-src implementation. The extension keeps each fiber&amp;#039;s scope in a hash table and, at every change of scope, moves the six superglobals and copies ext/session&amp;#039;s, the locale&amp;#039;s and the timezone&amp;#039;s state between the live globals and the scopes&lt;/strong&gt;. In core,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;each fiber&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generator holds a&amp;#160;&lt;/strong&gt;scope pointer directly&lt;strong class=&quot;diff-mark&quot;&gt;, and&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;per-scope state is reached through the current scope (see vote A&amp;#039;s implementation note), so a switch is a few pointer stores and costs the same whatever the scopes hold. The&amp;#160;&lt;/strong&gt;php-src patch will include its own measurements.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Threads ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Threads ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Engine state currently has process/thread&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;PHP-request lifetimes&lt;/strong&gt;. &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;adds an operation lifetime. It works within ZTS&amp;#160;&lt;/strong&gt;threads&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and&amp;#160;&lt;/strong&gt;does&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;not replace them. The extension is tested that way: threads started with the parallel extension each create scopes&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;step fibers&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;generators of several scopes in turn, and keep superglobals, session, timezone and locale apart per scope and per&amp;#160;&lt;/strong&gt;thread.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Under ZTS the current scope&amp;#160;&lt;/strong&gt;and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the root scope live in the executor globals, so each thread has its own&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;never crosses&amp;#160;&lt;/strong&gt;threads&lt;strong class=&quot;diff-mark&quot;&gt;, as no PHP object&amp;#160;&lt;/strong&gt;does, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;no lock enters the design. Scopes multiplex one&amp;#160;&lt;/strong&gt;thread&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;s request state between operations, as threads multiplex a process between executors; a server can use both&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;*&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The current scope and&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;live&amp;#160;&lt;/strong&gt;in the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;executor globals&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;which ZTS makes per thread&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Each thread has its own root&amp;#160;&lt;/strong&gt;scope,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;current&amp;#160;&lt;/strong&gt;scope and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fibers&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;Scope&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;object never crosses&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;thread boundary&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;because no PHP object does. No lock enters&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;design:&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fibers of one thread run one at a time&lt;/strong&gt;. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;===== Rejected Features ===== &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Scope multiplexes one thread&amp;#039;s state between operations; threads multiplex one process&amp;#039;s state between executors&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;A server may use both: worker threads, each serving several&amp;#160;&lt;/strong&gt;requests&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;as scopes&lt;/strong&gt;. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;For extension authors&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;per-scope state&amp;#160;&lt;/strong&gt;is the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;module-globals pattern&amp;#160;&lt;/strong&gt;with&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a shorter lifetime&lt;/strong&gt;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;declared&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;same way&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;constructed when&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope&amp;#160;&lt;/strong&gt;first&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;touches&amp;#160;&lt;/strong&gt;it,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;destroyed when&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is released&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;The follow-up RFC describes it in that vocabulary&lt;/strong&gt;. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;*&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;**A link to&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;parent&amp;#160;&lt;/strong&gt;scope&lt;strong class=&quot;diff-mark&quot;&gt;** (&amp;#039;&amp;#039;%%getParentScope()%%&amp;#039;&amp;#039;). Code that wants a hierarchy can keep one&amp;#160;&lt;/strong&gt;in&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a &amp;#039;&amp;#039;%%WeakMap&amp;lt;Scope, Scope&amp;gt;%%&amp;#039;&amp;#039;. In core it would keep every ancestor alive: an application that creates each scope from&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;previous one&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;millions of times, would hold the whole chain&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Cost:&amp;#160;&lt;/strong&gt;state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;converted&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;follow&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;scope&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;reached through the current scope&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;so access&amp;#160;&lt;/strong&gt;costs&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;one pointer load more&amp;#160;&lt;/strong&gt;than&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;today on both builds&lt;/strong&gt;, and a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;switch costs&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;few pointer stores whatever the scopes hold. State small enough to be swapped&amp;#160;&lt;/strong&gt;by&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;value at no measurable cost, such as&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;default timezone&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;may be swapped instead; the follow-up RFC lists the choice&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;each&amp;#160;&lt;/strong&gt;kind of state. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Fibers capturing the&amp;#160;&lt;/strong&gt;scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;at construction** (versions up to 0.9.5). It made a fiber the one exception to the frame rule&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for the case where a fiber is constructed in one&amp;#160;&lt;/strong&gt;scope and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;started from another&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Schedulers that defer&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%&lt;strong class=&quot;diff-mark&quot;&gt;start()&lt;/strong&gt;%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;run it as&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;queued callback&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;which already restores&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;queuing scope, and &amp;#039;&amp;#039;%%new Fiber($scope-&amp;gt;bind($fn))%%&amp;#039;&amp;#039; covers&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;rest explicitly&lt;/strong&gt;. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Scope adds no concurrency&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;State that follows&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is never&amp;#160;&lt;/strong&gt;visible to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;another operation, so code that was correct under one request per process stays correct for that state. State kept shared on purpose stays shared, as it is across requests in any long-running process today&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;**Closures capturing their creation scope&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;** Handlers are created at startup and called during&amp;#160;&lt;/strong&gt;requests&lt;strong class=&quot;diff-mark&quot;&gt;; they would all run in the root scope. &amp;#039;&amp;#039;%%bind()%%&amp;#039;&amp;#039; captures explicitly where that is wanted&lt;/strong&gt;. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;**&amp;#039;&amp;#039;%%run(Closure $callback)%%&amp;#039;&amp;#039; without arguments.** &amp;#039;&amp;#039;%%run(fn() =&amp;gt; f(1&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2))%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;is the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;clearest form and works&amp;#160;&lt;/strong&gt;with&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;either signature. &amp;#039;&amp;#039;%%callable%%&amp;#039;&amp;#039; with &amp;#039;&amp;#039;%%...$args%%&amp;#039;&amp;#039; matches &amp;#039;&amp;#039;%%Fiber&lt;/strong&gt;:&lt;strong class=&quot;diff-mark&quot;&gt;:start()%%&amp;#039;&amp;#039;, &amp;#039;&amp;#039;%%call_user_func()%%&amp;#039;&amp;#039; and &amp;#039;&amp;#039;%%register_shutdown_function()%%&amp;#039;&amp;#039;, and also accepts partial applications with open parameters, &amp;#039;&amp;#039;%%run(f(1, ?), 2)%%&amp;#039;&amp;#039;. Dropping&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;%%$fn&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;...$args%%&amp;#039;&amp;#039; pattern is worth considering for PHP as&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;whole, in its own RFC, not in the&amp;#160;&lt;/strong&gt;first&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;API to break ranks. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **A scope that must be passed explicitly**, without inheritance. Every library that creates fibers would have to pass&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;on&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;which is&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;interoperability problem this RFC solves. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **&amp;#039;&amp;#039;%%null%%&amp;#039;&amp;#039; outside any&amp;#160;&lt;/strong&gt;scope.&lt;strong class=&quot;diff-mark&quot;&gt;** Every consumer would handle two cases, and adding a root later would change what existing code observes&lt;/strong&gt;. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;**One thread per request under ZTS.** A request&amp;#039;s fibers must share its&amp;#160;&lt;/strong&gt;state&lt;strong class=&quot;diff-mark&quot;&gt;, most deployments are NTS, and scopes work inside threads anyway. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **A new scope that starts empty** (versions 0.9&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;0.9.5), and a constructor option to choose between empty and copy. Empty needs a definition of empty for each kind of state, now and in every later RFC, and makes each addition a change for code that only reads&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;state. A copy&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;one rule&lt;/strong&gt;, costs&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a reference count, and makes later additions safe for existing code. Code that wants less&amp;#160;&lt;/strong&gt;than&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;its creator has clears it&lt;/strong&gt;, and a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;server gets&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;fresh set&amp;#160;&lt;/strong&gt;by&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;constructing from&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;root scope&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;so no use&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the option is known; it can be added later without breaking anything, while defining it now means defining &amp;quot;empty&amp;quot; per&amp;#160;&lt;/strong&gt;kind of state&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;after all&lt;/strong&gt;. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; *&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;**Sharing the creator&amp;#039;s state instead of copying it&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt;** A change inside&amp;#160;&lt;/strong&gt;the scope&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;would be&amp;#160;&lt;/strong&gt;visible&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;outside it, the leak a scope exists&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;prevent&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== References =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== References =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 491:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 483:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[https://wiki.php.net/rfc/true_async_scope|Async Scope]]&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * [[https://wiki.php.net/rfc/true_async_scope|Async Scope]]&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * The prototype and its measurements across event loops: https://fiber-interop.github.io/&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * The prototype and its measurements across event loops: https://fiber-interop.github.io/&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;===== Rejected Features =====&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * **A scope that must be passed on explicitly,** without inheritance. Every library that creates fibers would need to pass the right scope on, which is the interoperability problem this RFC sets out to solve.&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * **&amp;#039;&amp;#039;%%null%%&amp;#039;&amp;#039; outside any scope.** Every consumer would handle two cases, state keyed by scope would need a fallback key, and a root scope added in a later version would change what existing code observes. A root object from the first version avoids all three.&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * **One thread per request under ZTS, instead of scopes.** Threads do not help the common case, a request whose fibers must share its state; most PHP deployments are NTS and the extension ecosystem is less exercised under ZTS; and the two are not alternatives, since scopes work inside each thread.&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Changelog =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Changelog =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * 0.9.1 (2026-10-26): first version on the wiki; announced on internals.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * 0.9.1 (2026-10-26): first version on the wiki; announced on internals.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * 2026-10-27: implementation notes only: ext-scope 0.4.3, tested on ZTS builds with threads (parallel).&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * 0.9.2 (2026-10-27): Introduction rewritten; no change to the proposal.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * 0.9.2 (2026-10-27): Introduction rewritten; no change to the proposal.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * 0.9.3 (2026-10-27): vote A: &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; throws&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a &amp;#039;&amp;#039;%%RuntimeException%%&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;instead of blocking&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the process&amp;#160;&lt;/strong&gt;when a locking&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;save&amp;#160;&lt;/strong&gt;handler&amp;#039;s session id is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;active&amp;#160;&lt;/strong&gt;in another scope of the process&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(ext-scope 0.4.4); listed under Open Issues&lt;/strong&gt;. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * 0.9.3 (2026-10-27): vote A: &amp;#039;&amp;#039;%%session_start()%%&amp;#039;&amp;#039; throws instead of blocking when a locking handler&amp;#039;s session id is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;open&amp;#160;&lt;/strong&gt;in another scope of the process. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * 0.9.4 (2026-10-28): implementation: in the engine, per-scope state is reached through the current scope, so a switch costs a few pointer stores whatever the scopes hold&lt;strong class=&quot;diff-mark&quot;&gt;, and an access one pointer load more (Threads, &amp;quot;Cost&amp;quot;); the extension moves the state at each switch instead (ext-scope 0.5.0)&lt;/strong&gt;. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * 0.9.4 (2026-10-28): implementation: in the engine, per-scope state is reached through the current scope, so a switch costs a few pointer stores whatever the scopes hold. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * 0.9.5 (2026-11-06): from the discussion:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the rule that a scope is bound when a call, fiber or generator is created;&amp;#160;&lt;/strong&gt;why a scope has no parent link&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; with partial function application&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;who uses &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; directly&lt;strong class=&quot;diff-mark&quot;&gt;;&amp;#160;&lt;/strong&gt;statics and &amp;#039;&amp;#039;%%$GLOBALS%%&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;mentioned in&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Introduction&lt;/strong&gt;; vote A&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;explains why&amp;#160;&lt;/strong&gt;a new scope starts empty&lt;strong class=&quot;diff-mark&quot;&gt;. No change&amp;#160;&lt;/strong&gt;to the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;proposal&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * 0.9.5 (2026-11-06): from the discussion: why a scope has no parent link&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;%%run()%%&amp;#039;&amp;#039; with partial function application&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;who uses &amp;#039;&amp;#039;%%Scope%%&amp;#039;&amp;#039; directly&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;statics and &amp;#039;&amp;#039;%%$GLOBALS%%&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;. No change to&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;proposal. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * 0.10 (2026-11-13): rewritten around one rule, that a scope belongs to a stack frame and is assigned when the frame is created, with no special cases. Changed: a fiber no longer captures the scope at construction&lt;/strong&gt;;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;its first frame gets the scope of the code that calls &amp;#039;&amp;#039;%%start()%%&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;%%new Fiber($scope-&amp;gt;bind($fn))%%&amp;#039;&amp;#039; gives a fiber a fixed scope. &amp;#039;&amp;#039;%%Fiber::getScope()%%&amp;#039;&amp;#039; is removed. Added: a container example with the three lifetimes in place of the service-locator example, Why in core, the root scope under the CLI and php-fpm, the server&amp;#039;s role in&amp;#160;&lt;/strong&gt;vote A&lt;strong class=&quot;diff-mark&quot;&gt;, and the parent link, closure capture and &amp;#039;&amp;#039;%%run(Closure)%%&amp;#039;&amp;#039; under Rejected Features. From the discussion (Larry Garfield, Côme Chilliet):&amp;#160;&lt;/strong&gt;a new scope starts&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;as a copy of its creator&amp;#039;s state instead of&amp;#160;&lt;/strong&gt;empty&lt;strong class=&quot;diff-mark&quot;&gt;, under vote A (the six arrays and the session) and vote B (locale and timezone), with no option&amp;#160;&lt;/strong&gt;to&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;start empty;&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;session copy&amp;#039;s semantics; why response output is a sink and not state to copy (Future Scope); the copy rule as what makes later additions safe (What follows the scope); empty-start and shared state under Rejected Features&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/prepared_literal_string_matching?rev=1794532895&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-13T01:21:35+00:00</dc:date>
        <dc:creator>artukrainskiy (artukrainskiy@undisclosed.example.com)</dc:creator>
        <title>prepared_literal_string_matching</title>
        <link>https://wiki.php.net/rfc/prepared_literal_string_matching?rev=1794532895&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/13 01:11&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 8:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 8:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: https://news-web.php.net/php.internals/133028&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Discussion thread: https://news-web.php.net/php.internals/133028&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Voting thread: TBD&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Voting thread: TBD&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Introduction =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Introduction =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 31:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 32:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Summary =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Summary =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Measurements: [[https://github.com/ArtUkrainskiy/php-src-bench/tree/main/reports/multi-pattern-search|php-src-bench report]]. Each change is against the fastest existing method ([[#how_it_was_measured|How it was measured]]). Negative means the new class is faster. Times are GCC.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Measurements: [[https://github.com/ArtUkrainskiy/php-src-bench/tree/main/reports/multi-pattern-search|php-src-bench report]]. Each change is against the fastest existing method ([[#how_it_was_measured|How it was measured]]). Negative means the new class is faster. Times are GCC&lt;strong class=&quot;diff-mark&quot;&gt;, ranges cover GCC and Clang&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Prepared object, 32 keys or more:** 1.9–16 times faster per call.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Prepared object, 32 keys or more:** 1.9–16 times faster per call.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 46:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 47:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^ Scenario ^ Prepared object ^ Build and one call ^ Calls to repay the build, estimated ^&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^ Scenario ^ Prepared object ^ Build and one call ^ Calls to repay the build, estimated ^&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;| Moderation: 403 words, 199 B comments | 8.0–13× faster | 4.0–5.8× slower |&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;29&lt;/strong&gt;–32 | &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;| Moderation: 403 words, 199 B comments | 8.0–13× faster | 4.0–5.8× slower |&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;14&lt;/strong&gt;–32 | &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;| Bot detection: 1,469 patterns, 118 B User-Agents | 11–12× faster | 27–31× slower |&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;350&lt;/strong&gt;–354 |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;| Bot detection: 1,469 patterns, 118 B User-Agents | 11–12× faster | 27–31× slower |&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;287&lt;/strong&gt;–354 |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Auto-linking: 3,345 function names with &amp;#039;&amp;#039;_&amp;#039;&amp;#039;, 597 B manual pages | 12–123× faster | 2.6–9.5× slower | 9–66 |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Auto-linking: 3,345 function names with &amp;#039;&amp;#039;_&amp;#039;&amp;#039;, 597 B manual pages | 12–123× faster | 2.6–9.5× slower | 9–66 |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Auto-linking: 128 or 512 of those names, 4–16 KiB manual pages | 4.0–7.3× faster | 2.9–3.6× faster | 1 |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Auto-linking: 128 or 512 of those names, 4–16 KiB manual pages | 4.0–7.3× faster | 2.9–3.6× faster | 1 |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 295:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 296:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| One call | Building the object or the PCRE pattern string, one call, freeing. Compiling the pattern isn&amp;#039;t timed: PCRE keeps compiled patterns in its per-process cache. |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| One call | Building the object or the PCRE pattern string, one call, freeing. Compiling the pattern isn&amp;#039;t timed: PCRE keeps compiled patterns in its per-process cache. |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Only methods that are right on every text compete, so &amp;#039;&amp;#039;str_replace()&amp;#039;&amp;#039; doesn&amp;#039;t take part. Before timing, every method is checked against the new class on every text of the cell.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Only methods that are right on every text compete, so &amp;#039;&amp;#039;str_replace()&amp;#039;&amp;#039; doesn&amp;#039;t take part&lt;strong class=&quot;diff-mark&quot;&gt;. PCRE uses a lookahead to find overlapping occurrences&lt;/strong&gt;. Before timing, every method is checked against the new class on every text of the cell.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Existing methods return the same keys, counts and offsets in a simpler form: arrays in any order, no objects. The new class pays for its full result. Sorting and checking happen outside the timer.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Existing methods return the same keys, counts and offsets in a simpler form: arrays in any order, no objects. The new class pays for its full result. Sorting and checking happen outside the timer.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Calls go through a pool of different texts (2 MiB of windows from a corpus, or every document of a scenario). On one repeated text the new class was 3–4 times faster, because the CPU learns its branches.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Calls go through a pool of different texts (2&lt;strong class=&quot;diff-mark&quot;&gt;–4&amp;#160;&lt;/strong&gt;MiB of windows from a corpus, or every document of a scenario). On one repeated text&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;an earlier version of&amp;#160;&lt;/strong&gt;the new class was 3–4 times faster, because the CPU learns its branches.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * AMD Ryzen 9 5950X, GCC 15.2 and Clang 21.1, the flags of the official PHP Docker image, OPcache on, JIT off, PCRE JIT on. 3–5 fresh processes per value. The processes differ by 1.0% in the median value and by 3.3% or less in 90% of values. Changes within about 3% aren&amp;#039;t told apart.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * AMD Ryzen 9 5950X, GCC 15.2 and Clang 21.1, the flags of the official PHP Docker image, OPcache on, JIT off, PCRE JIT on. 3–5 fresh processes per value. The processes differ by 1.0% in the median value and by 3.3% or less in 90% of values. Changes within about 3% aren&amp;#039;t told apart.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Keys and text length ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Keys and text length ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Random keys of the letters a–p in English text. A range covers the five calls,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;one&amp;#160;&lt;/strong&gt;match in the middle third or none&lt;strong class=&quot;diff-mark&quot;&gt;, and both compilers&lt;/strong&gt;. Each call separately, and the lengths 1.5, 2 and 3 KiB, are in the report&amp;#039;s [[https://github.com/ArtUkrainskiy/php-src-bench/tree/main/reports/multi-pattern-search#results-by-keys-and-text-length|Prepared and One-shot tables]]. The rows of the One-shot table show from which length a single call pays for the build.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Random keys of the letters a–p in English text. A range covers the five calls,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;both compilers and these&amp;#160;&lt;/strong&gt;match&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;positions: one&amp;#160;&lt;/strong&gt;in the middle third&lt;strong class=&quot;diff-mark&quot;&gt;, 16 across the text, one in the last 64 bytes,&amp;#160;&lt;/strong&gt;or none. Each call separately&lt;strong class=&quot;diff-mark&quot;&gt;, with one match in the middle third or none&lt;/strong&gt;, and the lengths 1.5, 2 and 3 KiB, are in the report&amp;#039;s [[https://github.com/ArtUkrainskiy/php-src-bench/tree/main/reports/multi-pattern-search#results-by-keys-and-text-length|Prepared and One-shot tables]]. The rows of the One-shot table show from which length a single call pays for the build.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^ Keys ^ 128 B ^ 1 KiB ^ 4 KiB ^ 16 KiB ^ 64 KiB ^&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^ Keys ^ 128 B ^ 1 KiB ^ 4 KiB ^ 16 KiB ^ 64 KiB ^&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 359:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 360:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Where existing methods are faster ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Where existing methods are faster ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * **8 keys.** From −42% to +117% on random keys, +17…+58% on PHP names&lt;strong class=&quot;diff-mark&quot;&gt;. GCC and Clang often disagree on the sign&lt;/strong&gt;. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * **8 keys&lt;strong class=&quot;diff-mark&quot;&gt;, prepared object&lt;/strong&gt;.** From −42% to +117% on random keys,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;where GCC and Clang often disagree on the sign.&amp;#160;&lt;/strong&gt;+17…+58% on PHP names. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * **A match in the first 64 bytes**, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;. The new class and PCRE stop after a few bytes. A prepared object takes 0.26–0.27 µs at any key count, PCRE 0.12–0.16 µs with 16 keys and 0.68–0.75 µs with 1024. The change is +58…+115% with 16 keys, +94…+155% with 8, and from −70% to +49% with 32 or more. In one call the new class still builds its object, 4.43–392 µs, while PCRE only builds its pattern string, 1.34–62.4 µs: +221…+550%.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * **A match in the first 64 bytes**, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;. The new class and PCRE stop after a few bytes. A prepared object takes 0.26–0.27 µs at any key count, PCRE 0.12–0.16 µs with 16 keys and 0.68–0.75 µs with 1024. The change is +58…+115% with 16 keys, +94…+155% with 8, and from −70% to +49% with 32 or more. In one call&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with 16 keys or more&amp;#160;&lt;/strong&gt;the new class still builds its object, 4.43–392 µs, while PCRE only builds its pattern string, 1.34–62.4 µs: +221…+550%.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Other languages.** On Russian, Chinese, Japanese and Korean the gain is smaller: −76…−48% for a prepared object. &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039; with frequent words −62…+23%.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Other languages.** On Russian, Chinese, Japanese and Korean the gain is smaller: −76…−48% for a prepared object. &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039; with frequent words −62…+23%.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Changing replacement values.** A dictionary that differs for every message needs a new Replacer, so the build isn&amp;#039;t amortized.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Changing replacement values.** A dictionary that differs for every message needs a new Replacer, so the build isn&amp;#039;t amortized.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 381:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 382:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;The bounds assume a fixed byte alphabet. In the dense case &amp;#039;&amp;#039;replace()&amp;#039;&amp;#039; uses a work array of up to 4 bytes per byte of text. With many overlaps &amp;#039;&amp;#039;matchAll()&amp;#039;&amp;#039; can return a very large array of objects. &amp;#039;&amp;#039;countMatches()&amp;#039;&amp;#039; doesn&amp;#039;t create them. A streaming interface and a limit on the number of results aren&amp;#039;t proposed.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;The bounds assume a fixed byte alphabet. In the dense case &amp;#039;&amp;#039;replace()&amp;#039;&amp;#039; uses a work array of up to 4 bytes per byte of text. With many overlaps &amp;#039;&amp;#039;matchAll()&amp;#039;&amp;#039; can return a very large array of objects. &amp;#039;&amp;#039;countMatches()&amp;#039;&amp;#039; doesn&amp;#039;t create them. A streaming interface and a limit on the number of results aren&amp;#039;t proposed.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Building a Matcher takes 21–58 µs per KiB of keys (GCC) on real dictionaries and random letters. A Replacer on 512 or more PHP names takes 1.4–2.2 times longer&lt;strong class=&quot;diff-mark&quot;&gt;, because it also builds an automaton of the reversed keys&lt;/strong&gt;. The object keeps:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Building a Matcher takes 21–58 µs per KiB of keys (GCC) on real dictionaries and random letters. A Replacer on 512 or more PHP names takes 1.4–2.2 times longer. The object keeps:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^ Dictionary ^ Keys, KiB ^ Matcher build, µs ^ Matcher keeps, KiB ^ Replacer keeps, KiB ^&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;^ Dictionary ^ Keys, KiB ^ Matcher build, µs ^ Matcher keeps, KiB ^ Replacer keeps, KiB ^&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 436:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 437:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Code: [[https://github.com/php/php-src/pull/25122|PR #25122]].&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Code: [[https://github.com/php/php-src/pull/25122|PR #25122]].&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * 15 PHPT tests in &amp;#039;&amp;#039;ext/standard/tests/strmatch&amp;#039;&amp;#039;: the API contract, binary strings, overlaps, lifecycle, object comparison, counter overflow and 350 seeded cases against &amp;#039;&amp;#039;strpos()&amp;#039;&amp;#039; and &amp;#039;&amp;#039;strtr()&amp;#039;&amp;#039;. They pass&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in a normal GCC 15.2 build and&amp;#160;&lt;/strong&gt;in a GCC 15.2 debug build with ASan and UBSan.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * 15 PHPT tests in &amp;#039;&amp;#039;ext/standard/tests/strmatch&amp;#039;&amp;#039;: the API contract, binary strings, overlaps, lifecycle, object comparison, counter overflow and 350 seeded cases against &amp;#039;&amp;#039;strpos()&amp;#039;&amp;#039; and &amp;#039;&amp;#039;strtr()&amp;#039;&amp;#039;. They pass in a GCC 15.2 debug build&lt;strong class=&quot;diff-mark&quot;&gt;,&amp;#160;&lt;/strong&gt;with&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and without&amp;#160;&lt;/strong&gt;ASan and UBSan.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * The benchmark checks every existing method against the new class on every text before timing.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * The benchmark checks every existing method against the new class on every text before timing.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 665:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 666:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| &amp;#039;&amp;#039;countMatches()&amp;#039;&amp;#039;, 128 keys, 64 KiB, pattern per call |&amp;#160; 1,760|&amp;#160; 631| PCRE, 2.8× |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| &amp;#039;&amp;#039;countMatches()&amp;#039;&amp;#039;, 128 keys, 64 KiB, pattern per call |&amp;#160; 1,760|&amp;#160; 631| PCRE, 2.8× |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Moderation, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;, 403 words, &amp;#039;&amp;#039;strtolower()&amp;#039;&amp;#039; in the loop, ready pattern |&amp;#160; 20.2|&amp;#160; 4.24| PCRE, 4.8× |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Moderation, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;, 403 words, &amp;#039;&amp;#039;strtolower()&amp;#039;&amp;#039; in the loop, ready pattern |&amp;#160; 20.2|&amp;#160; 4.24| PCRE, 4.8× |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;| Moderation, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;, 403 words, pattern per call |&amp;#160; 20.4|&amp;#160; 82.5| loop, 4.0× |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;| Moderation, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;, 403 words&lt;strong class=&quot;diff-mark&quot;&gt;, &amp;#039;&amp;#039;strtolower()&amp;#039;&amp;#039; in the loop&lt;/strong&gt;, pattern per call |&amp;#160; 20.4|&amp;#160; 82.5| loop, 4.0× |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Bot detection, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;, 1,469 patterns, pattern per call |&amp;#160; 32.7|&amp;#160; 179| loop, 5.5× |&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;| Bot detection, &amp;#039;&amp;#039;matches()&amp;#039;&amp;#039;, 1,469 patterns, pattern per call |&amp;#160; 32.7|&amp;#160; 179| loop, 5.5× |&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/context-managers-v2?rev=1794496350&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-12T15:12:30+00:00</dc:date>
        <dc:creator>crell (crell@undisclosed.example.com)</dc:creator>
        <title>context-managers-v2 - Improve description of return in a cm block</title>
        <link>https://wiki.php.net/rfc/context-managers-v2?rev=1794496350&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/12 15:12&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 48:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 48:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;function file_for_write(string $file)&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;function file_for_write(string $file)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;{&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;{&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; $fp = fopen(&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&lt;/strong&gt;file&lt;strong class=&quot;diff-mark&quot;&gt;.txt&amp;#039;&lt;/strong&gt;, &amp;#039;w&amp;#039;);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; $fp = fopen(&lt;strong class=&quot;diff-mark&quot;&gt;$&lt;/strong&gt;file, &amp;#039;w&amp;#039;);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; if ($fp) {&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; if ($fp) {&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; try {&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; try {&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/curl_opensocketfunction?rev=1794487457&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-12T12:44:17+00:00</dc:date>
        <dc:creator>beoneself (beoneself@undisclosed.example.com)</dc:creator>
        <title>curl_opensocketfunction - remove CurlAddressFamily</title>
        <link>https://wiki.php.net/rfc/curl_opensocketfunction?rev=1794487457&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/12 10:48&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Vetting cURL connections with CURLOPT_OPENSOCKETFUNCTION ======&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;====== PHP RFC: Vetting cURL connections with CURLOPT_OPENSOCKETFUNCTION ======&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * Version: 0.&lt;strong class=&quot;diff-mark&quot;&gt;1&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * Version: 0.&lt;strong class=&quot;diff-mark&quot;&gt;2&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-11-12&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Date: 2026-11-12&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Xavier Leune, xavier.leune@gmail.com&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Author: Xavier Leune, xavier.leune@gmail.com&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 21:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 21:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle&lt;strong class=&quot;diff-mark&quot;&gt;, CurlAddressFamily $family&lt;/strong&gt;, string $address,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;?&lt;/strong&gt;int $port): bool {&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle, string $address, int $port): bool {&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // Only publicly routable addresses.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // Only publicly routable addresses.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$family !== CurlAddressFamily::Unix &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;amp;&amp;amp;&amp;#160;&lt;/strong&gt;filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 45:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 44:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;A new option, &amp;#039;&amp;#039;CURLOPT_OPENSOCKETFUNCTION&amp;#039;&amp;#039;, registers a callback that allows&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;A new option, &amp;#039;&amp;#039;CURLOPT_OPENSOCKETFUNCTION&amp;#039;&amp;#039;, registers a callback that allows&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;or refuses each connection&lt;strong class=&quot;diff-mark&quot;&gt;, and a new enum describes the address family&lt;/strong&gt;:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;or refuses each connection:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 55:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 54:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160;*/&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160;*/&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;const CURLOPT_OPENSOCKETFUNCTION = UNKNOWN; // 20163, libcurl&amp;#039;s value&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;const CURLOPT_OPENSOCKETFUNCTION = UNKNOWN; // 20163, libcurl&amp;#039;s value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;enum CurlAddressFamily&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;{&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; case IpV4;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; case IpV6;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; case Unix;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;}&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;// The callback:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;// The callback:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;function (CurlHandle $handle&lt;strong class=&quot;diff-mark&quot;&gt;, CurlAddressFamily $family&lt;/strong&gt;, string $address,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;?&lt;/strong&gt;int $port): bool {}&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;function (CurlHandle $handle, string $address, int $port): bool {}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;?&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;?&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;The case names follow &amp;#039;&amp;#039;Uri\UriHostType&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Uri\UrlHostType&amp;#039;&amp;#039;.&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;The callback&amp;#039;s parameters:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;The callback&amp;#039;s parameters:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * &amp;#039;&amp;#039;$handle&amp;#039;&amp;#039;: the CurlHandle performing the transfer. It comes first, as in every other ext/curl callback. For a copy made with curl_copy_handle() or &amp;#039;&amp;#039;clone&amp;#039;&amp;#039;, it is the copy. &amp;#039;&amp;#039;curl_getinfo($handle, CURLINFO_EFFECTIVE_URL)&amp;#039;&amp;#039; tells which URL the address is for, redirects included.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * &amp;#039;&amp;#039;$handle&amp;#039;&amp;#039;: the CurlHandle performing the transfer. It comes first, as in every other ext/curl callback. For a copy made with curl_copy_handle() or &amp;#039;&amp;#039;clone&amp;#039;&amp;#039;, it is the copy. &amp;#039;&amp;#039;curl_getinfo($handle, CURLINFO_EFFECTIVE_URL)&amp;#039;&amp;#039; tells which URL the address is for, redirects included.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;* &amp;#039;&amp;#039;$family&amp;#039;&amp;#039;: a case of &amp;#039;&amp;#039;CurlAddressFamily&amp;#039;&amp;#039;. &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * &amp;#039;&amp;#039;$address&amp;#039;&amp;#039;: the literal&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;IPv4 or IPv6&amp;#160;&lt;/strong&gt;address, in the form inet_ntop() produces. For&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a UNIX socket&lt;/strong&gt;, the path given with CURLOPT_UNIX_SOCKET_PATH or CURLOPT_ABSTRACT_UNIX_SOCKET. An abstract name keeps its leading NUL byte. &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160;&amp;#160;&lt;/strong&gt;* &amp;#039;&amp;#039;$address&amp;#039;&amp;#039;:&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;for &amp;#039;&amp;#039;IpV4&amp;#039;&amp;#039; and &amp;#039;&amp;#039;IpV6&amp;#039;&amp;#039;,&amp;#160;&lt;/strong&gt;the literal address, in the form inet_ntop() produces. For&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;Unix&amp;#039;&amp;#039;&lt;/strong&gt;, the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;socket&amp;#160;&lt;/strong&gt;path given with CURLOPT_UNIX_SOCKET_PATH or CURLOPT_ABSTRACT_UNIX_SOCKET. An abstract name keeps its leading NUL byte. &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * &amp;#039;&amp;#039;$port&amp;#039;&amp;#039;: the destination port, or&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;0&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a UNIX socket&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;as CURLOPT_PREREQFUNCTION and CURLINFO_PRIMARY_PORT report it&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * &amp;#039;&amp;#039;$port&amp;#039;&amp;#039;: the destination port, or&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;null&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;for&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;Unix&amp;#039;&amp;#039;&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;where a port has no meaning&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Semantics ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Semantics ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 139:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 128:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;libcurl&amp;#039;s value, and its documentation will describe the difference.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;libcurl&amp;#039;s value, and its documentation will describe the difference.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;==== Why&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the&amp;#160;&lt;/strong&gt;address family&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is passed&amp;#160;&lt;/strong&gt;====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;==== Why&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;no&amp;#160;&lt;/strong&gt;address family ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;libcurl already knows&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;family&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;recomputing it from&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;string is both&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Version 0.1 passed a &amp;#039;&amp;#039;CurlAddressFamily&amp;#039;&amp;#039; enum (&amp;#039;&amp;#039;IpV4&amp;#039;&amp;#039;, &amp;#039;&amp;#039;IpV6&amp;#039;&amp;#039;, &amp;#039;&amp;#039;Unix&amp;#039;&amp;#039;) &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;wasteful and error-prone. It also tells a policy&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;$&lt;/strong&gt;address&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;&amp;#160;&lt;/strong&gt;is a path&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;before&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;address&lt;/strong&gt;, and&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a null port for UNIX sockets. Review on&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;pull&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;rather than&amp;#160;&lt;/strong&gt;an&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;IP&lt;/strong&gt;.&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;Note&amp;#160;&lt;/strong&gt;that an IPv4-mapped IPv6 address (&amp;#039;&amp;#039;::ffff:127.0.0.1&amp;#039;&amp;#039;)&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;request showed&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;the&amp;#160;&lt;/strong&gt;address&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;alone&amp;#160;&lt;/strong&gt;is&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;enough: &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;reaches an IPv4 host from an&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;IpV6&amp;#160;&lt;/strong&gt;socket. A policy&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;must therefore&amp;#160;&lt;/strong&gt;look at the&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;address&lt;strong class=&quot;diff-mark&quot;&gt;, not&amp;#160;&lt;/strong&gt;only&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;at&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;family. FILTER_FLAG_GLOBAL_RANGE refuses the whole&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * An IP-based policy rejects socket paths by itself: filter_var() with FILTER_VALIDATE_IP returns false for&amp;#160;&lt;/strong&gt;a path&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;or&amp;#160;&lt;/strong&gt;an&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;abstract name, so the refusal is the default&lt;/strong&gt;.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;::ffff:&lt;/strong&gt;0&lt;strong class=&quot;diff-mark&quot;&gt;:&lt;/strong&gt;0&lt;strong class=&quot;diff-mark&quot;&gt;/96&lt;/strong&gt;&amp;#039;&amp;#039;&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;block&lt;/strong&gt;, which the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;IANA registry lists as&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;globally&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * A policy&amp;#160;&lt;/strong&gt;that&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;does accept some UNIX sockets can tell them apart with the same filter_var() call. IPv4 and IPv6 are told apart with FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;reachable&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;whatever IPv4 address&amp;#160;&lt;/strong&gt;it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;embeds; so does Symfony&amp;#039;s&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * A port of 0 for UNIX sockets is what CURLOPT_PREREQFUNCTION and CURLINFO_PRIMARY_PORT already report, so all three agree. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;IpUtils::PRIVATE_SUBNETS&amp;#039;&amp;#039;&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * The family can mislead:&amp;#160;&lt;/strong&gt;an IPv4-mapped IPv6 address (&amp;#039;&amp;#039;::ffff:127.0.0.1&amp;#039;&amp;#039;) reaches an IPv4 host from an&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;AF_INET6&amp;#160;&lt;/strong&gt;socket. A policy&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;has to&amp;#160;&lt;/strong&gt;look at the address&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;anyway. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * It saves a new global type. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;The&amp;#160;&lt;/strong&gt;only&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;address&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;callback cannot classify is a relative socket path that&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;looks like an IP, such as a file named&amp;#160;&lt;/strong&gt;&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;10.&lt;/strong&gt;0&lt;strong class=&quot;diff-mark&quot;&gt;.&lt;/strong&gt;0&lt;strong class=&quot;diff-mark&quot;&gt;.5&lt;/strong&gt;&amp;#039;&amp;#039;&lt;strong class=&quot;diff-mark&quot;&gt;. That path comes from &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;CURLOPT_UNIX_SOCKET_PATH&lt;/strong&gt;, which&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;is set by&amp;#160;&lt;/strong&gt;the&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;application,&amp;#160;&lt;/strong&gt;not&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;by the URL.&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;If a use case for the family appears&lt;/strong&gt;, it&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;can be appended as a parameter later&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;without breaking existing callbacks&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Examples ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== Examples ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 163:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 160:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle&lt;strong class=&quot;diff-mark&quot;&gt;, CurlAddressFamily $family&lt;/strong&gt;, string $address,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;?&lt;/strong&gt;int $port): bool { &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle, string $address, int $port): bool { &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$family !== CurlAddressFamily::Unix &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;amp;&amp;amp;&amp;#160;&lt;/strong&gt;filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 189:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 185:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle&lt;strong class=&quot;diff-mark&quot;&gt;, CurlAddressFamily $family&lt;/strong&gt;, string $address,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;?&lt;/strong&gt;int $port): bool { &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle, string $address, int $port): bool { &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return $&lt;strong class=&quot;diff-mark&quot;&gt;family&amp;#160;&lt;/strong&gt;!==&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;CurlAddressFamily::Unix&lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;filter_var(&lt;/strong&gt;$&lt;strong class=&quot;diff-mark&quot;&gt;address, FILTER_VALIDATE_IP)&amp;#160;&lt;/strong&gt;!==&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;false&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;amp;&amp;amp; !IpUtils::checkIp($address, IpUtils::PRIVATE_SUBNETS);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;amp;&amp;amp; !IpUtils::checkIp($address, IpUtils::PRIVATE_SUBNETS);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 197:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 193:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;/PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Edge case: an IPv4-mapped IPv6 address is reported&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;with the IpV6 family&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Edge case: an IPv4-mapped IPv6 address is reported&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;in its IPv6 form&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;FILTER_FLAG_GLOBAL_RANGE refuses it, as it refuses every address of the&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;FILTER_FLAG_GLOBAL_RANGE refuses it, as it refuses every address of the&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#039;&amp;#039;::ffff:0:0/96&amp;#039;&amp;#039; block, &amp;#039;&amp;#039;::ffff:8.8.8.8&amp;#039;&amp;#039; included: it does not look at the&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#039;&amp;#039;::ffff:0:0/96&amp;#039;&amp;#039; block, &amp;#039;&amp;#039;::ffff:8.8.8.8&amp;#039;&amp;#039; included: it does not look at the&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;embedded IPv4 address.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;embedded IPv4 address&lt;strong class=&quot;diff-mark&quot;&gt;. So does Symfony&amp;#039;s &amp;#039;&amp;#039;IpUtils::PRIVATE_SUBNETS&amp;#039;&amp;#039;&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;lt;PHP&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 208:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 204:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle&lt;strong class=&quot;diff-mark&quot;&gt;, CurlAddressFamily $family&lt;/strong&gt;, string $address,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;?&lt;/strong&gt;int $port): bool { &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle, string $address, int $port): bool { &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; var_dump(&lt;strong class=&quot;diff-mark&quot;&gt;$family,&amp;#160;&lt;/strong&gt;$address, $port);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; var_dump($address, $port);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; });&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 216:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 212:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;var_dump(curl_errno($ch) === CURLE_COULDNT_CONNECT);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;var_dump(curl_errno($ch) === CURLE_COULDNT_CONNECT);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;// enum(CurlAddressFamily::IpV6)&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;// string(16) &amp;quot;::ffff:127.0.0.1&amp;quot;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;// string(16) &amp;quot;::ffff:127.0.0.1&amp;quot;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;// int(8080)&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;// int(8080)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 235:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 230:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;curl_setopt($ch, CURLOPT_OPENSOCKETFUNCTION,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle&lt;strong class=&quot;diff-mark&quot;&gt;, CurlAddressFamily $family&lt;/strong&gt;, string $address,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;?&lt;/strong&gt;int $port): bool { &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; function (CurlHandle $handle, string $address, int $port): bool { &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $allowed =&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;$family !== CurlAddressFamily::Unix &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; $allowed = filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;amp;&amp;amp;&amp;#160;&lt;/strong&gt;filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if (!$allowed) {&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; if (!$allowed) {&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; error_log(sprintf(&amp;#039;Refused %s:%d for %s&amp;#039;, $address, $port,&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; error_log(sprintf(&amp;#039;Refused %s:%d for %s&amp;#039;, $address, $port,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 252:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 246:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Backward Incompatible Changes =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Backward Incompatible Changes =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;Two&amp;#160;&lt;/strong&gt;new global&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;symbols:&amp;#160;&lt;/strong&gt;the &amp;#039;&amp;#039;CURLOPT_OPENSOCKETFUNCTION&amp;#039;&amp;#039; constant&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and the &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;One&amp;#160;&lt;/strong&gt;new global&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;symbol,&amp;#160;&lt;/strong&gt;the &amp;#039;&amp;#039;CURLOPT_OPENSOCKETFUNCTION&amp;#039;&amp;#039; constant. Code that&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#039;&amp;#039;CurlAddressFamily&amp;#039;&amp;#039; enum&lt;/strong&gt;. Code that declares&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;either&amp;#160;&lt;/strong&gt;in the global namespace&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;declares&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it&amp;#160;&lt;/strong&gt;in the global namespace will conflict. A search of public code on&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;will conflict. A search of public code on GitHub found no use of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;either name &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;GitHub found no use of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it&amp;#160;&lt;/strong&gt;outside the polyfill below, which declares&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;it&amp;#160;&lt;/strong&gt;only&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;outside the polyfill below, which declares&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;them&amp;#160;&lt;/strong&gt;only when ext/curl does not.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;when ext/curl does not.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposed PHP Version(s) =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Proposed PHP Version(s) =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Next PHP 8.x&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;(8.7)&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Next PHP 8.x.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== RFC Impact =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== RFC Impact =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 265:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 259:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To the Ecosystem ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To the Ecosystem ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;IDEs, language servers and static analysers need&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;stubs&amp;#160;&lt;/strong&gt;for the new constant&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and &lt;/strong&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;IDEs, language servers and static analysers need&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;a stub&amp;#160;&lt;/strong&gt;for the new constant.&lt;strong class=&quot;diff-mark&quot;&gt; &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;enum&lt;/strong&gt;. Nothing else changes for them: the callback is an ordinary callable.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Nothing else changes for them: the callback is an ordinary callable.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;HTTP libraries built on ext/curl, such as Symfony HttpClient and Guzzle, can&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;HTTP libraries built on ext/curl, such as Symfony HttpClient and Guzzle, can&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 290:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 284:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Future Scope =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Future Scope =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * **Streams.** The same need exists for &amp;#039;&amp;#039;file_get_contents()&amp;#039;&amp;#039; and the &amp;#039;&amp;#039;http://&amp;#039;&amp;#039; wrapper, as raised in the discussion. The decision has to be made per request, so it belongs in each API rather than in a global setting. A stream context option deserves its own RFC&lt;strong class=&quot;diff-mark&quot;&gt;, and could reuse &amp;#039;&amp;#039;CurlAddressFamily&amp;#039;&amp;#039; or&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;neutral equivalent&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * **Streams.** The same need exists for &amp;#039;&amp;#039;file_get_contents()&amp;#039;&amp;#039; and the &amp;#039;&amp;#039;http://&amp;#039;&amp;#039; wrapper, as raised in the discussion. The decision has to be made per request, so it belongs in each API rather than in a global setting. A stream context option deserves its own RFC&lt;strong class=&quot;diff-mark&quot;&gt;. &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;strong class=&quot;diff-mark&quot;&gt;&amp;#160; * **Passing the address family.** It can be appended as&amp;#160;&lt;/strong&gt;a&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;parameter if a use case appears (see &amp;quot;Why no address family&amp;quot;)&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Returning a socket description.** If use cases emerge, the return type can be widened (see &amp;quot;Why a bool, and not a socket&amp;quot;).&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * **Returning a socket description.** If use cases emerge, the return type can be widened (see &amp;quot;Why a bool, and not a socket&amp;quot;).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 299:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 294:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Primary Vote requiring a 2/3 majority to accept the RFC:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Primary Vote requiring a 2/3 majority to accept the RFC:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;lt;doodle title=&amp;quot;Add CURLOPT_OPENSOCKETFUNCTION&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and CurlAddressFamily&amp;#160;&lt;/strong&gt;to ext/curl as outlined in the RFC?&amp;quot; voteType=&amp;quot;single&amp;quot; closed=&amp;quot;true&amp;quot; closeon=&amp;quot;2026-12-31T00:00:00Z&amp;quot;&amp;gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;lt;doodle title=&amp;quot;Add CURLOPT_OPENSOCKETFUNCTION to ext/curl as outlined in the RFC?&amp;quot; voteType=&amp;quot;single&amp;quot; closed=&amp;quot;true&amp;quot; closeon=&amp;quot;2026-12-31T00:00:00Z&amp;quot;&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* Yes&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* Yes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* No&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; &amp;#160;* No&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 310:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 305:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * allow and refuse, including under curl_multi;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * allow and refuse, including under curl_multi;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * redirects;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * redirects;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; * reporting of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;every family&lt;/strong&gt;, IPv4-mapped IPv6, UNIX and abstract sockets&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;included&lt;/strong&gt;;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * reporting of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;IPv4&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;IPv6 and&amp;#160;&lt;/strong&gt;IPv4-mapped IPv6&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;addresses&lt;/strong&gt;,&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;and of&amp;#160;&lt;/strong&gt;UNIX and abstract sockets;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * that &amp;#039;&amp;#039;file://&amp;#039;&amp;#039; opens no socket;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * that &amp;#039;&amp;#039;file://&amp;#039;&amp;#039; opens no socket;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * connection reuse, CURLOPT_FRESH_CONNECT and CURLOPT_PREREQFUNCTION;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * connection reuse, CURLOPT_FRESH_CONNECT and CURLOPT_PREREQFUNCTION;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 334:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 329:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Returning a Socket from ext/sockets (see &amp;quot;Why a bool, and not a socket&amp;quot;).&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * Returning a Socket from ext/sockets (see &amp;quot;Why a bool, and not a socket&amp;quot;).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * A PHP-specific option name (see &amp;quot;Why the libcurl name&amp;quot;).&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * A PHP-specific option name (see &amp;quot;Why the libcurl name&amp;quot;).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * A &amp;#039;&amp;#039;CurlAddressFamily&amp;#039;&amp;#039; enum parameter and a null port for UNIX sockets (see &amp;quot;Why no address family&amp;quot;).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * A &amp;#039;&amp;#039;$purpose&amp;#039;&amp;#039; parameter: libcurl only uses CURLSOCKTYPE_IPCXN; anything else is refused without calling the callback.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * A &amp;#039;&amp;#039;$purpose&amp;#039;&amp;#039; parameter: libcurl only uses CURLSOCKTYPE_IPCXN; anything else is refused without calling the callback.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 339:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 335:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * 0.1 (2026-11-12): Initial version.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; * 0.1 (2026-11-12): Initial version.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; * 0.2 (2026-11-12): Removed the CurlAddressFamily parameter; the port of a UNIX socket is 0 instead of null, as in CURLOPT_PREREQFUNCTION.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/rfc/sunset_pecl?rev=1794425392&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-11-11T19:29:52+00:00</dc:date>
        <dc:creator>asgrim (asgrim@undisclosed.example.com)</dc:creator>
        <title>sunset_pecl - Shorten read only phase to 6 months following security concerns and add manual removal mitigation</title>
        <link>https://wiki.php.net/rfc/sunset_pecl?rev=1794425392&amp;do=diff</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;2026/11/09 20:04&lt;/th&gt;&lt;th colspan=&quot;2&quot; width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 12:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 12:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;This RFC sets out a proposed timeline and approach to sunsetting PECL. PIE is usable on all versions of PHP (the PHAR is 8.1 minimum, the executable version uses its own Static PHP).&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;This RFC sets out a proposed timeline and approach to sunsetting PECL. PIE is usable on all versions of PHP (the PHAR is 8.1 minimum, the executable version uses its own Static PHP).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;The process will first announce the timeline, followed by making pecl.php.net read-only. After a set of brownouts (including Windows downloads), the site will be shut down at the end of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;, with its repositories archived.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;The process will first announce the timeline, followed by making pecl.php.net read-only. After a set of brownouts (including Windows downloads), the site will be shut down at the end of&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;, with its repositories archived.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;NOTE: PECL removal from `php-src` was already covered by the [[rfc:end_pear_endorsement|End PEAR endorsement RFC]].&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;NOTE: PECL removal from `php-src` was already covered by the [[rfc:end_pear_endorsement|End PEAR endorsement RFC]].&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 21:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 21:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; - On Monday 4th January 2027, add a banner on the PECL website that the PECL site will be made read-only on Wednesday 30th June 2027, with information for extension authors on how to migrate to using PIE.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; - On Monday 4th January 2027, add a banner on the PECL website that the PECL site will be made read-only on Wednesday 30th June 2027, with information for extension authors on how to migrate to using PIE.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; - On Wednesday 30th June 2027, make the [[https://pecl.php.net/|PECL website]] entirely read-only. No-one will be able to log in to the site any more, and no-one will be able to upload any new releases. The site banner should be updated to indicate this is read-only now, and that on Monday 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;, the site will be shut down after a series of brownouts.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; - On Wednesday 30th June 2027, make the [[https://pecl.php.net/|PECL website]] entirely read-only. No-one will be able to log in to the site any more, and no-one will be able to upload any new releases. The site banner should be updated to indicate this is read-only now, and that on Monday 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;, the site will be shut down after a series of brownouts.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; - A series of brownouts, increasing in length, will take place to help raise awareness of PECL shutting down. Communication (such as mailing lists, GitHub issues, etc.) should be monitored, and information provided on the imminent shutdown of PECL. The brownouts are:&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; - A series of brownouts, increasing in length, will take place to help raise awareness of PECL shutting down. Communication (such as mailing lists, GitHub issues, etc.) should be monitored, and information provided on the imminent shutdown of PECL. The brownouts are:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; * Monday 3rd September&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;: 3 hours &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; * Monday 3rd September&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;: 3 hours &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; * Monday 1st October&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;: 6 hours &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; * Monday 1st October&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;: 6 hours &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; * Monday 5th November&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;: 24 hours &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; * Monday 5th November&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;: 24 hours &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; &amp;#160; * Monday 3rd December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&amp;#160;&lt;/strong&gt;to Thursday 6th December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;: 3 days &lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; &amp;#160; * Monday 3rd December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&amp;#160;&lt;/strong&gt;to Thursday 6th December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;: 3 days &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;&amp;#160; - On Monday 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;, the PECL website will be shut down.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&amp;#160; - On Monday 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;, the PECL website will be shut down.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; - Once pecl.php.net is shut down, the PECL tool and website git repositories will be marked as archived.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&amp;#160; - Once pecl.php.net is shut down, the PECL tool and website git repositories will be marked as archived.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;==== Vulnerability Mitigation during read only phase ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;If a serious vulnerability is identified during the read only phase, we may remove the affected packages manually, causing all affected package versions to fail early; this is to ensure we are not distributing vulnerable packages.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;==== PECL site content during brownout ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;During the brownouts, the `pecl.php.net` website will display information as to what is happening, but any downloads will fail during this period.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Backward Incompatible Changes =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Backward Incompatible Changes =====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 42:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 50:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To the Ecosystem ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To the Ecosystem ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;PECL will stop working entirely by the end of the shutdown phase, on Monday 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;PECL will stop working entirely by the end of the shutdown phase, on Monday 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To Existing Extensions ====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;==== To Existing Extensions ====&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 48:&lt;/td&gt;
&lt;td class=&quot;diff-blockheader&quot; colspan=&quot;2&quot;&gt;Line 56:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Extension authors will no longer be able to make new PECL releases, from 30th June 2027.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;Extension authors will no longer be able to make new PECL releases, from 30th June 2027.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;-&lt;/td&gt;&lt;td class=&quot;diff-deletedline&quot;&gt;Any extension that has not migrated to PIE will no longer be installable with PECL, from 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2029&lt;/strong&gt;.&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;+&lt;/td&gt;&lt;td class=&quot;diff-addedline&quot;&gt;Any extension that has not migrated to PIE will no longer be installable with PECL, from 31st December&amp;#160;&lt;strong class=&quot;diff-mark&quot;&gt;2027&lt;/strong&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Voting Choices =====&lt;/td&gt;&lt;td class=&quot;diff-lineheader&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&quot;diff-context&quot;&gt;===== Voting Choices =====&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/?image=rfc%3Asurface3d.png&amp;ns=rfc&amp;rev=1784468890&amp;tab_details=history&amp;media_do=diff&amp;do=media">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-19T13:48:10+00:00</dc:date>
        <dc:creator>pajoye (pajoye@undisclosed.example.com)</dc:creator>
        <title>surface3d.png - created</title>
        <link>https://wiki.php.net/?image=rfc%3Asurface3d.png&amp;ns=rfc&amp;rev=1784468890&amp;tab_details=history&amp;media_do=diff&amp;do=media</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th width=&quot;50%&quot;&gt;&lt;/th&gt;&lt;th width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/?image=rfc%3Ascaled_on_load_rotate.png&amp;ns=rfc&amp;rev=1784270844&amp;tab_details=history&amp;media_do=diff&amp;do=media">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-17T06:47:24+00:00</dc:date>
        <dc:creator>pajoye (pajoye@undisclosed.example.com)</dc:creator>
        <title>scaled_on_load_rotate.png - created</title>
        <link>https://wiki.php.net/?image=rfc%3Ascaled_on_load_rotate.png&amp;ns=rfc&amp;rev=1784270844&amp;tab_details=history&amp;media_do=diff&amp;do=media</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th width=&quot;50%&quot;&gt;&lt;/th&gt;&lt;th width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/?image=rfc%3Awatermarked.png&amp;ns=rfc&amp;rev=1784260645&amp;tab_details=history&amp;media_do=diff&amp;do=media">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-17T03:57:25+00:00</dc:date>
        <dc:creator>pajoye (pajoye@undisclosed.example.com)</dc:creator>
        <title>watermarked.png - created</title>
        <link>https://wiki.php.net/?image=rfc%3Awatermarked.png&amp;ns=rfc&amp;rev=1784260645&amp;tab_details=history&amp;media_do=diff&amp;do=media</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th width=&quot;50%&quot;&gt;&lt;/th&gt;&lt;th width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/?image=rfc%3Ascale_entropy_visual_check.png&amp;ns=rfc&amp;rev=1783998723&amp;tab_details=history&amp;media_do=diff&amp;do=media">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-14T03:12:03+00:00</dc:date>
        <dc:creator>pajoye (pajoye@undisclosed.example.com)</dc:creator>
        <title>scale_entropy_visual_check.png - created</title>
        <link>https://wiki.php.net/?image=rfc%3Ascale_entropy_visual_check.png&amp;ns=rfc&amp;rev=1783998723&amp;tab_details=history&amp;media_do=diff&amp;do=media</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th width=&quot;50%&quot;&gt;&lt;/th&gt;&lt;th width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
    </item>
    <item rdf:about="https://wiki.php.net/?image=rfc%3Atextcurve.png&amp;ns=rfc&amp;rev=1783692533&amp;tab_details=history&amp;media_do=diff&amp;do=media">
        <dc:format>text/html</dc:format>
        <dc:date>2026-07-10T14:08:53+00:00</dc:date>
        <dc:creator>pajoye (pajoye@undisclosed.example.com)</dc:creator>
        <title>textcurve.png - created</title>
        <link>https://wiki.php.net/?image=rfc%3Atextcurve.png&amp;ns=rfc&amp;rev=1783692533&amp;tab_details=history&amp;media_do=diff&amp;do=media</link>
        <description>&lt;table&gt;&lt;tr&gt;&lt;th width=&quot;50%&quot;&gt;1783692513&lt;/th&gt;&lt;th width=&quot;50%&quot;&gt;current&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description>
    </item>
</rdf:RDF>
