Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-04-21 Thread Rowan Tommins
ckages on Packagist using https://github.com/nikic/popular-package-analysis - perhaps Juliette has already done that when testing their PHPCompatibility sniff? Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-21 Thread Rowan Tommins
g existing behaviour to accept null for non-nullable parameters (interestingly, until PHP 8.0, htmlspecialchars() could return null, e.g. if given an array). Unfortunately, that would be a different kind of compatibility break, so I'm not sure it fully solves the problem. Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-19 Thread Rowan Tommins
st this worth the backwards compatibility cost of changing the behaviour, and requiring extra code in other scenarios? Possibly not. But that's different from not having any benefit. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

[PHP-DEV] Re: [RFC] [VOTE] Deprecate and Remove utf8_encode and utf8_decode

2022-04-19 Thread Rowan Tommins
On 05/04/2022 19:45, Rowan Tommins wrote: Good evening all, I have opened voting on the RFC to Deprecate and Remove utf8_encode and utf8_decode: https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode I am pleased to announce that this RFC has been Accepted with 33 Yes votes and 2

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-16 Thread Rowan Tommins
$foo) $foo |> htmlspecialchars(...) Then this could be equivalent to ($foo === null ? null : htmlspecialchars($foo)) $foo ?|> htmlspecialchars(...) I'm not set against this RFC, but I'm not quite convinced by the case it makes, and think there may still be other options to explore. Regards, -

Re: [PHP-DEV] Discussion before submission of array_transpose() RFC

2022-04-24 Thread Rowan Tommins
he links about what features are likely to be most useful to people? I look forward to seeing a draft RFC, which can take the time to explain the features you think are needed. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Rowan Tommins
' === 0, but passing 'hello' to an int parameter is an error regardless of mode, as is 'hello' + 1 Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Rowan Tommins
3' being considered numeric - occasionally useful, but probably not worth the potential confusion of a special case. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-25 Thread Rowan Tommins
8.1 as soon as possible but only tackling the deprecations when time allows is absolutely the right thing to do. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-25 Thread Rowan Tommins
the value in the decision made back in 7.0 to exclude nulls by default. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Undefined Property Error Promotion

2022-04-25 Thread Rowan Tommins
being private when assigned a new value. Given that we have the magic "uninitialized" state, and we're proposing to make reading an unset property an error, it would make more sense for it to show as '["untyped":"Foo":private] => uninitialized(mixed)' Regards,

Re: [PHP-DEV] [VOTE] Undefined Property Error Promotion

2022-04-25 Thread Rowan Tommins
RFCs trying to fill in the gaps. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Stricter implicit boolean coercions

2022-04-26 Thread Rowan Tommins
where on this thread. On the one hand, they should probably match with at least some existing rules; on the other, it would be weird to introduce them then immediately deprecate some behaviour because we've decided to make the language stricter elsewhere. Regards, -- Rowan Tommins [IMSoP] --

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-26 Thread Rowan Tommins
is not a valid call. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [Discussion] Release cycle update

2023-11-10 Thread Rowan Tommins
e what's really needed is to draft a new copy of the policy document, updating or removing those parts that are no longer relevant, and adding a timeline for the pre-release phases? Or possibly there's a different document I should be looking at, and the RFC could contain proposed edits to that?

Re: [PHP-DEV] Passing null to parameter

2023-11-10 Thread Rowan Tommins
eclare() covers. Wherever it is used, "null" is a confusing and often controversial concept. In different contexts, it is used for different things, and has different ideal behaviours. It's a whole debate on its own, and bringing in other types of coercion just confuses the conversation. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: Passing null to parameter

2023-11-09 Thread Rowan Tommins
if the [imaginary] sql_escape function doesn't reject nulls, you may not notice the bug until you've ended up with garbage in your DB. Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] Re: NULL Coercion Consistency

2022-05-30 Thread Rowan Tommins
hould be done on output not input, but it's not completely infeasible that that combination might happen.) Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] The future of objects and operators

2022-05-13 Thread Rowan Tommins
o*$foo*$foo? I don't really have a conclusion here, I just wanted to throw it out there as a different mental model to consider. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: Removal of ${} string interpolation in PHP 9

2022-05-24 Thread Rowan Tommins
. But that's not really relevant because there are plenty of programming languages which have multiple quoting styles without using it, mostly by adding a prefix, e.g. Python's f"...".) Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: NULL Coercion Consistency

