Re: [PHP-DEV] Re: "TryX" idom for Enumerations

2021-01-10 Thread Larry Garfield
On Sun, Jan 10, 2021, at 4:40 PM, Mark Randall wrote: > On 10/01/2021 21:27, Larry Garfield wrote: > > The "a method that begins with try is nullable, so watch out" idiom is > > present in C# and Rust, but to my knowledge has never existed in PHP. That > > doesn't make it bad; it actually combin

[PHP-DEV] Re: "TryX" idom for Enumerations

2021-01-10 Thread Mark Randall
On 10/01/2021 21:27, Larry Garfield wrote: The "a method that begins with try is nullable, so watch out" idiom is present in C# and Rust, but to my knowledge has never existed in PHP. That doesn't make it bad; it actually combines quite well with the null coalesce operator to allow for default

[PHP-DEV] "TryX" idom for Enumerations

2021-01-10 Thread Larry Garfield
This is a little tangent from the Enums RFC, but I want to flag it because it it's the sort of in-passing decision that could have far-reaching implications, so shouldn't be done implicitly. At the moment, the Enum RFC for scalar enums includes two methods: public function has(string $name): bo

[PHP-DEV] Re: [RFC] Object-scope RNG implementation

2021-01-10 Thread Go Kudo
Hi internals. I implemented Type II, which was pointed out by Nikita and fixed. https://github.com/zeriyoshi/php-src/commit/5ff8882a8fbfaf4ffd5cc42fb5853c4a1a00c182 This is much smarter and simpler than Type I, but the implementation is more complex (partly due to my lack of knowledge). It cont

[PHP-DEV] What is the use of op_array_persist and op_array_persist_calc

2021-01-10 Thread Barel
Looking at the info for Zend Extensions I have noticed that there are two members in the zend_extension struct called "op_array_persist" and "op_array_persist_calc". Looking at the PHP source code I can see that these hooks are used to add some data in memory to the opcode array but I can't think o

Re: [PHP-DEV] Analysis of property visibility, immutability, and cloning proposals

2021-01-10 Thread Larry Garfield
On Sat, Jan 9, 2021, at 7:24 PM, G. P. B. wrote: > On Sun, 10 Jan 2021 at 00:33, Larry Garfield wrote: > > It took a few days, but I am back with some more concrete examples. I > > decided to try and convert PSR-7 to the various options considered in my > > previous post. Here are the results:

Re: [PHP-DEV] Re: Straw poll: Naming for `*any()` and `*all()` on iterables

2021-01-10 Thread Levi Morrison via internals
I want to make a case for `Spl`. Aside from autoloading (which really ought to be in core but since "spl" is literally in the name of those functions it's kind of stuck), the SPL is mostly data structures and iterator related functionality. It makes perfect sense to me that iterator related behavio

Re: [PHP-DEV] silly question : what is more secure at the moment, php7, php8, or plain .sh shell scripts?

2021-01-10 Thread Michael Morris
I didn't say "best practice." I said "common practice". It has it's time and place, but it's beyond the scope of this thread and outside the purpose of this listserv. Your abuse of me is also a direct violation of the the TOS of this list. I formally request the moderators issue a ban to you, and

[PHP-DEV] Re: Straw poll: Naming for `*any()` and `*all()` on iterables

2021-01-10 Thread tyson andre
Hi internals, > I've created a straw poll for the naming pattern to use for `*any()` and > `*all()` on iterables. > https://wiki.php.net/rfc/any_all_on_iterable_straw_poll > > Background: The RFC https://wiki.php.net/rfc/any_all_on_iterable proposes > adding only two functions, > but more funct

Re: [PHP-DEV] silly question : what is more secure at the moment, php7, php8, or plain .sh shell scripts?

2021-01-10 Thread Michael Morris
The most secure setup possible is to use a static site generator and upload it's output to a static server with no server side parsing enabled. In my opinion Hugo is the best of these which is written in Go, and that's it's largest drawback - written in a language I'm not too familiar with. Jigsaw

Re: [PHP-DEV] incorrect mysqli_query return value? or documentation problem?

2021-01-10 Thread Rowan Tommins
On 10 January 2021 02:10:16 GMT+00:00, j adams wrote: >I apologize for troubling the list again, but I sent an email on the >5th >which has so far received no response. Archived here: >https://news-web.php.net/php.internals/112755 Hi, I've replied to your original mail to the phpdoc list, which

Re: [PHP-DEV] Analysis of property visibility, immutability, and cloning proposals

2021-01-10 Thread Rowan Tommins
On 10 January 2021 01:24:38 GMT+00:00, "G. P. B." wrote: >Moreover, asymmetric visibility does not prevent mutating an object by >calling the constructor once again as follows: >$obj->__construct(...$args); That's pretty trivial to work around: mark the constructor private and provide one or m

[PHP-DEV] silly question : what is more secure at the moment, php7, php8, or plain .sh shell scripts?

2021-01-10 Thread Rene Veerman
hi. i run a website which i want to harden against hacking by 3rd parties. i wrote this website back in 2002-2010, and then built apps on top of the base code. now i want to upgrade the entire thing to the latest css3 standards and also include anti-hacking measures, because at one point i got k