Re: [PHP-DEV] Long-Term Planning for PHP 9.0 Error Promotion

2022-01-26 Thread Rowan Tommins
r than just marching onwards with errors. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [Strawpoll] Promoting redefining constant to exception

2022-01-25 Thread Rowan Tommins
ave the rest of the file alone. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: Weak Closures

2022-01-22 Thread Rowan Tommins
ather than waiting for the next pass. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-18 Thread Rowan Tommins
ure, but it at least reassures me that this isn't just control for control's sake. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-18 Thread Rowan Tommins
sers of this trait must implement the matching interface" as opposed to "... can implement the matching interface"? It's possible there is some advantage I'm missing, but so far nobody seems to have presented it. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-07 Thread Rowan Tommins
requires - Policing: the trait can force me as a programmer to use it in a certain way; this is the part I don't see the need for Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-07 Thread Rowan Tommins
count as getPropertyCount;     }     public function count(): int {     return 0;     } } It feels like this use case would work better with an annotation like /** @can-implement Countable */ since it is really just documentation about possible uses. Regards, -- Rowan Tommins [IMSoP] -- PHP

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Rowan Tommins
an the other, in your experience? Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Rowan Tommins
xplicitly talked about it being easier for the tools: > It should also make it easier for SCA tools to understand the code I understand that that's not *your* opinion, and mostly agree with what you've said, but you're answering a different question. Regards, -- Rowan Tommins [IMSoP] -- P

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Rowan Tommins
give any example scenarios that you think mandating an interface would help avoid? Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Rowan Tommins
at the mention of static analysis relates to that in some way, and I'm just completely missing the point. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-06 Thread Rowan Tommins
the trait, which nullify any promises the trait could make. * other than "Stringable", whose purpose and implementation continue to baffle me Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-06 Thread Rowan Tommins
and* on every use of array_keys, foreach, etc that *reads* array keys. Unless someone can present a fully working migration plan, this would get a "no" vote from me. Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] RFC: Trait expects interface

2022-01-05 Thread Rowan Tommins
for the trait to work correctly, not because of some perceived "correct" use of the trait. This doesn't seem to match your reasoning for proposing the syntax, so maybe I'm missing something? Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-03 Thread Rowan Tommins
and convert them all to strings, regardless of how they were originally specified. The result being an array where the values can all be safely passed to a function expecting strings, with strict_types=1 in force. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mail

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-03 Thread Rowan Tommins
On 3 January 2022 15:41:48 GMT, Chase Peeler wrote: >But "001" casted to 1 will then get casted back to "1" not "001". "001" would not be cast to an integer in this context: https://3v4l.org/gGFHJ Regards, -- Rowan Tommins [IMSoP] -- PHP Inter

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-02 Thread Rowan Tommins
aviour in the hope that it will fix more code than it breaks is just not worth it. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC: Stop to automatically cast numeric-string to int when using them as array-key

2022-01-01 Thread Rowan Tommins
to work around that inconvenience. [1] https://www.iana.org/assignments/http-fields/http-fields.xhtml [2] https://datatracker.ietf.org/doc/html/rfc3864#section-4.1 [3] https://httpd.apache.org/docs/trunk/env.html#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: Stop to automatically cast numeric-string to int when using them as array-key

2021-12-29 Thread Rowan Tommins
kept as 42 $intKeyedArray['42'] = true; // TypeError Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode?

2021-12-22 Thread Rowan Tommins
, and they are the most portable implementation. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode?

2021-12-22 Thread Rowan Tommins
it to a vote. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] What should we do with utf8_encode and utf8_decode?

2021-12-22 Thread Rowan Tommins
might be a good time to make this into an RFC. :) I have a draft kicking around with a lot of analysis of current usage. I will try to pick it back up after Christmas. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6)

2021-12-21 Thread Rowan Tommins
difference is that right now, you can only overload operators in an extension, not in userland code. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6)

2021-12-19 Thread Rowan Tommins
t, but not float / Money. I don't think this kind of type list would be unusual, but it may be a compromise we have to live with given PHP's type system. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6)

2021-12-15 Thread Rowan Tommins
be used by the query builder. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Allow default parameters before non-default ones?