2022-05-24 Thread Rowan Tommins
rrently planned change, but I don't think loosening the existing type rules on user-defined functions is a good solution. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] NULL Coercion Consistency

2022-05-27 Thread Rowan Tommins
e, the benefits have been explained repeatedly in this thread. You may not agree that they are worth the cost, and as I've repeatedly said, I have some sympathy for that. But please stop trying to take the conversation back to the very beginning by implying that you've asked a question and not rec

Re: [PHP-DEV] Re: [RFC] [Under Discussion] PDO driver specific sub-classes

2022-06-24 Thread Rowan Tommins
he SQLite-specific functionality should all live in ext/pdo_sqlite. Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-24 Thread Rowan Tommins
t;future changes" which are being prevented. The only other change is a few renamed constants, which I suggested on the PR. I can see an argument for making them match the library exactly; but it's the *values* that actually matter, so I don't see why we shouldn't choose our own names if they

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-23 Thread Rowan Tommins
nd whether to emulate the older behaviour (or indeed emulate the newer behaviour on systems with an older library). Twenty years ago, maybe PHP programmers were used to it being a veneer over C. I don't think that is or should be the expectation today, unless you're using FFI. Regards, -- Row

Re: [PHP-DEV] [RFC][Vote] New Curl URL API

2022-07-05 Thread Rowan Tommins
in the wrong way, or the wrong circumstances, and actually making their code less secure. Because of all of the above, I have cast a No vote, because I would rather the right implementation was delayed until PHP 8.3 than the wrong implementation rushed into PHP 8.2. Regards, -- Rowan Tommins

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-27 Thread Rowan Tommins
gn of having mutable setters; as Derick pointed out, mutable value objects are generally a bad idea, so it would make sense to encourage users to think of this as a way to get one or more strings, rather than as a result in itself. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP

Re: [PHP-DEV] [RFC][Under discussion] Fetch properties in const expressions

2022-06-27 Thread Rowan Tommins
of strings, then it really has very little in common with how I think of (unbacked) enums, but maybe that's fine. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-27 Thread Rowan Tommins
y supposed to use CurlUrl when interfacing with curl, and generate the string myself for other purposes? If the implementation I come up with differs from curl's, how does the user know which is the "real" URL? Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Develo

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-07-01 Thread Rowan Tommins
d what correct usage looks like. Just providing a bunch of functions, in whatever form, doesn't provide security unless users can understand how to use them securely. Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] [RFC][Vote] Auto-capture closures

2022-07-02 Thread Rowan Tommins
offers neither opt-in nor opt-out, relying on the implementation to do the right thing automatically ... most of the time. To re-iterate, I am not opposed to the feature in principle, but would have loved to see a more open exploration of different syntax options. Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] Re: Character range syntax ".." for character masks

2022-07-09 Thread Rowan Tommins
igh those costs. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [VOTE] Constants in traits

2022-07-10 Thread Rowan Tommins
unlikely that this change will make people suddenly use traits in more "wrong" places, nor prevent any alternative horizontal reuse / composition aid features being added in future. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscr

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-27 Thread Rowan Tommins
tps://dbfiddle.uk/?rdbms=postgres_14=88639144aec58ab7cf7e34a0c103aa51 Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] [Under Discussion] New Curl URL API

2022-06-28 Thread Rowan Tommins
ake all this nuance clear to users, but that makes me a bit wary of adding the object to PHP in its current design. Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] [PHP8.2] Feature freeze in 2 weeks

2022-07-12 Thread Rowan Tommins
lly tagged "Waiting on Author", but I have no way to switch that back to "Waiting on Review" now that I've resolved the comments. Thanks, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-30 Thread Rowan Tommins
ging the value referenced by all 3 members // refcount on the resource drops from 1 to 0, triggering the destructor $fn(); // because it was captured by reference, the initial value of $some_resource in the closure has now changed Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Devel

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-30 Thread Rowan Tommins
, and "return" returns from the doSomething() function, not the transaction wrapper. The explanation of how Python's implementation works and why is an interesting read: https://peps.python.org/pep-0343/ Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-30 Thread Rowan Tommins
ssion closure would have any local variables. Indeed, that lack of local scope is one of the big reasons why I and others supported that RFC, because it avoids all the confusion evident in today's messages. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-30 Thread Rowan Tommins
. The fact that a variable of the same name, whose value is never actually used, is captured by the closure, is to me a bug, not a feature. It's hard to even contrive an example where this is observable, so I highly doubt anyone is relying on it. Regards, -- Rowan Tommins [IMSoP] -- PHP Inter

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Rowan Tommins
ugh. What if, rather than implementing __toString() as such, we implemented internal cast handlers for either string or int, depending on the backing value? (Other internal objects do have this ability, e.g. GMP and SimpleXMLElement) Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] [RFC] [Under Discussion] Auto-implement Stringable for string backed enums

