Re: [PHP-DEV] [RFC] Enumerations, Round 2

2021-01-24 Thread Larry Garfield
On Mon, Dec 28, 2020, at 2:21 PM, Larry Garfield wrote: > Hello, Internalians! > > After considerable discussion and effort, Ilija and I are ready to > offer you round 2 on enumerations. This is in the spirit of the > previous discussion, but based on that discussion a great deal has been >

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

2021-01-24 Thread Go Kudo
Hi internals. RFC has been updated to 1.3 and implemented. https://wiki.php.net/rfc/object_scope_prng The main changes are as follows: - `RNG\OSRNG` has been renamed to `RNG\OS`. This was too verbose. - `rng_rand()` has been renamed to `rng_int()` and the arguments `$min` and `$max` are now

Re: [PHP-DEV] [RFC] var_representation() : readable alternative to var_export()

2021-01-24 Thread Dusk
On Jan 24, 2021, at 05:42, Rowan Tommins wrote: > As far as I know I have never had any reason to generate code and then eval() > it, and can't think of a situation where I ever would. If I wanted a > machine-readable output from a variable, I would use serialize() or > json_encode(). > >

[PHP-DEV] Proposal: Move filter_var() to core, leaving filter_input*() in the 'filter' module

2021-01-24 Thread tyson andre
Hi internals, The filter_var functionality is one of the most efficient and well-known ways in PHP to validate and sanitize inputs for many use cases (e.g. FILTER_VALIDATE_INT for checking if a string is well-formed decimal input (or other bases), FILTER_VALIDATE_BOOL for user input/configs

Re: [PHP-DEV] [RFC] var_representation() : readable alternative to var_export()

2021-01-24 Thread Rowan Tommins
On 24/01/2021 19:38, tyson andre wrote: If a php developer is learning the language through php's official manual, official language reference, or through an online tutorial, that would have sections showing the different scalar types, examples involving objects and/or arrays, etc. Those use

Re: [PHP-DEV] [RFC] var_representation() : readable alternative to var_export()

2021-01-24 Thread tyson andre
Hi Rowan Tommins, > > **php-src phpt tests are for tests of php itself, which puts strict and > > atypical limitations on the test framework.** > > php-src's phpt test framework may represent needs of php-src and some pecl > > maintainers, not userland. > > I'm not sure what point you're trying

Re: [PHP-DEV] [RFC] var_representation() : readable alternative to var_export()

2021-01-24 Thread Rowan Tommins
On 24/01/2021 16:17, tyson andre wrote: Even if a developer such as yourself doesn't need to generate code and don't expect to directly use it, **some of the applications and libraries they do use everyday would need to generate human and machine readable code.** Sure, I believe you that

Re: [PHP-DEV] [RFC] var_representation() : readable alternative to var_export()

2021-01-24 Thread tyson andre
Hi Rowan Tommins, > > var_representation  may be useful to a user when any of the following apply: > > > > - You are generating a snippet of code to eval() in a situation where the > > snippet will occasionally or frequently be read by a human  (If the output > > never needs to be read by a

Re: [PHP-DEV] [RFC] var_representation() : readable alternative to var_export()

2021-01-24 Thread Rowan Tommins
On 23/01/2021 21:07, tyson andre wrote: I've added those to https://wiki.php.net/rfc/readable_var_representation#when_would_a_user_use_var_representation , including when I think the VAR_REPRESENTATION_SINGLE_LINE flag would be useful to users. Thanks, it's good to at least know your