Re: [PHP-DEV] [RFC] [Discussion] #[\Deprecated] attribute again v1.3

2024-04-26 Thread Mike Schinkel
urther. Or at least that is how I see it. But then, I have no vote, so ¯\_(ツ)_/¯. -Mike

Re: [PHP-DEV] [RFC] [Discussion] #[\Deprecated] attribute again v1.3

2024-04-25 Thread Mike Schinkel
ding if code modifications are necessary before upgrading to a new version of PHP. -Mike

Re: [PHP-DEV] [RFC][Discussion] Why can constructors violate LSP?

2023-11-23 Thread Mike Schinkel
h this code has now been update for probably five years since I am no longer coding in PHP professionally): https://github.com/search?q=repo%3Awplib%2Fwplib%20make_new=code <https://github.com/search?q=repo:wplib/wplib%20make_new=code> And if you are dealing with 3rd party classes, you'll need to write wrapper classes. Hope this helps. -Mike

Re: [PHP-DEV] [RFC] [Discussion] Resource to object conversion

2023-11-21 Thread Mike Schinkel
HP by studying how Go is handling it and applying any lessons learned. #fwiw - Mike

Re: [PHP-DEV] RFC Proposal - static modifier for classes

2023-11-20 Thread Mike Schinkel
e outcomes, in which case, knock yourselves out. 路‍♂️ -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Basic Type Alias

2023-10-27 Thread Mike Schinkel
name); } if ( file_exists( $file ) ) { require_once $file; } } > So any type alias proposal would need to sort out the above "definition > problem" in a way that's generally acceptable. That's been the hold up for 3 > years, I think. The above is potentially one way to skin that cat. Anyway, I'm sure there will be lots of opinions on this, so bikeshed away. -Mike

Re: [PHP-DEV] RFC [Concept] - Interface Properties

2023-06-26 Thread Mike Schinkel
properties to get or set? Ignoring special cases, that is. Of course if the RFC for "Interface Default Methods" fails to pass then this point is moot. -Mike > On May 28, 2023, at 1:51 PM, Erick de Azevedo Lima > wrote: > > As others have said: the interface/contr

Re: [PHP-DEV] PHP Package for PHP

2023-05-19 Thread Mike Schinkel
people might want to look into in the near future. Again, the value IMO for having a PHP core standard library is not necessarily about being able to add functionality, but to add code that can enable code from multiple developers to work independently yet inter-operably with new or existing functi

Re: [PHP-DEV] PHP Package for PHP

2023-05-18 Thread Mike Schinkel
and thus a way to expand those who can actually contribute to core), and a starting place for anything that could be written in PHP to be written in PHP so as not to require updating and testing C code seems to have many benefits. #jmtcw -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] 'Uninitialized' creates a lot of cluttering

2023-02-13 Thread Mike Schinkel
ress your concerns. This workaround uses a base `AutoInit` class with a constructor that uses reflection to inspect the properties and if they are uninitialized and without a default get their type and then initialize them to an appropriate "zero" value. Yes it uses reflection which

Re: [PHP-DEV] Re: [RFC] Unicode Text Processing

2022-12-17 Thread Mike Schinkel
> method, not SubString() With kind regards / Mit freundlichen Grüßen / S > přátelským pozdravem, Michael Voříšek > > To add support for this request, it seems “substring” is a complete word in English, so no need for camel-case: https://www.thefreedictionary.com/substring -Mike > > > > > > > > > > > > > > > >

Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-17 Thread Mike Schinkel
I agree that we have not and should not treat error message > strings as part of the API guarantee. If anything, maybe that will help > incentivize people to stop writing bad (unparsable) exceptions. I am curious what you would envision a better, "parsable" exception from ssca

Re: [PHP-DEV] Experimental features