2021-12-14 Thread Rowan Tommins
to see some evidence of that. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6)

2021-12-12 Thread Rowan Tommins
ionally means "contains" in PostgreSQL) but it would be rather awkward compared to "operator &>" or "#[Operator('&>')]". Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6)

2021-12-12 Thread Rowan Tommins
On 12/12/2021 18:29, Rowan Tommins wrote: Perhaps we could use an Attribute to bind the operator to the method, which would also reduce the impact on tools that need to parse class definitions: class Collection{ #[Operator('+')] public function union(Collection$other, OperandPosition

Re: [PHP-DEV] [RFC] User Defined Operator Overloads (v0.6)

2021-12-12 Thread Rowan Tommins
public function divideBy(Number $divisor) {} #[Operator('/', OperandPosition::RightSide)] publicfunction fractionOf(Number $dividend) {} } Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Allow default parameters before non-default ones?

2021-12-09 Thread Rowan Tommins
On 09/12/2021 21:07, Rowan Tommins wrote: For some reason, the CI build failed on that PR, but on unrelated files, so I'm not sure if it's my fault or not. Ah no, it was me. Build passing now. -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe

Re: [PHP-DEV] Allow default parameters before non-default ones?

2021-12-09 Thread Rowan Tommins
build failed on that PR, but on unrelated files, so I'm not sure if it's my fault or not. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Allow default parameters before non-default ones?

2021-12-09 Thread Rowan Tommins
a breaking change in a minor version. The only relevant discussion I've found is this, where Nikita is I think hinting at the new behaviour: https://externals.io/message/114007#114026 Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscrib

Re: [PHP-DEV] RFC [Discussion] array_column results grouping

2021-12-05 Thread Rowan Tommins
n userland, but also fairly _often_ done, so compacting it to a neat function call seems useful. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] PHP Foundation

2021-11-23 Thread Rowan Tommins
will fund, and who will step up to the challenge of driving the language ever onwards. Oh, and Happy Birthday! :) Cheers, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Sponsor link on github.com/php

2021-11-23 Thread Rowan Tommins
nk account there carries more implication of "ownership" than "here are places to pool resources if you want to support the project". Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] PHP 8 Release Announcement Page

2021-11-19 Thread Rowan Tommins
ying something like "If you're still on PHP 7.x, upgrading gets you all this as well!" with the headlines from the 8.0 page, and a link through. 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] Deprecate dynamic properties

2021-11-16 Thread Rowan Tommins
language say "OK, I've created your dynamic $loger property for you", which is what currently happens. 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] Deprecate dynamic properties

2021-11-16 Thread Rowan Tommins
d, un-analysed code. Those code bases are exactly the ones that benefit from the language having the run-time checks built in. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-11-16 Thread Rowan Tommins
circumstances as the E_DEPRECATED 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] Migrating to GitHub issues

2021-11-15 Thread Rowan Tommins
that developers will struggle to use anything other than the One True Website is frankly insulting to the intelligence of the average developer. 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] Deprecate dynamic properties

2021-11-15 Thread Rowan Tommins
ot sure what you mean by that. Do you mean, create the attribute, but don't actually do anything with it? Would the plan be to deprecate later? Never remove at all? 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] Deprecate dynamic properties

2021-11-15 Thread Rowan Tommins
On 15/11/2021 12:51, Andreas Heigl wrote: PS: Am I the only one missing whether this is a 2/3 or a 50%+1 vote in the RFC? All votes require a 2/3 majority as of https://wiki.php.net/rfc/abolish-narrow-margins -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] Finer control of diagnostics (deprecations, notices, and warnings)

2021-11-15 Thread Rowan Tommins
of the time, deprecation notices in third-party code are not useful to users: they are not responsible for fixing them in advance, and when actually switching major PHP version, they may have to switch to a different major release of the library before testing anyway. Regards, -- Rowan Tommins [IMSoP

[PHP-DEV] Finer control of diagnostics (deprecations, notices, and warnings)

2021-11-15 Thread Rowan Tommins
ndefinedVariable, 'r'); Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: Unwrap reference after foreach

2021-11-14 Thread Rowan Tommins
ar_dump($x); //null / undefined foreach ( $array as let &$x ) { // or " $x"?     $x++; } var_dump($x); //null / undefined, not a reference Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Deprecate dynamic properties

