On 14 June 2015 04:33:16 BST, Yasuo Ohgaki wrote:
>Hi Rowan,
>
>On Thu, Jun 11, 2015 at 5:59 PM, Rowan Collins
>
>wrote:
>> This one has given a different message because of it being a
>non-string
>> value, but would be equally fatal if you tried to call any undefined
>> function. Would coercing N
Hi all,
On Fri, Jun 12, 2015 at 9:36 AM, Chris Wright wrote:
> On 12 June 2015 at 00:35, Rowan Collins wrote:
>
> > On 11/06/2015 21:22, Chris Wright wrote:
> >
> >> I'm inclined to agree that we should have consistency here, and that the
> >> current behaviour in a function context is the corr
Hi Rowan,
On Thu, Jun 11, 2015 at 5:59 PM, Rowan Collins
wrote:
> Yasuo Ohgaki wrote on 11/06/2015 00:50:
>
>> If PHP should return NULL always against NULL variables, we may be better
>> to
>> reconsider these behavior.
>>
>> [yohgaki@dev Download]$ php
>> > $v = NULL;
>> $$v;
>>
>>
>> PHP Noti
On 12 June 2015 at 00:35, Rowan Collins wrote:
> On 11/06/2015 21:22, Chris Wright wrote:
>
>> I'm inclined to agree that we should have consistency here, and that the
>> current behaviour in a function context is the correct one. A couple of
>> (IMO) good arguments for this:
>>
>> - The function
On 11/06/2015 21:22, Chris Wright wrote:
I'm inclined to agree that we should have consistency here, and that
the current behaviour in a function context is the correct one. A
couple of (IMO) good arguments for this:
- The function behaviour gives a more explanatory and useful error message
-
On 11 June 2015 at 09:59, Rowan Collins wrote:
> Yasuo Ohgaki wrote on 11/06/2015 00:50:
>
>> If PHP should return NULL always against NULL variables, we may be better
>> to
>> reconsider these behavior.
>>
>> [yohgaki@dev Download]$ php
>> > $v = NULL;
>> $$v;
>>
>>
>> PHP Notice: Undefined var
Yasuo Ohgaki wrote on 11/06/2015 00:50:
If PHP should return NULL always against NULL variables, we may be better
to
reconsider these behavior.
[yohgaki@dev Download]$ php
This is not complaining that $v is NULL, it is warning you the same as
if you wrote $v = 'some_name_you_never_assigned_to
Hi all,
On Thu, Jun 11, 2015 at 7:22 AM, Yasuo Ohgaki wrote:
> I agree that NULL is debatable. In PHP, NULL is treated as 0/false by its
> context.
> It's simpler if we get rid of the behavior altogether. IMO.
>
If PHP should return NULL always against NULL variables, we may be better
to
recons
Yasuo Ohgaki wrote:
> On Wed, Jun 10, 2015 at 5:30 PM, Nikita Popov wrote:
>
>> On Wed, Jun 10, 2015 at 8:53 AM, Stanislav Malyshev
>> wrote:
>>
>>> $foo = 42;
$foo['bar']; // => NULL
$v = NULL;
$v[0][1][2][3][4][5][6][7][8][9]; // NULL
this code is semantical
Hi Stas and Nikita,
On Wed, Jun 10, 2015 at 5:30 PM, Nikita Popov wrote:
> On Wed, Jun 10, 2015 at 8:53 AM, Stanislav Malyshev
> wrote:
>
>> Hi!
>>
>> > > > $foo = 42;
>> > $foo['bar']; // => NULL
>> > $v = NULL;
>> > $v[0][1][2][3][4][5][6][7][8][9]; // NULL
>> >
>> > this code is semanti
On , Nikita Popov wrote:
On Wed, Jun 10, 2015 at 8:53 AM, Stanislav Malyshev
wrote:
Hi!
>$foo = 42;
> $foo['bar']; // => NULL
> $v = NULL;
> $v[0][1][2][3][4][5][6][7][8][9]; // NULL
>
> this code is semantically wrong and I would like to have error/exception
> for such
> erroneous co
On Wed, Jun 10, 2015 at 8:53 AM, Stanislav Malyshev
wrote:
> Hi!
>
> > > $foo = 42;
> > $foo['bar']; // => NULL
> > $v = NULL;
> > $v[0][1][2][3][4][5][6][7][8][9]; // NULL
> >
> > this code is semantically wrong and I would like to have error/exception
> > for such
> > erroneous codes. It'
Hi!
>$foo = 42;
> $foo['bar']; // => NULL
> $v = NULL;
> $v[0][1][2][3][4][5][6][7][8][9]; // NULL
>
> this code is semantically wrong and I would like to have error/exception
> for such
> erroneous codes. It's inconsistent with array object, too.
Why it's wrong? You try to get that's s
Rowan Collins wrote:
> Christoph Becker wrote on 09/06/2015 14:09:
>> I wonder where these coercion rules are described. The manual has a
>> section about "Converting to array"[1] which actually describes casting,
>> and is obviously not what is happening when the subscript operator (as
>> the la
Christoph Becker wrote on 09/06/2015 14:09:
I wonder where these coercion rules are described. The manual has a
section about "Converting to array"[1] which actually describes casting,
and is obviously not what is happening when the subscript operator (as
the langspec calls it[2]) is applied to
Rowan Collins wrote:
> Yasuo Ohgaki wrote on 09/06/2015 11:44:
>> $v = NULL;
>> $v[0][1][2][3][4][5][6][7][8][9]; // NULL
>>
>> this code is semantically wrong and I would like to have error/exception
>> for such
>> erroneous codes.
>
> PHP considers an uninitialised variable to have the valu
Christoph Becker wrote on 09/06/2015 13:35:
Current behavior:
foo->bar;
?>
Notice: Trying to get property of non-object in %s on line %d
Notice: Trying to get property of non-object in %s on line %d
So trying to access a property on NULL gives a notice, but trying to
access an eleme
Christoph Becker wrote on 08/06/2015 22:11:
The behavior of dereferencing scalars as if they were arrays or strings
is arguable:
NULL
A few things to note here:
- accessing a *numeric* offset of a *string* is valid (selects a single
character)
- accessing a *string* offset of another str
Matt Wilmas wrote:
> Forgetting the NULL case for a sec... With:
>
> $v = [];
> $v[0][1][2][3][4][5][6][7][8][9];
>
> How/why are we going from 1 Notice to 10?!
>
> With:
>
> unset($v);
> $v[0];
>
> Why from 1 Notice about the undefined variable, to 2? That's totally
> new, and it really do
Yasuo Ohgaki wrote on 09/06/2015 11:44:
$v = NULL;
$v[0][1][2][3][4][5][6][7][8][9]; // NULL
this code is semantically wrong and I would like to have error/exception
for such
erroneous codes.
PHP considers an uninitialised variable to have the value NULL, and a
NULL value to be coercable
Hi all,
- Original Message -
From: "Christoph Becker"
Sent: Tuesday, June 09, 2015
Yasuo Ohgaki wrote:
I fully agree that current behavior could be used meaningful ways.
However,
NULL
$v = NULL;
$v[0][1][2][3][4][5][6][7][8][9]; // NULL
this code is semantically wrong and I wou
Yasuo Ohgaki wrote:
> I fully agree that current behavior could be used meaningful ways. However,
>
>$foo = 42;
> $foo['bar']; // => NULL
> $v = NULL;
> $v[0][1][2][3][4][5][6][7][8][9]; // NULL
>
> this code is semantically wrong and I would like to have error/exception
> for such
> erro
Hi Matt,
On Tue, Jun 9, 2015 at 7:04 PM, Matt Wilmas wrote:
> Hi all,
>
>
> - Original Message -
> From: "Yasuo Ohgaki"
> Sent: Tuesday, June 09, 2015
>
> Hi all,
>>
>> On Tue, Jun 9, 2015 at 6:21 AM, Stanislav Malyshev
>> wrote:
>>
>> > Would throwing a notice or a warning on array d
Hi all,
- Original Message -
From: "Yasuo Ohgaki"
Sent: Tuesday, June 09, 2015
Hi all,
On Tue, Jun 9, 2015 at 6:21 AM, Stanislav Malyshev
wrote:
> Would throwing a notice or a warning on array deferencing scalars
> be acceptable for PHP 7.0, or does this need an RFC?
I think this d
Hi all,
On Tue, Jun 9, 2015 at 6:21 AM, Stanislav Malyshev
wrote:
> > Would throwing a notice or a warning on array deferencing scalars
> > be acceptable for PHP 7.0, or does this need an RFC?
>
> I think this does need an RFC, and for 7.0, pretty much no new language
> changes are acceptable an
Hi!
> Would throwing a notice or a warning on array deferencing scalars
> be acceptable for PHP 7.0, or does this need an RFC?
I think this does need an RFC, and for 7.0, pretty much no new language
changes are acceptable anymore, since we're past the timeframe.
--
Stas Malyshev
smalys...@gmail.
26 matches
Mail list logo