2022-10-11 Thread Mike Schinkel
al would be to see if the proposed signature was sufficient for mainstream needs. Oh, and a higher memory limit is not always a viable solution. > And unless you want to ship experimental code to production (which you > shouldn't) you will have to wait for the next major PHP release any

Re: [PHP-DEV] Experimental features

2022-10-10 Thread Mike Schinkel
hen experimental features are turned on, and without having to include said code. The benefit there would be people could more quickly implement an experimental feature to see how it might work in the wild before going to all the effort to implement in C in PHP's core code, for things

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-11 Thread Mike Schinkel
ala/fp-book/benefits-of-functional-programming/ <https://alvinalexander.com/scala/fp-book/benefits-of-functional-programming/> Hope this helps. -Mike P.S. Also, the Internals list's very own Larry Garfield is a huge advocate for FP in PHP, voilà: https://leanpub.com/thinking-functiona

Re: [PHP-DEV] [RFC] Asymmetric visibility

2022-08-07 Thread Mike Schinkel
d propose instead we consider the following are these instead would be asking the *ability* to "Set" the Property is "Protected" or "Private" where The Property is again what the prefix verb "is" is acting on: isSetProtected() isSetPrivate() isGetProtected(), and isGetPrivate() #jmtcw -Mike -- 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 Mike Schinkel
he implementation and still retain backward compatibility? - I pose these questions in hopes to discern among Internals if Traits are actually the problem or if instead Traits could be improved to solve the concerns states in this tread, which might require some longer-term deprecation

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

2022-06-14 Thread Mike Schinkel
but I don't think "fn" vs "function" is > a strong enough clue. "Strong enough" is an opinion, and it seems all who have commented have differing ones of those. But maybe a memory device would help address (some of?) your concerns: - fn() — It is SHORT and implicit.

[PHP-DEV] Constraints vs. values as types?

2022-04-16 Thread Mike Schinkel
atible with false as a type, and even true with a type. FWIW I am just offering up an approach that seems to have worked well in Go for consideration. If you like it, please discuss it. If not, it was worth a try. -Mike P.S. I am sure there are many ways to improve what I proposed. Note this is *just* a straw man proposal; please offer suggestions for improvement.

Re: [PHP-DEV] [RFC][Under discussion] Deprecate ${} string interpolation

2022-03-14 Thread Mike Schinkel
> On Mar 14, 2022, at 3:20 PM, Lynn wrote: > > On Mon, Mar 14, 2022 at 8:04 PM Mike Schinkel <mailto:m...@newclarity.net>> wrote: > > Variable variables provide functionality[1] that if removed would force major > rewrites of PHP applications that were archit

Re: [PHP-DEV] [RFC][Under discussion] Deprecate ${} string interpolation

2022-03-14 Thread Mike Schinkel
should at least add a function that would allow getting the variables value by name. Something like `get_variable_value_by_name($name)` but hopefully with a less verbose name than I used in my example just now. #jmtcw -Mike [1] https://stackoverflow.com/questions/16339658/php-variable-value-from-str

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

2022-01-17 Thread Mike Schinkel
ange to me you cannot see the benefit of traits that would constrain their uses to requiring an interface. If it were possible to specify that a trait required an interface then I don't envision anyone other than those who need bespoke traits would do so, and those are not likely traits you would want to

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

2021-10-09 Thread Mike Schinkel
> On Oct 5, 2021, at 3:18 PM, Dan Ackroyd wrote: > > On Tue, 5 Oct 2021 at 18:47, Mike Schinkel wrote: > >> Consider the `Type` class[3] in the `SebastianBergmann\Type` namespace. It >> contains 60 lines of function declaration to define 14 functions that all >

[PHP-DEV] Function list declaration syntax?

2021-10-05 Thread Mike Schinkel
o you think? Is this approach any more appealing than the last one proposed? -Mike [1] https://wiki.php.net/rfc/short-functions [2] https://github.com/sebastianbergmann/type [3] https://github.com/sebastianbergmann/type/blob/master/src/type/Type.php [4] https://gist.github.com/mikeschinkel/6

Re: [PHP-DEV] [RFC] Allow null as standalone type

2021-10-05 Thread Mike Schinkel
Obviously it doesn't make sense for a developer to write that, but I could see that a code generator would have add special-case logic to avoid outputting `?` with the type `null`. Does it hurt anything if it is allowed? -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsu

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

2021-09-25 Thread Mike Schinkel
get away from  Point of order here: "we" is not unanimous. -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

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

2021-09-21 Thread Mike Schinkel
> On Sep 21, 2021, at 1:12 PM, Pierre Joye wrote: > On Tue, Sep 21, 2021, 11:56 PM Mike Schinkel <mailto:m...@newclarity.net>> wrote: > > On Sep 21, 2021, at 3:45 AM, Pierre Joye > <mailto:pierre@gmail.com>> wrote: > > > > On Tue, Sep 21

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-21 Thread Mike Schinkel
> On Sep 19, 2021, at 8:55 AM, tyson andre wrote: > > Hi Mike Schinkel, >> >> Hmm. I must have missed that thread as I was definitely following the list >> at that time. >> >> But I found the thread, which only had three (3) comments from others: >

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

2021-09-21 Thread Mike Schinkel
> On Sep 21, 2021, at 3:45 AM, Pierre Joye wrote: > > On Tue, Sep 21, 2021 at 11:21 AM Mike Schinkel wrote: > >> Honestly, at first I confused `Deque` with `Dequeue` and was wondering why >> we would name a class with a verb? It wasn't until Rowan's comment th

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

2021-09-20 Thread Mike Schinkel
any other PHP developers will know computer science terms like this well enough to know `Deque` is a noun when they see it, and more importantly how many PHP developers will think to search for `Deque` when they need a queue? So here is a straw man argument; name the class one of: - DataStru

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-18 Thread Mike Schinkel
Hi Tyson, Thanks for the reply. > On Sep 18, 2021, at 7:26 PM, tyson andre wrote: > > Hi Mike Schinkel, > >> Given there seems to be a lot of concern about the approach the RFC proposes >> would it not address the concerns about memory usage and performance if >&

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-18 Thread Mike Schinkel
PI around them is procedural, inconsistent, and overall gross > 7. They lack a lot of native shorthand operations found in other languages > (eg, slicing) > 8. Their error handling is crap Would you mind elaborating on points #3 and #8? It is not clear to me what you are getting at with

Re: [PHP-DEV] RFC: Add `final class Vector` to PHP

2021-09-17 Thread Mike Schinkel
[new_capacity]) — Reduces memory allocated. Sets Capacity to current Size or new_capacity. === If you had these methods then I think you would get the memory and performance improvements you want, and if you really want a final Vector class for your own uses you could roll your own using