2021-11-14 Thread Rowan Tommins
d declares / project configuration / etc 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] Deprecate dynamic properties

2021-10-13 Thread Rowan Tommins
example, but I did at least test it worked. :) 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] Deprecate dynamic properties

2021-10-13 Thread Rowan Tommins
perties, even without the target class's co-operation. However, I think WeakMap (with a helper and a fallback like above) is probably a superior solution for that, because adding properties outside the class always carries risk of name collision, interaction with __get, etc Regards, -- Rowan T

Re: [PHP-DEV] Function list declaration syntax?

2021-10-10 Thread Rowan Tommins
many; so far though, nobody has managed to get enough consensus behind any alternative, as with Larry's RFC that you mentioned. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Change yield interpolation behaviour

2021-10-08 Thread Rowan Tommins
ts has indeed changed in PHP 8.0): https://externals.io/message/92239 * A brief thread about adding a more general interpolation syntax: https://externals.io/message/111519 Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Spam on bugs.php.net

2021-10-04 Thread Rowan Tommins
amples which came up last time we had this conversation: https://externals.io/message/114300#114320 Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

[PHP-DEV] Re: RFC Concept: "Import" of simplied string man ipulation and other instructions from ASP Classic

2021-09-25 Thread Rowan Tommins
mine I'm not saying I don't *like* these functions, I'm saying I genuinely don't know what they do. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

[PHP-DEV] Re: RFC Concept: "Import" of simplied string manipulation and other instructions from ASP Classic

2021-09-25 Thread Rowan Tommins
ed to PHP. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] RFC Concept: "Import" of simplied string manipulation and other instructions from ASP Classic

2021-09-25 Thread Rowan Tommins
remember that a lot of people reading this have never used Classic ASP, so don't know what these functions do. Some are easy to guess, but others less so, such as is_contraction(), is_givenName(), space(), and str_case_normalize() Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP

Re: [PHP-DEV] Allowing `(object)['key' => 'value']` in initializers?

