Re: [PHP-DEV] Missing warning for stat(), etc. when invoked with empty string

2020-12-03 Thread Christian Schneider
Am 03.12.2020 um 22:13 schrieb Nikita Popov : > On Thu, Dec 3, 2020 at 10:06 PM Levi Morrison via internals < > internals@lists.php.net > wrote: >> This is a long-standing behavior. Further, I don't know many people >> who want _more_ warnings in their codebase. >>

Re: [PHP-DEV] Re: PHP 8 is_file/is_dir input handling

2020-12-03 Thread Stanislav Malyshev
Hi! While it's clear that passing e.g. an array falls into the scope of that general note, it doesn't say anywhere on that page that a string value which contains "\0" is "not what it expects", and I don't think I would ever have guessed that before reading this thread. So I stand by my

Re: [PHP-DEV] Missing warning for stat(), etc. when invoked with empty string

2020-12-03 Thread Nikita Popov
On Thu, Dec 3, 2020 at 10:06 PM Levi Morrison via internals < internals@lists.php.net> wrote: > On Thu, Dec 3, 2020 at 6:30 AM Claude Pache > wrote: > > > > [Of course, I meant `stat()`, not `stats()`. Resending the message with > correct spelling, including in subject line. Sorry.] > > > > > >

Re: [PHP-DEV] Missing warning for stat(), etc. when invoked with empty string

2020-12-03 Thread Levi Morrison via internals
On Thu, Dec 3, 2020 at 6:30 AM Claude Pache wrote: > > [Of course, I meant `stat()`, not `stats()`. Resending the message with > correct spelling, including in subject line. Sorry.] > > > Hi, > > `stat()` and friends invoked with empty string or null as argument, return > `false` (indicating

Re: [PHP-DEV] PHP 8 incompatible change documentation issues

2020-12-03 Thread G. P. B.
Please use the documentation list to talk about documentation issues and not the internal list. On Thu, 3 Dec 2020 at 14:18, Thomas Hruska wrote: > https://www.php.net/manual/en/migration80.incompatible.php > > Under the "String to Number Comparison" section of the migration guide, > there's

[PHP-DEV] PHP 8 incompatible change documentation issues

2020-12-03 Thread Thomas Hruska
https://www.php.net/manual/en/migration80.incompatible.php Under the "String to Number Comparison" section of the migration guide, there's no mention of explicit casts being unaffected. Using an explicit cast should be the general recommendation anyway. That is, anyone doing this: 42 ==

[PHP-DEV] Missing warning for stat(), etc. when invoked with empty string

2020-12-03 Thread Claude Pache
[Of course, I meant `stat()`, not `stats()`. Resending the message with correct spelling, including in subject line. Sorry.] Hi, `stat()` and friends invoked with empty string or null as argument, return `false` (indicating failure), but do not emit the Warning that is expected on failure.

[PHP-DEV] Missing warning for stats(), etc. when invoked with empty string

2020-12-03 Thread Claude Pache
Hi, `stats()` and friends invoked with empty string or null as argument, return `false` (indicating failure), but do not emit the Warning that is expected on failure. See: https://3v4l.org/jXC2N That discrepancy between the two ways of indicating failure is

Re: [PHP-DEV] MySQLi extension basic examples

2020-12-03 Thread Craig Francis
On Sat, 28 Nov 2020 at 16:26, Kamil Tekiela wrote: > I would like to hear your opinions about the following page in the PHP > manual: > https://www.php.net/manual/en/mysqli.examples-basic.php Oh, wow, I didn't expect to find this on the PHP website: $aid = (int) $_GET['aid']; > ... > $sql =

Re: [PHP-DEV] Allow new Cl()->method()

2020-12-03 Thread Michael Voříšek - ČVUT FEL
In my opinion: - the operator table docs should be updated to contain all operators ( see comment https://www.php.net/manual/en/language.operators.precedence.php#121509 ) - "new" should have the highest absolute priority, ie. new Cl()->method(); should be always interpreted as (new

Re: [PHP-DEV] Re: PHP 8 is_file/is_dir input handling

2020-12-03 Thread Rowan Tommins
On 03/12/2020 06:52, Stanislav Malyshev wrote: PHP functions always returned null on bad parameters, so it's not exactly unexpected. and On 02/12/2020 23:49, Christoph M. Becker wrote: Just to reiterate, the former behavior was documented[1], and the return value was*undefined*. Instead of

Re: [PHP-DEV] Suggestion: Inconsistency: Allow array spread operator to work on string keys

2020-12-03 Thread Côme Chilliet
Le Wed, 2 Dec 2020 17:45:47 +, "G. P. B." a écrit : > The reason why this has been deferred is because of which semantics should > be used for duplicate string keys. ['a' => 1, ...['a' => 2]] should be the same as ['a' => 1, 'a' => 2], I do not see how any other way would be justifiable.

Re: [PHP-DEV] PHP 8 is_file/is_dir input handling

2020-12-03 Thread Christian Schneider
Am 03.12.2020 um 09:27 schrieb Côme Chilliet : > > Le Tue, 1 Dec 2020 12:06:22 -0800, > Stanislav Malyshev a écrit : > >> But it's not incorrect. if is_file("abc\0") returns false, it's correct >> - "abc\0" is not a correct filename, so I expect it to return false. It >> does exactly what I

Re: [PHP-DEV] Re: PHP 8 is_file/is_dir input handling

2020-12-03 Thread Côme Chilliet
Le Tue, 1 Dec 2020 12:06:22 -0800, Stanislav Malyshev a écrit : > But it's not incorrect. if is_file("abc\0") returns false, it's correct > - "abc\0" is not a correct filename, so I expect it to return false. It > does exactly what I need, so it's correct. Hear hear. I think this is the best