Re: [PHP-DEV] Class static initialization block

2021-09-13 Thread Mike Schinkel
ssed in order. But JS classes are > weird creations, implemented as a complex sugar on top of a classless object > system, so may not be the best point of reference for PHP, whose object > system much more closely resembles Java or C#. I did not reference JS — I only referenced Ja

Re: [PHP-DEV] Class static initialization block

2021-09-13 Thread Mike Schinkel
they should always be loaded immediately whenever the file is loaded. That makes that argument about debugging cause-and-effect becomes a moot point. And lazy evaluation should be considered as a separate feature. I blogged about that a while back but never brought to the list: https://mikeschin

Re: [PHP-DEV] [RFC] $this return type

2021-09-09 Thread Mike Schinkel
ying code is actually doing a > "return $this" rather > than returning any other valid "self" instance (such as "return new > self();")? So a *mutable* fluent style vs. an *immutable* fluent style? -Mike -- 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 Mike Schinkel
arly, the objects created by json_decode or PDO_FETCH_OBJECT only need > the *initial* properties to be dynamic, not to allow properties to be added > later. How do you define "initial?" -Mike -- 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 Mike Schinkel
ussion about what would be more proper. > The one thing missing from anonymous classes right now is an elegant way to > capture data from outer scope when you create them. I'm not exactly sure what that means, but if I had to guess I think maybe you are talking about a literally initializ

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

2021-09-08 Thread Mike Schinkel
ll suboptimal besides just the class name? (I can think of a few, but want to hear from others before I explain mine.) -Mike

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

2021-08-28 Thread Mike Schinkel
t;> "Symfony\Component\Messenger" package. > > What's the estimated effort for adding package support to PHP? Did > anyone outline a possible implementation? In case you have not seen these, which discuss possibilities but at a higher level than actually how to implement: https://github.com/nikic/php-rfcs/blob/language-evolution/rfcs/-language-evolution.md <https://github.com/nikic/php-rfcs/blob/language-evolution/rfcs/-language-evolution.md> https://phpinternals.news/45 <https://phpinternals.news/45> -Mike

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