2021-09-25 Thread Rowan Tommins
())` Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] BC breaking changes in PHP 8.1

2021-09-24 Thread Rowan Tommins
sagree with that default, but presumably some people think it is a sensible one. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] BC breaking changes in PHP 8.1

2021-09-23 Thread Rowan Tommins
what a "resource", they just know the boilerplate to use. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] BC breaking changes in PHP 8.1

2021-09-22 Thread Rowan Tommins
ses in this thread with ridiculous hyperbole like "shooting ourselves in the face". There is no perfect answer, and we should be able to have a rational discussion about the pros and cons of different strategies. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Develop

Re: [PHP-DEV] Adding `final class Deque` to PHP

2021-09-20 Thread Rowan Tommins
an "Iterator" suffix (leading to some quite awkward names) * Reflection classes all have a "Reflection" prefix * Having both "Queue" and "SplQueue", or both "Stack" and "SplStack" would be a terrible idea, and is a pretty strong argument *

Re: [PHP-DEV] Class static initialization block

2021-09-13 Thread Rowan Tommins
may not be the best point of reference for PHP, whose object system much more closely resembles Java or C#. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Class static initialization block

2021-09-12 Thread Rowan Tommins
tps://wiki.php.net/rfc/static_class_constructor Although it didn't go to a vote, the proposal was dropped for lack of support. There's some discussion summarised in that RFC, and you can probably find the rest by searching for its title on https://externals.io Regards, -- Rowan Tommins [IMSoP]

Re: [PHP-DEV] Alias stdClass to DynamicObject?

2021-09-08 Thread Rowan Tommins
tra properties after it's created, you could opt into that using whatever mechanism a named class would (parent class, trait, attribute, etc; see other thread). Similarly, the objects created by json_decode or PDO_FETCH_OBJECT only need the *initial* properties to be dynamic, not to allow pro

Re: [PHP-DEV] Alias stdClass to DynamicObject?

2021-09-08 Thread Rowan Tommins
dClass" to work, and new code will expect "instanceOf DynamicObject" to work, so an alias (in either direction) seems the better compromise. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Alias stdClass to DynamicObject?

2021-09-08 Thread Rowan Tommins
from outer scope when you create them. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Alias stdClass to DynamicObject?

2021-09-08 Thread Rowan Tommins
ing, or a database result row. The values aren't all of the same type, and you would never want to apply the same operation to all of them; you will probably initialise them once, and then access them by name, but don't have the facility to declare them up front. Regards, -- Rowan Tommin

[PHP-DEV] Re: Alias stdClass to DynamicObject?

2021-09-06 Thread Rowan Tommins
ix not too painful (including deprecation messages not being too annoying), it will pay off in the long run. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] timelib performance fix

2021-08-31 Thread Rowan Tommins
ave Derick to comment on the patch itself, since he's the primary maintainer of both the library in question and the PHP extension that embeds it. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Make namespace part of runtime

2021-08-27 Thread Rowan Tommins
hey're how a lot of PHP code is developed in practice - as modular libraries linked by Composer - and I think we could optimise the language for that use (e.g. applying more cross-file optimisations within a fully preloaded package). Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Rowan Tommins
kes where that intent isn't followed. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Alternatives for encapsulation when using composition instead of inheritance

2021-08-26 Thread Rowan Tommins
fferent class     echo $this->b; // allowed: access is to a "delegatable" property, in a "delegated" context     } } -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-25 Thread Rowan Tommins
no longer needed to support 8.1, "extends DynamicObject" could be added. For many code bases, that will be long before the feature is actually removed - for a private project, maybe as soon as it's on 8.2 in production. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime D

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-25 Thread Rowan Tommins
2;" is clearer than "$foo = new stdClass; $foo->bar = 42;" Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Deprecate dynamic properties

2021-08-25 Thread Rowan Tommins
an existing class isn't always possible, if it already inherits from something else. Perhaps the behaviour could also be available as a trait, which defined stub __get and __set methods, allowing for the replacement of the internal implementation as you've described? Regards, -- Rowan Tommins

Re: [PHP-DEV] Re: [RFC] Nullable intersection types

2021-08-11 Thread Rowan Tommins
ble intersections, and it was a trivial change, then I'd support it as a "quick win"; but that doesn't seem to be the case. 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] Nullable intersection types

2021-08-10 Thread Rowan Tommins
ng to here? Firstly, I'm guessing we're talking about return types here, since parameters have had types since 5.0, and nullable types since 5.1 with the "TypeName $foo = null" syntax? Secondly, do you mean you postponed your adoption of the feature, or was there some larger issue?

Re: [PHP-DEV] mb_check_encoding slow performance?

2021-08-09 Thread Rowan Tommins
encodings, and only needing to do a few operations on them. The main problem ext/mbstring has is that it supports a lot of operations, on a lot of different encodings, so it's still reusing a general purpose "convert and filter" algorithm. Regards, -- Rowan Tommins [IMSoP] -- PHP Int

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-08 Thread Rowan Tommins
where some of the operators are only meaningful for a subset of operands. Saying that a Money object is "Multipliable" would also be "a lie", since multiplying two Money objects together is a logic error, even though multiplying Money by a unit-less number is very useful.

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-08 Thread Rowan Tommins
is missing from this implementation. Since even a single operator interface can't guarantee that all inputs will have a valid output, I remain unconvinced that implementing 8 different interfaces for the above is any better than implementing one interface and stubbing the parts that have n

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-07 Thread Rowan Tommins
ymbol, rather than giving them names which only make sense in some contexts. [1] https://news-web.php.net/php.internals/108347 -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: [RFC] Add parse_query_string as an alternative to parse_str

2021-08-06 Thread Rowan Tommins
On the other hand, if core provides a sane implementation of the parsing into a generic "bag of key-value pairs" (which PHP calls an "array"), that would provide a very useful building block for any userland library to build on. Regards, -- Rowan Tommins [IMSoP] --

Re: [PHP-DEV] [RFC] Add parse_query_string as an alternative to parse_str

2021-08-06 Thread Rowan Tommins
't feel out of place. Having the function mirror http_build_query() as closely as possible seems like a good idea, e.g. http_parse_query('foo_0=a;foo_1=b', 'foo_', ';') should return [0=>'a', 1=>'b']. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing

Re: [PHP-DEV] RFC: autoconst

2021-08-01 Thread Rowan Tommins
ot familiar with the new enums, the best documentation at the moment is probably the RFC which proposed them: https://wiki.php.net/rfc/enumerations I'm really looking forward to using them :) Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To

Re: [PHP-DEV] RFC: autoconst

2021-08-01 Thread Rowan Tommins
s which can now be enums, and fix constants which are badly named, there won't be enough uses left for this new feature to justify its inclusion in the language. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: Fwd: Re[2]: [PHP-DEV] PHP 8.1 enum const expressions problem

2021-07-30 Thread Rowan Tommins
ongly typed code saying "this accepts a value of type ErrorGroup, and nothing else". Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: Fwd: Re[2]: [PHP-DEV] PHP 8.1 enum const expressions problem

2021-07-30 Thread Rowan Tommins
retain the type information, and can keep our values of 1 to 7 (or have no values at all) rather than having to use powers of 2. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

RE: [PHP-DEV] [RFC] Nullable intersection types

2021-07-27 Thread Rowan Tommins
. It's a "compatibility behavior" only in the sense that it wasn't immediately removed when the more flexible "?type" syntax was added in 7.1. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Nullable intersection types

2021-07-27 Thread Rowan Tommins
ggested that the current implementation of intersection types should be removed until this is resolved, and I can't think of any reason why that would make sense. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Request for karma to vote on RFCs

2021-07-20 Thread Rowan Tommins
of number of voters, like a parliament with two chambers. Obviously, this still leaves the question of how to gain a vote in either "chamber", but it avoids the difficulty of coming up with a definition that applies fairly to these very different groups of people. Regards, -- Row

Re: [PHP-DEV] [RFC] [VOTE] is_literal

2021-07-12 Thread Rowan Tommins
errors, and I can't think of any way that would be possible. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Deprecations for PHP 8.1

2021-07-08 Thread Rowan Tommins
years from now, we'll remove it without further notice". Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [Vote] New in initializers

2021-07-06 Thread Rowan Tommins
the argument is just a string: https://3v4l.org/bgNa2#v8.0.8 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] is_literal

2021-07-06 Thread Rowan Tommins
happened. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Deprecations for PHP 8.1

2021-07-06 Thread Rowan Tommins
drop it without further notice, but actually we might not, so no hurry to remove it", which I just think isn't that helpful. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-05 Thread Rowan Tommins
": if ( include('some_file.php') && bar() ) Is equivalent to this (will always run bar(), then attempt to include either (string)true or (string)false): if ( include ('some_file.php' && bar()) ) When what was intended was this: if ( (include 'some_file.php') &&a

Re: [PHP-DEV] [VOTE] Deprecations for PHP 8.1

2021-07-05 Thread Rowan Tommins
e can't provide that alternative, what use is there in notices discouraging it? Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [VOTE] Deprecations for PHP 8.1

2021-07-05 Thread Rowan Tommins
ternatives are, and why they're better * Improve the documentation of those alternatives with examples of the things that strftime() is commonly used for * Improve those alternatives themselves so that they're as easy to use as strftime() Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - P

Re: [PHP-DEV] [RFC] Alternative syntax for Nowdoc.

2021-06-30 Thread Rowan Tommins
ng enough to get bored halfway through). I think there is more cost than benefit. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Alternative syntax for Nowdoc.

2021-06-29 Thread Rowan Tommins
*more verbose* way of writing single quotes. Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Pipe Operator, take 2

2021-06-28 Thread Rowan Tommins
ausible. In practice, though, a lot of functions don't take only one parameter, so the previous pipe proposal included a placeholder for which argument you wanted to "pipe into". At which point you don't need to special case keywords, because you can just write this: $start |> str_len

Re: [PHP-DEV] [RFC] Pipe Operator, take 2

2021-06-28 Thread Rowan Tommins
syntax (strings and two-element arrays); you can tackle the complexity of unifying functions with constants, and methods with properties (as Levi explained in the other thread); or you can add a dedicated callable syntax, which the PFA proposal gets us with bells on. Regards, -- Rowan Tommins

<    1   2   3   4   5   6   7   8   9   10   >