2022-06-22 Thread Rowan Tommins
t of values, and a consuming app wanting to constrain that set within its own code. It's one disadvantage is the typo-proofing and look up availability that constants give, but you could always combine the two. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: [RFC][Under discussion] Create a global login system for php.net

2022-06-08 Thread Rowan Tommins
ote." Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-11 Thread Rowan Tommins
posed, users will need to have some idea of what "live variable analysis" means, or add dummy assignments, if they want to be sure a variable is actually local. With a block scoping keyword, they can mark local variables explicitly, as they would in other languages. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Discussion about new Curl URL API and ext/curl improvements

2022-06-17 Thread Rowan Tommins
hat are currently unnecessarily awkward. I don't think we'd need to add everything at once, just establish some general design principles. (I'm honestly surprised that CURLOPT_RETURNTRANSFER, and curl_setopt in general, doesn't make it onto more lists of the worst parts of PHP.) Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-12 Thread Rowan Tommins
($a)=>$b on its own would collide with array syntax. I would much rather see "fn" and "function" become synonyms, so that "public fn foo() {}" is a valid method declaration, and "function() => $foo" is a valid arrow function. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-12 Thread Rowan Tommins
ot;, and "function" as a rare "opt-out" or a "legacy version". 2) It does still create a separate scope, it just creates a *nested* scope, which combines two sets of variables, in a way that PHP currently never does. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-12 Thread Rowan Tommins
uot;global", or declaring them "static". It's entirely in keeping with how scope works in PHP. >It seems to me that you agree that there is a chance the proposed syntax is >going to be perceived as better and people will not want to use the old >syntax anymore and that makes you

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-14 Thread Rowan Tommins
often asking for new features. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-14 Thread Rowan Tommins
variable now have the new value var_dump($a, $b); -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-12 Thread Rowan Tommins
of captures; if that's really as rare as you suggest, it makes me wonder why we're even bothering. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Discussion about new Curl URL API and ext/curl improvements

2022-06-20 Thread Rowan Tommins
some comments on the PR. (By the way, the PR you linked is to merge into your own fork's master, not the actual central php-src repo. Not sure if that was deliberate.) Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https

Re: [PHP-DEV] [RFC] [Under Discussion] PDO driver specific sub-classes

2022-06-21 Thread Rowan Tommins
ent quoteIdentifier only on PDOPostgres; or implement it on PDO as throwing a "not implemented" exception, with PDOPostgres currently the only sub-class that over-rides it with a useful implementation. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Discussion about new Curl URL API and ext/curl improvements

2022-06-19 Thread Rowan Tommins
s something like CurlHandle::setRawOption for when users want fine control of the library, or some really obscure setting. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-13 Thread Rowan Tommins
by that value will be held until $filter is destructed, rather than when $guest is destructed Whether the risk of these side effects is a big problem is up for debate, but it's wrong to suggest they don't exist. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-13 Thread Rowan Tommins
want to ensure that their code is free of such side effects. Currently, the only way to do so is to understand the "implementation details" of which variables will be captured, and perhaps add dummy statements like "$foo = null;" or "unset($foo);" to make sure of

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-13 Thread Rowan Tommins
ut I don't think "fn" vs "function" is a strong enough clue. (Making fn and function synonyms sounds like it would have a lot more knock-on effects that feel very out of scope at present.) Off the top of my head, I can't think of any, but I admit I haven't tried hacking

Re: [PHP-DEV] [RFC] Short Closures 2, aka auto-capture take 3

2022-06-30 Thread Rowan Tommins
st pointer, to trigger the destructor unset($some_resource); // If $some_resource gets captured, it can only be released by destroying the closure unset($fn); Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-30 Thread Rowan Tommins
basis, and doesn't really answer the question of what the default behaviour should be - especially bearing in mind that any default should apply to both built-in and user-defined functions. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-05-01 Thread Rowan Tommins
on. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throw a deprecation notice ?

2022-05-02 Thread Rowan Tommins
ht pass "parent::foo", which will change behaviour in 9.0. It is the application's author who will benefit from the deprecation notice, so they can pass a different value whose behaviour isn't going to change. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Developme

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-04-28 Thread Rowan Tommins
have thought of some of the examples you showed in your earlier e-mail,  so I'm genuinely curious what other patterns it's used for. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: ***SPAM*** Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-04-29 Thread Rowan Tommins
used without actually looking at it. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] NULL Coercion Consistency