2021-08-27 Thread Mike Schinkel
\Messenger" > package. +100 > 'm personally quite keen on the idea of packages, because they'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). Yes, agree. -Mike -- 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-26 Thread Mike Schinkel
ikeschinkel/5b433532dc54adf53f5b239c8086fd63 Each approach has its own pros and cons but it probably depends on which would be easier and more performant to implement. -Mike -- 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 Mike Schinkel
erms of being able to upgrade the trait to better internal approaches as I evolve the trait. Would trait-private address any part of what you need? Or would other trait-specific visibility address what you need? And if not, what about traits makes them not-applicable here? Maybe we could al

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

2021-08-26 Thread Mike Schinkel
> On Aug 26, 2021, at 4:04 AM, Reindl Harald (privat) wrote: > Am 26.08.21 um 09:24 schrieb Mike Schinkel: >> https://3v4l.org/HAkhjW#v8.0.9 >> Total execution time for 5000 iterations for BadActor = 0.351906 milliseconds >> Total execution time for 5000 iterations

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

2021-08-26 Thread Mike Schinkel
> On Aug 26, 2021, at 2:27 AM, Reindl Harald (privat) wrote: > Am 26.08.21 um 00:59 schrieb Mike Schinkel: >>> On Aug 25, 2021, at 6:41 PM, Reindl Harald (privat) >>> wrote: >>> Am 26.08.21 um 00:37 schrieb Mike Schinkel: >>>> That said, I'd be reall

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

2021-08-25 Thread Mike Schinkel
> On Aug 25, 2021, at 6:41 PM, Reindl Harald (privat) wrote: > Am 26.08.21 um 00:37 schrieb Mike Schinkel: >> That said, I'd be really interested in seeing use-cases where having dynamic >> properties is essential to an architecture and where it could not be easily >&g

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

2021-08-25 Thread Mike Schinkel
s global hook to be called every time ANY object has a property dynamically accessed or assigned — conceptually like how spl_autoload_register() works — so that developers could run their programs to see what properties are used. The hook could collect class names, property names and data types to help deve

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-15 Thread Mike Schinkel
se an interface as a signal to provide language specific behavior to a class rather than to enforce polymorphic behavior. So rather than double down on features based on leaky abstractions better to backtrack and correct the original sin IMO. -Mike

Re: [PHP-DEV] [RFC] Never For Argument Types

2021-08-14 Thread Mike Schinkel
f guarantee where abstract interfaces would not be required to maintain such a guarantee. #jmtcw Thoughts? -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-11 Thread Mike Schinkel
, which currently would mean only classes where all public and protected properties are read-only[3]. 4. And even if we do #3 that is no reason for us not to consider also doing (at least some of) #2. #fwiw -Mike [1] https://www.nist.gov/pml/weights-and-measures/metric-si/si-units <

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-11 Thread Mike Schinkel
why I chose it as the example, and that perhaps illustrates > why I am willing to explore such objects but do not believe they are the > best choice at this time. So I promised to explain how to simplify the logic. This has nothing to do with operator overloads so anyone reading who is only

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-10 Thread Mike Schinkel
f PHP can identify a value object then it could limit operator overloads to just classes that are value objects by whatever approach PHP chooses to distinguish. -Mike [*] Ironically I mentioned you because I thought you would be appreciate seeing another reason PHP could benefit from value objects. B

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-10 Thread Mike Schinkel
d to PHP such that your library was no longer needed. Would you be fine with that, or do would you prefer that features added to PHP made your library more attractive as opposed to no longer needed? I'm not suggesting anything untoward — it would be perfectly reasonable IMO for you wanting fea

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-09 Thread Mike Schinkel
On Aug 9, 2021, at 5:32 PM, Mike Schinkel wrote: > On Aug 9, 2021, at 1:48 PM, Jordan LeDoux wrote: > You claim that this would be documented on php.net and this would be > sufficient. Yet the DateTime class has had operator overloads for comparison > operators since 5.2 and th

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-09 Thread Mike Schinkel
e, we'd have numerous classes in PHP supporting operators. At that people we could have the confidence needed to decide it and how to implement general-purpose operator overloading. But one thing is certain. While we can go from special one-off classes that support operator overloading to

