On Tue, Mar 29, 2022 at 9:44 PM Rowan Tommins wrote:
>
> Hi all,
>
> If $foo is not defined, statements such as $foo += 1 and $foo .= 'blah'
> raise "undefined variable" Warnings in PHP 8, and will throw Errors in
> PHP 9. However, the very similar looking $foo[] = 1 succeeds silently.
>
> This
Alex,
On Tue, Mar 29, 2022 at 10:35 PM Alexandru Pătrănescu
wrote:
> Hey Mark,
>
>
> On Wed, Mar 30, 2022 at 6:03 AM Mark Niebergall
> wrote:
>
>>
>> I have updated the RFC https://wiki.php.net/rfc/typed_class_constants
>> with
>> more details and examples from this thread, and updated the RFC
Den 2022-03-29 kl. 21:44, skrev Rowan Tommins:
Hi all,
If $foo is not defined, statements such as $foo += 1 and $foo .= 'blah'
raise "undefined variable" Warnings in PHP 8, and will throw Errors in
PHP 9. However, the very similar looking $foo[] = 1 succeeds silently.
This seems odd to me,
> RFC. There are other inconsistencies as well now, depending on how the
undefined variable comes to exist
absolutely, but shouldn't try to do too much in a single rfc, wouldn't want
it to be rejected for the wrong reasons ^^
On Wed, 30 Mar 2022 at 12:17, Björn Larsson via internals <
Dear PHP Internals,
I am looking at zend_vm_execute.h file and found some lines of code which I do
not quite get.
Who can help tell that why we should have ZEND_COLD attribute in ZEND_VM_HOT
line definition,
or I can simply ignore it as it is trivial? Thanks.
# if (ZEND_VM_KIND ==
On 30/03/2022 15:32, Guilliam Xavier wrote:
On the other hand, I agree that `$undefined[] = $x` looks like a
bug... are both cases the exact same opcode?
Some very good points raised in this thread about how many different
closely-related cases there are here. I shall have to think clearly
> Le 29 mars 2022 à 21:44, Rowan Tommins a écrit :
>
> Hi all,
>
> If $foo is not defined, statements such as $foo += 1 and $foo .= 'blah' raise
> "undefined variable" Warnings in PHP 8, and will throw Errors in PHP 9.
> However, the very similar looking $foo[] = 1 succeeds silently.
>
>
Hi Rowan,
Not really a "compelling reason why we should keep this inconsistency", but
I have occasionally relied on array autovivification *for sub-dimensions*,
e.g.:
```
function f(iterable $xs) {
$map = []; // initialization!
foreach ($xs as $x) {
// $map[foo($x)] ??= []; not
On Wed, 30 Mar 2022 at 15:33, Guilliam Xavier
wrote:
> Not really a "compelling reason why we should keep this inconsistency", but
> I have occasionally relied on array autovivification *for sub-dimensions*,
>
I rely on this often when remapping data for analysis. These scripts are
run a
Hey Mark,
On Wed, Mar 30, 2022 at 4:01 PM Mark Niebergall
wrote:
> Alex,
>
> On Tue, Mar 29, 2022 at 10:35 PM Alexandru Pătrănescu
> wrote:
>
>> Hey Mark,
>>
>>
>> On Wed, Mar 30, 2022 at 6:03 AM Mark Niebergall
>> wrote:
>>
>>>
>>> I have updated the RFC
Hi Mark,
I have updated the RFC https://wiki.php.net/rfc/typed_class_constants with
>>> more details and examples from this thread, and updated the RFC status to
>>> Under Discussion. Hopefully the updated RFC helps answer questions and
>>> clarifies what the proposal includes.
>>>
>>
Thanks (I
On Wed, Mar 30, 2022, at 9:11 AM, Claude Pache wrote:
>> Le 29 mars 2022 à 21:44, Rowan Tommins a écrit :
>>
>> Hi all,
>>
>> If $foo is not defined, statements such as $foo += 1 and $foo .= 'blah'
>> raise "undefined variable" Warnings in PHP 8, and will throw Errors in PHP
>> 9. However,
Alex,
On Wed, Mar 30, 2022 at 7:47 AM Alexandru Pătrănescu
wrote:
> Hey Mark,
>
> On Wed, Mar 30, 2022 at 4:01 PM Mark Niebergall
> wrote:
>
>> Alex,
>>
>> On Tue, Mar 29, 2022 at 10:35 PM Alexandru Pătrănescu
>> wrote:
>>
>>> Hey Mark,
>>>
>>>
>>> On Wed, Mar 30, 2022 at 6:03 AM Mark
Guilliam,
On Wed, Mar 30, 2022 at 7:50 AM Guilliam Xavier
wrote:
> Hi Mark,
>
> I have updated the RFC https://wiki.php.net/rfc/typed_class_constants with
more details and examples from this thread, and updated the RFC status
to
Under Discussion. Hopefully the updated RFC helps
> Ah yes, I hadn't considered expanding this RFC to namespaced and global
> constants. Let me mull over implementation syntax for those and include
> them in the RFC. My initial reaction is to not include those in this RFC,
> keeping the scope to just class constants. If there is value in typing
>
15 matches
Mail list logo