2022-05-03 Thread Rowan Tommins
a default value. Not receiving a field you expected feels very similar, so similar behaviour feels reasonable. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] NULL Coercion Consistency

2022-05-09 Thread Rowan Tommins
ility" with the version that raises the notice. (For my thoughts on the rest of what you're saying, see every other message I've sent to this thread.) Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] NULL Coercion Consistency

2022-05-09 Thread Rowan Tommins
than accepting their misinterpretation and repeating it on this list. Otherwise, we might as well just promote all deprecation notices to fatal errors immediately. I will open a new thread about this later. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throw a deprecation notice ?

2022-05-05 Thread Rowan Tommins
its own RFC to be voted on. It doesn't need to say much, just summarise the key points from this discussion. See https://wiki.php.net/rfc/howto for the steps, and feel free to send me a message off-list if you want a hand drafting or proof-reading it. Regards, -- Rowan Tommins [IMSoP] --

Re: [PHP-DEV] Defining objects as constants

2022-08-19 Thread Rowan Tommins
e FRIDAY; case SATURDAY; case SUNDAY; } define('SCHEDULED_DAY', DayOfWeek::TUESDAY); Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] What type of Exception to use for unserialize() failure?

2022-08-26 Thread Rowan Tommins
d-process in another. So, while it probably makes sense for all serialisation errors to consistently throw, that should be planned for 9.0, and everything that's not already an exception could raise a consistently formatted E_WARNING in 8.3. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals

Re: [PHP-DEV] Proposal for floored division and modulo functions

2022-08-21 Thread Rowan Tommins
; technique it gives "a meaningless result", but doesn't actually illustrate that result, so I'm struggling to picture exactly what each algorithm does. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC json_validate() - status: Under Discussion

2022-08-25 Thread Rowan Tommins
your point, but those three should probably be removed. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Proposal for floored division and modulo functions

2022-08-25 Thread Rowan Tommins
int $mode = PHP_DIV_TRUNCATE): int intmod(int $num1, int $num2, int $mode = PHP_DIV_TRUNCATE): int Where $mode can also be PHP_DIV_FLOOR, and possibly additional algorithms in future - the paper linked to on microsoft.com discusses another three, and implies that there are many more. Regards, -- Rowan Tomm

Re: [PHP-DEV] RFC json_validate() - status: Under Discussion

2022-08-25 Thread Rowan Tommins
s that like the Symfony example it is "pretty-printing" existing JSON strings. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Compact can't resolve outer scoped variables using short closures

2022-10-20 Thread Rowan Tommins
into: fn() => [ 'dummy' => $dummy ] which turns into: function() use($dummy) { return [ 'dummy' => $dummy ]; } Yes, that is what I meant by "it would be possible for the compiler to special-case this scenario"; I explained why I think that would be a bad idea, and suggested an

Re: [PHP-DEV] Microseconds to error log

2022-10-21 Thread Rowan Tommins
a user point of view I agree the feature would be useful. It would definitely need to be behind an ini setting, though, to avoid existing log parsers failing unexpectedly on the new format. Regards, Hi Mikhail, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailin

Re: [PHP-DEV] Microseconds to error log

2022-10-30 Thread Rowan Tommins
conds: on / off", not configurable as "enter date format". Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Compact can't resolve outer scoped variables using short closures

2022-10-20 Thread Rowan Tommins
uld be named to be meaningful in the current scope, not somewhere they're coming from or going to, but a dedicated syntax would at least allow that flexibility. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] One-line heredoc for better syntax highlightning

2022-09-19 Thread Rowan Tommins
On 19 September 2022 15:24:26 BST, "Olle Härstedt" wrote: >Hi internals! > >Some editors can guess the domain-specific language inside heredoc, e.g. if >you do > >$query = <