Re: [PHP-DEV] Revisiting Userland Operator Overloads

2021-08-07 Thread Mike Schinkel
erfaces added to PHP should either be individual, or an aggregate of other interfaces. If ArrayAccess where simply the aggregate of these interfaces PHP developers would be in a better position: interface OffsetExists {...} interface OffsetGettable {...} interface OffsetSettable {...} in

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

2021-08-06 Thread Mike Schinkel
build_query() I would rather see http_parse_query(). +1. http_parse_query() is even better. -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

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

2021-08-06 Thread Mike Schinkel
portunity > to fix some long shortcomings around parse_str. Also, +1 to this. -Mike P.S. WordPress has a parse_query() *method* on their WP_Query() class, but as someone who has worked with WordPress for 10+ years even I don't see these two in conflict. One is a method scoped to th

[PHP-DEV] Implicit Interfaces? (was [PHP-DEV] [RFC] Nullable intersection types)

2021-07-28 Thread Mike Schinkel
roposing either annotation tells PHP that instead of looking to see if $obj explicitly implemented AdderInterface it could instead look to see if its methods match the methods specified in the interface. And given the smaller nature of implicit interfaces, that should be a rather small check. I'v

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

2021-07-24 Thread Mike Schinkel
some actual examples instead of just repeating assertions that this is needed and if you don't get it you believe it will make your life more difficult as a library maintainer. There are tens of things that make my life difficult every day I program in PHP, but this list doesn't care about my own or any of our difficulties, it cares about real-world use-cases that would provide reason why a feature needs to be added to PHP. -Mike P.S. Also, what Deleu said.

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

2021-07-23 Thread Mike Schinkel
It claims that there were real-world examples, but did not show any. That message was also not part of the RFC. Listen, I am trying to help make the RFC better to improve its chance of passing. If you don't want that, then I will just demure. -Mike > > —— > > When readin

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

2021-07-23 Thread Mike Schinkel
al-world example use-cases where the author and proponents would actually like to use nullable intersection types in their future PHP code. #jmtcw -Mike

Re: [PHP-DEV] Problems with the mailing list [was: Re: [PHP-DEV] Request for karma to vote on RFCs]

2021-07-23 Thread Mike Schinkel
so I could look into the continued problem and communicate about it on the webmaster list for you? Thank you in advance. -Mike [1] https://github.com/php/web-php/pull/426 [2] https://www.php.net/mailing-lists.php

Re: [PHP-DEV] Problems with the mailing list [was: Re: [PHP-DEV] Request for karma to vote on RFCs]

2021-07-22 Thread Mike Schinkel
ould greatly appreciate it. I could work on this as I recently got web-php set up and working locally to be able to submit some PRs. But I assume the [PHP-DEV] list is probably not the best list to discuss this. Can someone please recommend which list this would be best discussed on? -Mike -- 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-21 Thread Mike Schinkel
d be in the category of Core Contributors who would get a veto they currently do not have on core-related concerns, but who would also potentially see their vote on opinion-based RFCs diluted. -Mike

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

2021-07-20 Thread Mike Schinkel
> On Jul 20, 2021, at 8:55 AM, Andreas Heigl wrote: > > Hey Mike > > Thank you for your feedback! > > Am 20.07.21 um 11:57 schrieb Mike Schinkel: >> Quoting the RFC >> >>> the requester has contributed to the PHP sourcecode ecosystem. >>

Re: [PHP-DEV] License for PHP 8.x?

2021-07-20 Thread Mike Schinkel
> On Jul 20, 2021, at 6:16 AM, Nikita Popov wrote: > > On Tue, Jul 20, 2021 at 12:01 PM Mike Schinkel <mailto:m...@newclarity.net>> wrote: >> On Jul 19, 2021, at 3:31 AM, Nikita Popov > <mailto:nikita@gmail.com>> wrote: >> >> On Mon, J

Re: [PHP-DEV] License for PHP 8.x?

2021-07-20 Thread Mike Schinkel
> On Jul 19, 2021, at 3:31 AM, Nikita Popov wrote: > > On Mon, Jul 19, 2021 at 5:56 AM Mike Schinkel <mailto:m...@newclarity.net>> wrote: > I was just checking to see what the license was for PHP and this page[1] > states: > > "PHP 4, PHP 5 and

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

2021-07-20 Thread Mike Schinkel
an extremely subjective process. (Which might be all you are attempting to do?) Anyway, #jmtcw. -Mike > On Jul 20, 2021, at 2:22 AM, Andreas Heigl wrote: > > Hey All > > Am 19.07.21 um 17:02 schrieb Andreas Heigl: >> Hey All >> >> Am 19.07.21 um 16:34 schrieb

[PHP-DEV] License for PHP 8.x?

2021-07-18 Thread Mike Schinkel
on PHP.net <http://php.net/> has just not yet been updated to reflect the existence of PHP 8? -Mike P.S. Relatedly, if someone wants to publish code in a GitHub repo with intent to try to have it included in PHP what license should be used? Would BSD-3 be appropriate? [1] https://www

Re: [PHP-DEV] Readonly properties - immutability by default

2021-07-17 Thread Mike Schinkel
was explicitly envisioned[2] that some small number of attributes might potentially be more than just metadata. -Mike [1] https://platform.sh/blog/2020/php-8-0-feature-focus-attributes/ <https://platform.sh/blog/2020/php-8-0-feature-focus-attributes/> [2] https://wiki.php.net/rfc/attributes_v2#future_scope <https://wiki.php.net/rfc/attributes_v2#future_scope>

Re: [PHP-DEV] Readonly properties - immutability by default

2021-07-16 Thread Mike Schinkel
``` Having a "readonly" class where the properties are read-only by default makes sense to me, but maybe the better way to do it is with an attribute? #[Readonly] class Entity { public int $count; public string $data; } OTOH, that would be inconsistent with using `readonly`

Re: [PHP-DEV] Type casting syntax

2021-07-12 Thread Mike Schinkel
> On Jul 12, 2021, at 4:28 PM, Lynn wrote: > On Mon, Jul 12, 2021 at 10:20 PM Mike Schinkel <mailto:m...@newclarity.net>> wrote: > It seems you have just illustrated why in reality we really do not need type > casting/assertions in PHP given its current features, because we

Re: [PHP-DEV] Type casting syntax

2021-07-12 Thread Mike Schinkel
> On Jul 12, 2021, at 1:56 PM, Max Semenik wrote: > > On Mon, Jul 12, 2021 at 8:01 PM Mike Schinkel <mailto:m...@newclarity.net>> wrote: > Additionally in Go a type assertion can return a second value which is > boolean telling if the type assertion succeeded

Re: [PHP-DEV] Type casting syntax

2021-07-12 Thread Mike Schinkel
); Additionally in Go a type assertion can return a second value which is boolean telling if the type assertion succeeded. Not having this would effectively moot the benefit to a type assertion if you had to wrap with try{}catch{} in case it failed. $service, $okay = $diContainer->get('email.service')::(EmailService); if (!$ok) { echo 'Not an EmailService.'; } #fwiw -Mike

Re: [PHP-DEV] Type casting syntax

2021-07-11 Thread Mike Schinkel
someone suggests adding siblings > to __toString(), there's major pushback. Look ma, no magic methods! :-) -Mike

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

2021-07-08 Thread Mike Schinkel
100 years from now, we'll > remove it without further notice". That is a policy I can concur with. _Definitely_ better than what was stated earlier in the thread. Does anyone else disagree? If no, could this get memorialized on the wiki somewhere to reference in future discussions, if n

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

2021-07-07 Thread Mike Schinkel
d when appropriate and by vote, and not any hard-and-fast "IF deprecated THEN must be removed soon." Please note that I am fully respecting the ballot and voting outcomes here; if people always vote to remove a deprecated feature in next major version that so be it. But RFC authors should be allowed to propose a long time horizon for removal without being told they "are doing it wrong." -Mike -- 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 Mike Schinkel
Replying in one long email to all three who replied to me: > On Jul 5, 2021, at 8:03 AM, Guilliam Xavier wrote: > Hi Mike, > > Your links speak *in general*. However this is *specifically for PHP*: > https://www.php.net/manual/en/errorfunc.constants.php#errorfunc.constant

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

2021-07-05 Thread Mike Schinkel
;deprecated" features if their removal would cause significant BC breakage, I'm not just trying to be a pendant. -Mike [1] https://whatis.techtarget.com/definition/deprecated [2] https://stackoverflow.com/questions/8111774/deprecated-meaning -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

2021-07-01 Thread Mike Schinkel
string):bool IntStrFunc; function bar (intStrFunc $callback) {...} I think a few have mentioned user-defined types in the recent past but I am not aware of it being a current RFC for it. -Mike

Re: [PHP-DEV] [RFC] Readonly properties

2021-06-30 Thread Mike Schinkel
ions to readonly properties while in that context and anything that it calls: $clone_obj = clone $obj fn() => { $this->foo = 'new value'; } Would this not be a viable solution for cloning, for this RFC, or the only you work on if this one fails to pass? -Mike

Re: [PHP-DEV] is_literal() is back

2021-06-26 Thread Mike Schinkel
xcept to use a technique that your RFC describes as "clearly the developer doing something wrong." -Mike [1] https://github.com/nilportugues/php-sql-query-builder > On Sat, 26 Jun 2021 at 2:51 pm, Mike Schinkel <mailto:m...@newclarity.net>> wrote: > The idea behind is_li

Re: [PHP-DEV] is_literal() is back

2021-06-26 Thread Mike Schinkel
nction in the mean time it would be available, but not yet standardized into PHP. Thank you in advance for your consideration. -Mike [1] https://3v4l.org/oCBp7#focus=rfc.literals <https://3v4l.org/oCBp7#focus=rfc.literals> [2] https://gist.github.com/mikeschinkel/b9abd4178db461568b81

Re: [PHP-DEV] Introduce str_left/right In 8.1

2021-06-24 Thread Mike Schinkel
18/creating-substrings-in-f/ <https://dotnetcodr.com/2017/02/18/creating-substrings-in-f/> - D: https://stackoverflow.com/a/20570677/102699 <https://stackoverflow.com/a/20570677/102699> - Mathematica: https://reference.wolfram.com/language/ref/StringTake.html <https://reference.wolfram.com/language/ref/StringTake.html> -Mike

Re: [PHP-DEV] [RFC] Name issue - is_literal/is_trusted

2021-06-24 Thread Mike Schinkel
is a lot of existing code and >> tutorials that use: >> >> $sql = 'WHERE id IN (' . implode(',', array_map('intval', $ids)) . ')'; >> >> $sql = sprintf('SELECT * FROM table WHERE id = %d;', intval($id)); >> And WordPress (and I am sure a lot of other legacy

Re: [PHP-DEV] [RFC] clamp

2021-06-24 Thread Mike Schinkel
hat's for the best ! > > Moreover, it also ensures that all developers speak the same language > regarding primitives provided by the standard library, and makes > communication more efficient within community. This. All of this. -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Introduce str_left/right In 8.1

2021-06-23 Thread Mike Schinkel
ance required for simple functions like this? What is likely to change in the future that would require maintenance? And would you mind giving a few or at least one example of a trivial function that did need to be maintained after it was written? Thank you in advance for taking the time and effort to answer. -Mike

[PHP-DEV] Add mysqi_stmt->query? (Was Sql Object Model Parser & Sanitizer)

2021-06-22 Thread Mike Schinkel
uggest we bring the original point of this thread to a close. I will just have to implement a proof-of-concept so that what I have been proposing will not be so hard to misunderstand. -Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Sql Object Model Parser & Sanitizer (was [RFC] is_literal)

2021-06-22 Thread Mike Schinkel
> On Jun 22, 2021, at 11:41 AM, Larry Garfield wrote: > > On Tue, Jun 22, 2021, at 8:39 AM, Mike Schinkel wrote: >>> On Jun 22, 2021, at 9:00 AM, Kamil Tekiela wrote: >>> >>> Hi Mike, >>> >>> Please don't do this. We already have PDO

Re: [PHP-DEV] Sql Object Model Parser & Sanitizer (was [RFC] is_literal)

2021-06-22 Thread Mike Schinkel
> On Jun 22, 2021, at 11:56 AM, Pierre wrote: > > Le 22/06/2021 à 17:35, Mike Schinkel a écrit : >> https://github.com/WordPress/WordPress/blob/master/wp-includes/wp-db.php#L2050 > Sorry for the discussion pollution here but, but ouch, plugins are still > using this unsaf

Re: [PHP-DEV] Sql Object Model Parser & Sanitizer (was [RFC] is_literal)

2021-06-22 Thread Mike Schinkel
> On Jun 22, 2021, at 10:35 AM, Stephen Reay wrote: > >> On 22 Jun 2021, at 20:39, Mike Schinkel wrote: >> >>> On Jun 22, 2021, at 9:00 AM, Kamil Tekiela wrote: >>> >>> Hi Mike, >>> >>> Please don't do this. We already

Re: [PHP-DEV] Sql Object Model Parser & Sanitizer (was [RFC] is_literal)

2021-06-22 Thread Mike Schinkel
> On Jun 22, 2021, at 9:00 AM, Kamil Tekiela wrote: > > Hi Mike, > > Please don't do this. We already have PDO with prepared statements. The data > must be bound. This is the secure way of writing SQL queries. The problem is that over 40% of the web currently runs on P

[PHP-DEV] Sql Object Model Parser & Sanitizer (was [RFC] is_literal)

2021-06-22 Thread Mike Schinkel
> On Jun 22, 2021, at 6:45 AM, Pierre wrote: > > Le 22/06/2021 à 11:28, Dan Ackroyd a écrit : >> On Tue, 22 Jun 2021 at 10:25, Mike Schinkel wrote: >>> Should(n't?) PHP add a basic SQL builder class that can be extended for >>> special cas

Re: [PHP-DEV] [RFC] is_literal

2021-06-22 Thread Mike Schinkel
> On Jun 22, 2021, at 5:28 AM, Dan Ackroyd wrote: > > On Tue, 22 Jun 2021 at 10:25, Mike Schinkel wrote: >> >> Should(n't?) PHP add a basic SQL builder class that can be extended for >> special cases, e.g. different flavors of SQL? >> > > No. Or at

Re: [PHP-DEV] [RFC] is_literal

2021-06-22 Thread Mike Schinkel
most basic PHP install, 3. To allow implementing a performant SQL parser (which is not reasonably done in PHP), 4. To make creating a target for polyfills for prior versions possible, 5. And to create a standard that all PHP projects that use SQL can adopt? -Mike P.S. PHP could also implement a sanit

Re: [PHP-DEV] [RFC] is_trusted - was is_literal

2021-06-22 Thread Mike Schinkel
with a method attribute. Maybe PHP should too? In summary, is_literal() is a hammer and people will us it to treat everything like a nail. At least is_trusted() has the future potential to be treated like a screwdriver. -Mike P.S. If I had my druthers is_trusted() would not pass e

Re: [PHP-DEV] [PROPOSAL] Bare name array literals (again)

2021-06-22 Thread Mike Schinkel
t sure I will support this change to arrays proposed by Tyson. I might, but I would like to understand Tyson's use-cases first where he would prefer to need an array instead of an object if objects instantiation were made easier, and more importantly, why could objects not be used? -Mike

Re: [PHP-DEV] [Vote] Partial Function Application

2021-06-19 Thread Mike Schinkel
we don't add both these features to keep the language > smaller in this aspect of how functions are called. For the record, my gut tells me beginners will not grok the proposed pipe operator as easily as I think they will partial functions. But who actually knows for sure how newbies will comprehend pipes? -Mike > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] is_literal

2021-06-18 Thread Mike Schinkel
> On Jun 18, 2021, at 8:30 AM, Mike Schinkel wrote: > > >> On Jun 18, 2021, at 7:22 AM, Craig Francis > <mailto:cr...@craigfrancis.co.uk>> wrote: >> >> On Fri, 18 Jun 2021 at 11:45 am, Guilliam Xavier > <mailto:guilliam.xav...@gmail.com>> &g

  1   2   3   4   5   6   7   8   >