Re: [PHP-DEV] int|float for sleep? sleep(0.1) => sleep 0.1 seconds

2024-03-08 Thread Hans Henrik Bergan
On Tue, 5 Mar 2024 at 20:17, Larry Garfield wrote: > > A 3 way up-down vote doesn't make sense. What happens if none of the 3 > options reaches 66%? > > The viable options here are a single RCV vote (which we've done before), or a > single "Should we do this" vote that requires 66%, followed

Re: [PHP-DEV] int|float for sleep? sleep(0.1) => sleep 0.1 seconds

2024-03-05 Thread Hans Henrik Bergan
Voting has now been simplified to 3x no/php 8.4/php 9.0 questions. (I actually would've preferred the original 6, would have been unambiguous if people are supposed to checkbox only 8.4 or both 8.4 and 9.0, and would have been easier to see the % of people who voted only 9.0, I think. But I don't

Re: [PHP-DEV] int|float for sleep? sleep(0.1) => sleep 0.1 seconds

2024-02-27 Thread Hans Henrik Bergan
Made a RFC draft: https://wiki.php.net/rfc/sleep_function_float_support First time, so I'm not surprised if there are some mistakes there. Feedback is very welcome. I have tried sending this email 4 times over 2 days from hans at loltek dot net and every time the email server said delivery

Re: [PHP-DEV] automatic formatting checks for pull requests?

2024-02-17 Thread Hans Henrik Bergan
bruary 2024 22:18:05 GMT, Ilija Tovilo wrote: > >Hi Hans > > > >On Sat, Feb 17, 2024 at 3:31 PM Gina P. Banyard wrote: > >> > >> On Saturday, 17 February 2024 at 11:24, Hans Henrik Bergan > >> wrote: > >> > >> > Can we ad

Re: [PHP-DEV] automatic formatting checks for pull requests?

2024-02-17 Thread Hans Henrik Bergan
On Sun, 18 Feb 2024 at 00:51, Ilija Tovilo wrote: > > Hi Hans > > On Sat, Feb 17, 2024 at 3:31 PM Gina P. Banyard wrote: > > > > On Saturday, 17 February 2024 at 11:24, Hans Henrik Bergan > > wrote: > > > > > Can we add automatic formatting che

Re: [PHP-DEV] automatic formatting checks for pull requests?

2024-02-17 Thread Hans Henrik Bergan
On Sat, Feb 17, 2024, 15:27 Gina P. Banyard wrote: > On Saturday, 17 February 2024 at 11:24, Hans Henrik Bergan < > h...@loltek.net> wrote: > > > Can we add automatic formatting checks for pull requests? > > Made a PR: https://github.com/php/php-src/pull/13417 > &g

Re: [PHP-DEV] Requesting RFC karma

2024-02-17 Thread Hans Henrik Bergan
On Sat, 17 Feb 2024 at 08:22, Hans Henrik Bergan wrote: > > My name is "Hans Henrik Bergan", usually go by the nickname > "divinity76", I've contributed to OSS (including PHP) for years, and > am currently involved in 3 things that might require an RFC, and > re

Re: [PHP-DEV] int|float for sleep? sleep(0.1) => sleep 0.1 seconds

2024-02-17 Thread Hans Henrik Bergan
On Fri, 16 Feb 2024 at 09:36, Alexandru Pătrănescu wrote: > > > On Fri, Feb 16, 2024 at 10:18 AM Hans Henrik Bergan wrote: >> >> Can we make sleep accept int|float? >> Made a PR: https://github.com/php/php-src/pull/13401 >> >> For years when I wanted

[PHP-DEV] automatic formatting checks for pull requests?

2024-02-17 Thread Hans Henrik Bergan
Can we add automatic formatting checks for pull requests? Made a PR: https://github.com/php/php-src/pull/13417 php-src use "tabs" instead of "spaces", that is... quite unusual, and I'm probably not the first person to accidentally use spaces instead of tabs, ref

[PHP-DEV] Requesting RFC karma

2024-02-16 Thread Hans Henrik Bergan
My name is "Hans Henrik Bergan", usually go by the nickname "divinity76", I've contributed to OSS (including PHP) for years, and am currently involved in 3 things that might require an RFC, and requesting RFC karma for wiki account "divinity76". 1/3: addin

[PHP-DEV] int|float for sleep? sleep(0.1) => sleep 0.1 seconds

2024-02-15 Thread Hans Henrik Bergan
Can we make sleep accept int|float? Made a PR: https://github.com/php/php-src/pull/13401 For years when I wanted to sleep for 0.1 seconds, it annoyed me that I couldn't do `sleep(0.1);` instead I had to do `usleep(figure out how many microseconds there are in 0.1 seconds and put it here);` FWIW

Re: [PHP-DEV] [Discussion] Thoughts on casting to null

2024-02-15 Thread Hans Henrik Bergan
EventLoop::repeat($pingInterval, function(...$args)use($client){$client->ping(...$args)});

[PHP-DEV] int|float for DateTime::setTimestamp

2024-02-13 Thread Hans Henrik Bergan
just like the constructor accepts new DateTime("@0.123456"); // 1970-01-01 00:00:00.123456 new DateTime("@".microtime(true)); IMO setTimestamp should accept the same: $dt->setTimestamp(0.123456); // 1970-01-01 00:00:00.123456 $dt->setTimestamp(microtime(true)); Can we change setTimestamp to

Re: [PHP-DEV] BLAKE3 hash

2024-01-29 Thread Hans Henrik Bergan
with https://github.com/php/php-src/commit/52dba99d47563f38d8ed5f84690a3cb2c1785475 , the PR ( https://github.com/php/php-src/pull/13194 ) got the first merge conflict. I fixed it, but what's next? Could vote on it, if there is little more to discuss? quick recap AMD Ryzen 9 7950x: portable

Re: [PHP-DEV] BLAKE3 hash

2024-01-26 Thread Hans Henrik Bergan
just tested ARM Neon optimizations on Oracle Cloud's cheapest ARM VPS: VM.Standard.A1.Flex, Ubuntu 22.04, GCC11.4, results: -O2 portable: 596MB/s -O2 -march=native portable: 601MB/s -O2 ARM Neon optimized implementation: 1138MB/s Again, even with -march=native, the compiler cannot make the

Re: [PHP-DEV] BLAKE3 hash

2024-01-24 Thread Hans Henrik Bergan
On Wed, 24 Jan 2024 at 17:59, Marco Pivetta wrote: > > Depends on the actual numbers: is there any way to make a comparison that > is relatively stable across architectures? > > Would it be feasible to start with the > cross-platform-let-the-compiler-do-its-job version (that somebody may >

Re: [PHP-DEV] BLAKE3 hash

2024-01-24 Thread Hans Henrik Bergan
Maybe vote on it? (that was suggested in the PR too, https://github.com/php/php-src/pull/13194#issuecomment-1900430400 ) Can think of 6 things 1: Should BLAKE3 be added to PHP? yes/no 2: Should ARM Neon (2007) optimized implementation be bundled? yes/no 3: Should x86_64 SSE2 (2000) optimized

Re: [PHP-DEV] BLAKE3 hash

2024-01-21 Thread Hans Henrik Bergan
On Mon, 22 Jan 2024 at 07:10, tag Knife wrote: > > That's why I suggested implementing separate lengths of the like we have for > SHA3, so we could have BLAKE3_256 and BLAKE3_512 and maybe inbetweens. we can look into exposing blake3's XOF (arbitrary length) capabilities after (and if) initial

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
it should be a separate PR, after the initial support gets merged. On Fri, 19 Jan 2024 at 21:42, Hans Henrik Bergan wrote: > > >BLAKE3 has 2 default sizes > > Nope, only 1 canonical size, 256 bits. > *BUT* BLAKE3 is XOF, it can be exactly as long as you want it to be: > > $ ec

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
ength"=>1000]): blake3_8000 that shouldn't be too difficult to implement either! good idea On Fri, 19 Jan 2024 at 20:20, tag Knife wrote: > > On Fri, 19 Jan 2024 at 18:43, Hans Henrik Bergan wrote: > > > Can we add the BLAKE3 hash? > > > > Created a PR here: h

[PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
Can we add the BLAKE3 hash? Created a PR here: https://github.com/php/php-src/pull/13194 BLAKE3 is a very fast ("blazing fast") cryptographically secure hash. It is the latest iteration of the BLAKE hash, which was a SHA3 finalist~ see https://github.com/BLAKE3-team/BLAKE3 for more info on

Re: [PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-29 Thread Hans Henrik Bergan
i think Shift_JIS can also be automatically converted to UTF-8, does this seem right? https://github.com/divinity76/php2utf8/commit/6e08c4c16312961170cce821195816a8d24e23f6 On Wed, 29 Nov 2023 at 01:21, youkidearitai wrote: > > > Use zend.script_encoding=sjis and zend_bultibyte=true > > > > ❯

Re: [PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-28 Thread Hans Henrik Bergan
=> ini_get("zend.detect_unicode"), "mbstring.internal_encoding" => ini_get("mbstring.internal_encoding"), "mbstring.func_overload" => ini_get("mbstring.func_overload"), "PHP_VERSION" => PHP_VERSION, "r

Re: [PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-28 Thread Hans Henrik Bergan
verload" => ini_get("mbstring.func_overload"), "PHP_VERSION" => PHP_VERSION, )); ``` there? What do you get? On Wed, 29 Nov 2023 at 00:47, youkidearitai wrote: > > 2023年11月29日(水) 8:07 Hans Henrik Bergan : > > > > @youkidearitai right now the code

Re: [PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-28 Thread Hans Henrik Bergan
for BOMs, and BOMs are > > significantly less useful in fixed-endian encodings (like UTF8) than > > bi-endian encodings (like UTF16/UTF32) ^^ > > > > On Tue, 28 Nov 2023 at 21:47, Hans Henrik Bergan > > wrote: > > > > > > > What is the migration

Re: [PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-28 Thread Hans Henrik Bergan
UTF16/UTF32) ^^ On Tue, 28 Nov 2023 at 21:47, Hans Henrik Bergan wrote: > > > What is the migration path for legacy code that use those directives? > > The migration path is to convert the legacy-encoding PHP files to UTF-8. > Luckily this can be largely automated, here is my

Re: [PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-28 Thread Hans Henrik Bergan
> What is the migration path for legacy code that use those directives? The migration path is to convert the legacy-encoding PHP files to UTF-8. Luckily this can be largely automated, here is my attempt: https://github.com/divinity76/php2utf8/blob/main/src/php2utf8.php but that code definitely

[PHP-DEV] Deprecate declare(encoding='...') + zend.multibyte + zend.script_encoding + zend.detect_unicode ?

2023-11-28 Thread Hans Henrik Bergan
With the dominance of UTF-8 (a fixed-endian encoding), surely no new code should utilize any of declare(encoding='...') / zend.multibyte / zend.script_encoding / zend.detect_unicode. I propose we deprecate all 4. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Fix the inconsistent behavior of PDO::PARAM_XXX

2023-11-05 Thread Hans Henrik Bergan
I think it'd be a good idea if they used FILTER_VALIDATE_BOOLEAN and FILTER_VALIDATE_INTEGER type logic, with an error if conversion fails.. I wonder if PDO::PARAM_BOOL_OR_NULL would be worthwhile On Sun, Nov 5, 2023, 10:10 Saki Takamachi wrote: > Hi, > > To think more deeply about this issue,

Re: [PHP-DEV] Fix the inconsistent behavior of PDO::PARAM_XXX

2023-11-04 Thread Hans Henrik Bergan
I had no idea PDO's PARAM_INT and PARAM_BOOL was so buggy, good catch! On Sat, Nov 4, 2023, 07:59 Saki Takamachi wrote: > Hi internals, > > As shown in the following issue, the behavior of `PDO::PARAM_` is > inconsistent and I would like to fix this. >

Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath

2023-10-12 Thread Hans Henrik Bergan
been years since i checked, but last time i checked, BCMath supports floating point numbers, and PHP's GMP wrappers does not (this is not a limitation of GMP itself, but of PHP's GMP wrappers) - has the GMP api floating issues been fixed? a quick test suggest /no/: https://3v4l.org/FQaI4 On Thu,

[PHP-DEV] Can we deprecate socket_set_blocking() ?

2023-10-09 Thread Hans Henrik Bergan
The only thing socket_set_blocking() is good for is to confuse people looking for socket_set_block()

Re: [PHP-DEV] trim support for multibyte spaces

2023-10-02 Thread Hans Henrik Bergan
fine. > https://gist.github.com/youkidearitai/0018dee27353c00aebaff3bf57c5b8c6 > > However, this code is C++17, php-src is C code. > If you would like contribute, I would like written to C code. > > Regards > Yuya > > 2023年10月1日(日) 19:46 Hans Henrik Bergan : > > > >

Re: [PHP-DEV] trim support for multibyte spaces

2023-10-01 Thread Hans Henrik Bergan
i = -1; } } 2x nested loops reduced to 1 loop, and goto removed~ On Sun, 1 Oct 2023 at 10:43, Hans Henrik Bergan wrote: > > > If have any idea, feel free to comment to me. > > i think the C code would look something like > > > void mb_trim(si

Re: [PHP-DEV] trim support for multibyte spaces

2023-10-01 Thread Hans Henrik Bergan
> If have any idea, feel free to comment to me. i think the C code would look something like void mb_trim(size_t *strlen, char **str, const size_t trim_lengths_num, const size_t *trim_lengths, const char **trim_chars) { size_t local_strlen = *strlen; char *local_str = *str; for (;;)

Re: [PHP-DEV] Security Audit Priorities

2023-09-25 Thread Hans Henrik Bergan
the php-fpm master<->php-fpm worker glue code. php-fpm master usually runs as *root*, so a compromise in that glue could lead to webserver rooting On Mon, 25 Sept 2023 at 10:49, Derick Rethans wrote: > > Hi, > > The Foundation is organising an external audit/security check of the PHP > source

Re: [PHP-DEV] A new JIT engine for PHP-8.4/9

2023-09-16 Thread Hans Henrik Bergan
I think the submodule approach is fine, but maybe it should be moved from Dmitry's gh to php-src gh, or maybe it's own dedicated group, to reduce the bus factor (how much work needs to be done if Dmitry is hit by a bus~) On Sat, Sep 16, 2023, 00:22 Tim Düsterhus wrote: > Hi > > On 9/15/23

Re: [PHP-DEV] RFC: Increasing the default BCrypt cost

2023-09-12 Thread Hans Henrik Bergan
40.695820 total (1.406958 per hash) real4m31.854s user4m13.115s sys 0m2.168s hanshenrik@jonathan-dayton:~$ cat /proc/cpuinfo | head (...) model name : AMD Opteron(tm) Processor 4122 On Tue, 12 Sept 2023 at 18:01, Tim Düsterhus wrote: > > Hi > > On 9/12/23 17:5

Re: [PHP-DEV] RFC: Increasing the default BCrypt cost

2023-09-12 Thread Hans Henrik Bergan
>web hosters *love* their ancient hardware No kidding. dreamhost.com host over 1.5 million websites, presumably most are on their "Shared Unlimited" package, which runs on AMD Opteron 4122, a high-end server CPU from 2010. Some benchmarks there: hanshenrik@jonathan-dayton:~$ cat /proc/cpuinfo |

Re: [PHP-DEV] RFC: Increasing the default BCrypt cost

2023-09-08 Thread Hans Henrik Bergan
@Craig warning, it's very random what kind of CPU performance you get on your t2 instances, the CPUs vary greatly from modern to many years old. I know of Fortune 500 companies that have automated systems to spin up t2 instances until they randomly get "a good one", then discard the others,

Re: [PHP-DEV] PASSWORD_DEFAULT value

2023-09-06 Thread Hans Henrik Bergan
Argon2 is opt-in, not opt-out, at compile-time, so then we would have to agree on it being acceptable for PASSWORD_DEFAULT to have different values depending on compile-time options, maybe thats completely fine, or maybe it isn't, idk. But as Dusterhus points out, Argon2 is inferior to bcrypt

Re: [PHP-DEV] Apply strict_types to internal functions

2023-08-29 Thread Hans Henrik Bergan
2023 at 18:36, Hans Henrik Bergan wrote: > > maybe we could do a > declare(internal_strict_types=1); > on a per-file basis just like the existing userland strict_types? > (name is up for bikeshedding ofc) > > On Tue, 29 Aug 2023 at 17:49, Claude Pache wrote: > > > &g

Re: [PHP-DEV] Apply strict_types to internal functions

2023-08-29 Thread Hans Henrik Bergan
maybe we could do a declare(internal_strict_types=1); on a per-file basis just like the existing userland strict_types? (name is up for bikeshedding ofc) On Tue, 29 Aug 2023 at 17:49, Claude Pache wrote: > > > > > Le 29 août 2023 à 15:19, Saki Takamachi a écrit : > > > >> Hi, > >> > >> The

Re: [PHP-DEV] RFC1867 (multipart/form-data) PUT requests

2023-06-20 Thread Hans Henrik Bergan
how are errors handled, like if the format of php://input is unrecognized, not valid multipart/form-data and not valid application/x-www-form-urlencoded? errors? exceptions? nothing? On Tue, 20 Jun 2023 at 11:26, Ilija Tovilo wrote: > > Hi internals > > A while ago I encountered a limitation of

[PHP-DEV] Re: make FILE_ constants not collide with LOCK_

2023-06-14 Thread Hans Henrik Bergan
ps://quick-bench.com/q/j3k_unXcE91gVdTRH9Dm0nxpDUA (guess it's because it avoids the `flags < 0` thing) On Tue, 6 Jun 2023 at 12:54, Hans Henrik Bergan wrote: > > Can I get some attention to https://github.com/php/php-src/pull/11254 > ? It's been 3 weeks and nothing so far -- PHP Internals - PH

[PHP-DEV] make FILE_ constants not collide with LOCK_

2023-06-06 Thread Hans Henrik Bergan
Can I get some attention to https://github.com/php/php-src/pull/11254 ? It's been 3 weeks and nothing so far

Re: [PHP-DEV] Deprecation of the formats DATE_ISO8601 and DATE_RFC7231

2023-06-02 Thread Hans Henrik Bergan
DATE_ISO8601 doesn't have to be removed anytime soon, but no new code should be written using that constant, thus an E_DEPRECATED is warranted. Is anyone really arguing against that statement? On Tue, 30 May 2023 at 18:26, Hans Henrik Bergan wrote: > > >In my opinion, deprecating

Re: [PHP-DEV] Proposal: addition of array_find() and array_find_key() functions

2023-06-01 Thread Hans Henrik Bergan
sounds like array_find could be implemented by just adding a new flag for array_filter's $mode: ARRAY_FILTER_STOP_ON_FIRST_MATCH or some such? On Fri, 2 Jun 2023 at 02:15, Casper Langemeijer wrote: > > On Thu, Jun 1, 2023, at 18:02, Janusz Szczypka wrote: > > array_find(): This function would

Re: [PHP-DEV] Deprecation of the formats DATE_ISO8601 and DATE_RFC7231

2023-05-30 Thread Hans Henrik Bergan
>In my opinion, deprecating this does not do anything besides annoying users. In my opinion, since it isn't, and likely never was, a legal ISO8601 string, it's a no-brainer that it should be deprecated. (it's at least been illegal since iso8601:2004 released in 2004) On Fri, 26 May 2023 at

Re: [PHP-DEV] mb_ucfirst and mb_lcfirst

2023-05-28 Thread Hans Henrik Bergan
I think it would be useful. For some reason, lots of people on stackoverflow has a hard time implementing this function in userland: on https://stackoverflow.com/questions/2517947/ucfirst-function-for-multibyte-character-encodings there are 10 broken implementations of mb_ucfirst, and 1 correct

Re: [PHP-DEV] Deprecation of the formats DATE_ISO8601 and DATE_RFC7231

2023-05-20 Thread Hans Henrik Bergan
>outdated format, standard has been changed while ago What do you mean? Do you mean that the constant was legal at some point? Was there ever a version of ISO8601 allowing the mixing of "extended format" and "basic format" ? The earliest version I've read, iso8604:2004, does not allow it (more on

Re: [PHP-DEV] Please remove the Sicherheitsüberprüfung Security captcha from php.net

2023-05-14 Thread Hans Henrik Bergan
(tl;dr: if an English version exists, I have no idea why I was served the German version.) On Sun, 14 May 2023 at 23:36, Rowan Tommins wrote: > > On 14 May 2023 21:48:51 BST, Hans Henrik Bergan wrote: > >fwiw for those of you lucky enough to not get the captcha page, it > >looks

[PHP-DEV] Please remove the Sicherheitsüberprüfung Security captcha from php.net

2023-05-14 Thread Hans Henrik Bergan
multiple times per week now, i get this Security Sicherheitsüberprüfung captcha page when visiting php.net and it's really annoying to solve that captcha multiple times per week. "PHP is that annoying language where you have to solve captchas just to read the documentation" is not the experience

Re: [PHP-DEV] Moving a tmpfile()?

2023-04-30 Thread Hans Henrik Bergan
@Robert I know windows has problems with moving files that are opened by other processes, BUT this still works fine on Windows 10 running on NTFS: rename returns true and the file really is moved (and the file is no longer automatically deleted - i suspect PHP's tmpfile() try to delete the

Re: [PHP-DEV] Future stability of PHP?

2023-04-10 Thread Hans Henrik Bergan
several PHP versions will be maintained for 10 years by third-party vendors. PHP5.6 will meet the 10 year mark by 28 august 2024, and freexian.com maintains PHP5.6 with multiple customers paying 6000€/year for 5.6 maintenance. Canonical intends to maintain PHP7.0 until April 2026 for their Ubuntu

[PHP-DEV] Can we get compile time routines?

2023-03-16 Thread Hans Henrik Bergan
Something like ``` $data = compile_time_routine(function() { return json_decode(file_get_contents("large.json"), true); }); ``` being equivalent at runtime to ``` $data = array(...whatever json_decode returned...); ``` and ``` echo "opcache compiled at " .

Re: [PHP-DEV] RFC karma request

2023-02-12 Thread Hans Henrik Bergan
Good point, and come to think of it, people wishing to $offset can fseek() before before fpassthru() anyway. Nevermind the $offset thing, it's more trouble than it's worth ^^ On Sun, Feb 12, 2023, 15:46 Thomas Hruska wrote: > On 2/12/2023 5:47 AM, Hans Henrik Bergan wrote: > > Fwiw I w

Re: [PHP-DEV] RFC karma request

2023-02-12 Thread Hans Henrik Bergan
Fwiw I would also find an $offset argument useful. fpassthru's lack of both $length and $offset made my life harder when implementing "HTTP 206 Partial Content" / "HTTP range requests", Ended up with a $output = fopen('php://output', 'wb'); + stream_copy_to_stream() hack because of fpassthru's

Re: [PHP-DEV] RFC Proposal - Types for Inline Variables

2023-02-07 Thread Hans Henrik Bergan
function f(int $value){ $value="foo"; // should this be a TypeError? BC break all the things } On Mon, 6 Feb 2023 at 22:15, someniatko wrote: > > Hi there, > > I am not a core PHP language developer, just a regular PHP programmer, and > cannot speak for the whole community, so I'll just

Re: [PHP-DEV] PHP 8.1 and OpenSSL

2023-01-18 Thread Hans Henrik Bergan
+1, we don't want to bundle and maintain and monkey-patch 1.1.1 ourselves for 14.4 months, which I guess would be the alternative. On Wed, 18 Jan 2023 at 13:20, Christoph M. Becker wrote: > > Hi all! > > While the official builds for PHP 8.2 already use OpenSSL 3.0, the PHP > 8.1 builds are

Re: [PHP-DEV] base64url format

2023-01-10 Thread Hans Henrik Bergan
how about base64_encode(string $string, int $flags = 0): string with $flags accepting BASE64_RFC4648 and BASE64_NO_PADDING or something to that effect? On Mon, 9 Jan 2023 at 22:56, David Gebler wrote: > > On Mon, Jan 9, 2023 at 9:42 PM Derick Rethans > wrote: > > > On 9 January 2023 18:49:28

Re: [PHP-DEV] base64url format

2023-01-09 Thread Hans Henrik Bergan
when http_build_query() wanted to support different encoding schemes, PHP_QUERY_RFC1738 and PHP_QUERY_RFC3986 was made, instead of creating http_build_query_rfc1738() and http_build_query_rfc3986() , hmm On Mon, 9 Jan 2023 at 21:12, Tim Düsterhus wrote: > > Hi > > On 1/9/23 19:49, Sara Golemon

Re: [PHP-DEV] What to do with opaque GMP objects which allows instantiation

2022-12-30 Thread Hans Henrik Bergan
Why isn't that generating an ArgumentCountError? On Fri, Dec 30, 2022, 21:36 Tim Düsterhus wrote: > Hi > > On 12/30/22 18:36, G. P. B. wrote: > > - Add a proper constructor that does the same as gmp_init() in > master/8.2.1 > > My preference would be this (without any target branch

Re: [PHP-DEV] ext-random: add random_float() ?

2022-12-20 Thread Hans Henrik Bergan
$max) return $min; return $min + random_int(0, PHP_INT_MAX) / PHP_INT_MAX * ($max - $min); } On Tue, 20 Dec 2022 at 09:06, Hans Henrik Bergan wrote: > > >returns a value between 0.0 and 1.0. > > wouldn't it be better to follow random_int(int $min, int $max) design? eg > rand

Re: [PHP-DEV] ext-random: add random_float() ?

2022-12-20 Thread Hans Henrik Bergan
>returns a value between 0.0 and 1.0. wouldn't it be better to follow random_int(int $min, int $max) design? eg random_float(float $min, float $max): float On Tue, 20 Dec 2022 at 07:27, Go Kudo wrote: > > Hi Internals. > > Congratulations on the release of PHP 8.2. > I just recently upgraded

Re: [PHP-DEV] Experimental features

2022-10-04 Thread Hans Henrik Bergan
sounds like that's been done with PECL previously yeah? PECL json until native json_encode in PHP5.2.0, PECL PDO until native PDO in PHP 5.1.0, PECL ZendOpcache until native opcache in PHP 5.5.5 etc? On Wed, 5 Oct 2022 at 00:38, Flávio Heleno wrote: > > On Tue, Oct 4, 2022, 17:43 David Rodrigues

Re: [PHP-DEV] Sanitize filters

2022-10-02 Thread Hans Henrik Bergan
FILTER_SANITIZE_EMAIL should burn. If you have a bad email address, i can't imagine the correct solution is to remove characters until it becomes valid, short of a trim() On Sun, Oct 2, 2022, 17:10 Larry Garfield wrote: > On Sat, Oct 1, 2022, at 10:39 AM, Kamil Tekiela wrote: > > Hi Internals,

Re: [PHP-DEV] Re: str_repeat performance

2022-09-10 Thread Hans Henrik Bergan
maybe you'll find $t=microtime(true) - $startTime; var_dump($t,number_format($t,10)); interesting, https://3v4l.org/Ejia3 On Sat, 10 Sept 2022 at 17:11, Eugene Sidelnyk wrote: > Oh, yes. Sorry for that. > > Thanks for pointing out. > > On Sat, Sep 10, 2022 at 3:23 PM Christoph M. Becker >

Re: [PHP-DEV] No longer allow block mode for declare(encoding)

2022-08-31 Thread Hans Henrik Bergan
>it might be hard to properly implement support No effort should be wasted supporting this. +1 On Wed, Aug 31, 2022, 21:21 Sara Golemon wrote: > On Wed, Aug 31, 2022 at 10:43 AM Christoph M. Becker > wrote: > > > recently, there was a bug report regarding declare(encoding)[1]. I've > >

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

2022-08-26 Thread Hans Henrik Bergan
quote > you can't efficiently validate JSON in userland Has anyone actually put that claim to the test? Has anyone actually made a userland json validator (not just wrap json_decode()/json_last_error()) for performance comparison? ( if not, https://www.json.org/JSON_checker/JSON_checker.c would

Re: [PHP-DEV] xoshiro** edge case (all zeros)

2022-08-04 Thread Hans Henrik Bergan
dangerous to be sure, but it's also a technically valid seed, are you sure we should disallow a valid seed? On Thu, 4 Aug 2022 at 20:33, Tim Düsterhus wrote: > Hi > > On 8/4/22 10:09, Anton Smirnov wrote: > > xoshiro** has a known edge case: all-zero seed > > Indeed, good catch. I had that in

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

2022-07-29 Thread Hans Henrik Bergan
>1. Are there any reasonable objections to consistently implementing character range expressions for all character masks? would be a minor BC break to silently change the meaning of memspn($str, "a..b"), which currently has the same meaning as "a.b" with wasted cpu cycles, but with your

Re: [PHP-DEV] Windows PECL build machine died

2022-07-22 Thread Hans Henrik Bergan
ing because... in my > opinion/experience, hyperthreading implementations in older Intel CPUs > often did more harm than good, making the cpus run hotter and clock lower, > this is a (high-end) 2011 model. (I have the opposite experience with AMD > SMT fwiw) > > > > On Thu

Re: [PHP-DEV] Windows PECL build machine died

2022-07-22 Thread Hans Henrik Bergan
:18, Hans Henrik Bergan wrote: > Fwiw Chris Haas / vendiadvertising.com has reached out, they're willing > to sponsor raid(1) if my proposal is accepted. > Haas is reading this mailing list, but does not wish to participate/post > directly at present. > (I have no prior relati

Re: [PHP-DEV] Windows PECL build machine died

2022-07-13 Thread Hans Henrik Bergan
at 22:31, Hans Henrik Bergan wrote: > i have a 40-core 128GB RAM server with 1 (and only 1) static ipv4 address > that I intend to keep around until at least 27 november 2025 (but unsure > after that), > it has more RAM/CPU than i need, and i could set up a virtual machine on > it and

Re: [PHP-DEV] Windows PECL build machine died

2022-07-12 Thread Hans Henrik Bergan
Jul 2022 at 15:38, Christoph M. Becker wrote: > On 11.07.2022 at 21:04, Hans Henrik Bergan wrote: > > > Any of you windows.php.net guys familiar with SSH? Can one be created? > > That would be possible (needed to be set-up by Alex Schoenmaker), but > while that could solve the u

Re: [PHP-DEV] Windows PECL build machine died

2022-07-11 Thread Hans Henrik Bergan
Any of you windows.php.net guys familiar with SSH? Can one be created? On Mon, 11 Jul 2022 at 19:52, Christoph M. Becker wrote: > On 11.07.2022 at 18:53, Hans Henrik Bergan wrote: > > > Is there any SSH public key associated with the Windows php developers? > Or > > with C

Re: [PHP-DEV] Windows PECL build machine died

2022-07-11 Thread Hans Henrik Bergan
Is there any SSH public key associated with the Windows php developers? Or with CMB? On Mon, 11 Jul 2022 at 18:25, Christoph M. Becker wrote: > On 11.07.2022 at 17:41, Hans Henrik Bergan wrote: > > > Do you mean it is unlikely that Github Actions will suffice? because that > >

Re: [PHP-DEV] Windows PECL build machine died

2022-07-11 Thread Hans Henrik Bergan
Do you mean it is unlikely that Github Actions will suffice? because that would definitely be a great solution if it was possible/feasible . Anyway, with regards to "I don't think there are special requirements regarding the hardware", can you give a rough estimate on RAM/disk space requirements?

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

2022-07-02 Thread Hans Henrik Bergan
ment On Sat, 2 Jul 2022 at 05:02, Anton Smirnov wrote: > On Fri, 2022-07-01 at 16:11 +0200, Hans Henrik Bergan wrote: > > > As far as we are aware, only two languages in widespread use > > > require variables to be explicitly closed over: PHP and C++. All > >

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

2022-07-01 Thread Hans Henrik Bergan
>As far as we are aware, only two languages in widespread use require variables to be explicitly closed over: PHP and C++. All other major languages capture implicitly, as is proposed here. to be fair to c++, it supports [&] to capture everything, like int a=1,b=2,c=3;[&]()->void{std::cout << a

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

2022-06-22 Thread Hans Henrik Bergan
(dammit, mixed sftp:// with ftps:// there, ignore that, i meant sftp:// ) On Wed, 22 Jun 2022 at 16:53, Hans Henrik Bergan wrote: > nitpicking but I kind-of doubt the description > for CurlUrl::NO_DEFAULT_PORT is correct, quote: > > Instructs the method to return null if the

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

2022-06-22 Thread Hans Henrik Bergan
:22/ Is that correct? I would imagine it returns null if the port isn't specified, rather than null if the port when specified matches the default port? On Wed, 22 Jun 2022 at 16:46, Hans Henrik Bergan wrote: > any particular reason CurlUrl::getPort() defaults to 0 rather than one of >

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

2022-06-22 Thread Hans Henrik Bergan
any particular reason CurlUrl::getPort() defaults to 0 rather than one of the valid options? (that being CurlUrl::DEFAULT_PORT and CurlUrl::NO_DEFAULT_PORT ) On Wed, 22 Jun 2022 at 16:23, Pierrick Charron wrote: > Hi Derick, > > > > > > - The new CurlUrl class should probably be immutable from

[PHP-DEV] Re: LOCK_SH for file_get_contents ?

2022-04-23 Thread Hans Henrik Bergan
y much completely useless since php 7.0, so I doubt it'll break anything keeping up with new releases of PHP. On Mon, 13 Dec 2021 at 13:57, Hans Henrik Bergan wrote: > This has been requested for years (since at least 2009?) but it seems no > actual plan has been proposed > How about this? >

Re: [PHP-DEV] Re: Undefined variables and the array append operator

2022-03-30 Thread Hans Henrik Bergan
> RFC. There are other inconsistencies as well now, depending on how the undefined variable comes to exist absolutely, but shouldn't try to do too much in a single rfc, wouldn't want it to be rejected for the wrong reasons ^^ On Wed, 30 Mar 2022 at 12:17, Björn Larsson via internals <

Re: [PHP-DEV] [RFC][Under discussion] Arbitrary string interpolation

2022-03-18 Thread Hans Henrik Bergan
i'd write it as $name = "Theodore Brown"; echo "{$name} has a length of " . strlen ( $name ) . "."; On Fri, 18 Mar 2022 at 05:49, Theodore Brown wrote: > On Thu, Mar 17, 2022 at 5:40 PM Tobias Nyholm > wrote: > > > On Thu, 17 Mar 2022, 23:27 Ilija Tovilo, wrote: > > > >> Hi everyone > >> > >>

Re: [PHP-DEV] RFC proposal to deprecate crypt()

2022-02-21 Thread Hans Henrik Bergan
fwiw i recall a real-world script modifying a linux system's /etc/passwd / /etc/shadow using crypt() because password_hash() couldn't create passwd/shadow-compatible hashes while crypt() could On Mon, 21 Feb 2022 at 12:49, Marco Pivetta wrote: > On Mon, Feb 21, 2022 at 12:39 PM Tim Düsterhus

Re: [PHP-DEV] [VOTE] RFC: Remove support for libmysql from mysqli

2022-02-05 Thread Hans Henrik Bergan
good job! can we do PDO_MYSQL next? if that also goes away (seems likely), all libmysqlclient-specific code can be removed i think On Sat, 5 Feb 2022 at 16:10, Kamil Tekiela wrote: > The voting has now ended. The RFC has been unanimously accepted (30/0). > > Since PHP 8.2 it will not be

Re: [PHP-DEV] header() allows arbitrary status codes

2021-12-23 Thread Hans Henrik Bergan
another thing, it wouldn't surprise me if someone at some point want to emulate some IIS-specific codes in PHP, like header("HTTP/1.1 401.3 Unauthorized due to ACL on resource."); it'd be a shame if PHP literally cannot send IIS-errorcodes On Thu, 23 Dec 2021 at 16:40, Hans Henrik Ber

Re: [PHP-DEV] header() allows arbitrary status codes

2021-12-23 Thread Hans Henrik Bergan
sometime in the future HTTP 6xx will be defined, and we'll have to add a big warning to the header()/http_respons_code() pages like "Warning: HTTP 6.x.x is only supported in PHP >= x.x.x and PHP <=8.1.x", and library developers have to add fugly code like `if(PHP_VERSION_MAJOR >= X ||

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

2021-12-22 Thread Hans Henrik Bergan
I wonder if anyone depends on utf8_* without also depending on mb_* ? I imagine that is exceedingly rare On Wed, Dec 22, 2021, 15:26 Rowan Tommins wrote: > On 22/12/2021 10:45, Andreas Heigl wrote: > > I just dug a bit deeper on the subject and found this RFC from 2016: > > > >

[PHP-DEV] LOCK_SH for file_get_contents ?

2021-12-13 Thread Hans Henrik Bergan
This has been requested for years (since at least 2009?) but it seems no actual plan has been proposed How about this? since we already have the constant FILE_USE_INCLUDE_PATH , seems it was introduced in PHP5.0.0, 1: FILE_USE_INCLUDE_PATH currently collides with LOCK_SH (they're both 1), lets

Re: [PHP-DEV] [VOTE] Locale-independent case conversion

2021-11-25 Thread Hans Henrik Bergan
btw why is this code *not* getting dotted capital i on 3v4l? https://3v4l.org/D1WG1#v7.4.26 it gets ["res_hex"]=> string(2) "49" $str, "str_hex"=>bin2hex($str), "res"=>$res, "res_hex"=>bin2hex($res), ]); ?> On Thu, 25 Nov 2021 at 09:57, Côme Chilliet wrote: > Le jeudi 25 novembre

Re: [PHP-DEV] Proposal: &$result_code=null parameter in shell_exec()

2021-11-18 Thread Hans Henrik Bergan
> then the backtick operator will not behave identically anymore. Am I correct? yeah kindof-correct, the backtick operator would then behave identically to giving shell_exec() only 1 argument, or null as the 2nd argument (btw i'm the guy that made the linked bugs.php.net feature request) while

Re: [PHP-DEV] [RFC] Migrating to GitHub issues

2021-11-15 Thread Hans Henrik Bergan
if hosting it ourself is a priority, i suggest looking into GitLab’s Community Edition, which is entirely open source, and the GNOME project moved from Bugzilla to GitLab CE in 2018, here's how that worked out, 2 years later: https://about.gitlab.com/blog/2020/09/08/gnome-follow-up/ (and the TL;DR

[PHP-DEV] search on bugs.php.net appears to be semi-broken ?

2021-10-30 Thread Hans Henrik Bergan
for whatever reason, searching for "fpassthru" on bugs.php.net does not find https://bugs.php.net/bug.php?id=39135 , titled "fpassthru with optional argument length" - screenshot: https://i.imgur.com/gUjNYBz.png that nearly caused me to make a duplicate of 39135 today

[PHP-DEV] fpassthru should get an optional length argument

2021-10-30 Thread Hans Henrik Bergan
ref https://bugs.php.net/bug.php?id=39135 , i was thinking about how to implement HTTP Range requests/HTTP 206 Partial Content in userland php, and ofc it's possible to implement using fread() loops, but it'd be easier (and faster? presumably) to implement if fpassthru() natively supported a

Re: [PHP-DEV] Deprecation of ext/date ISO8061 constants

2021-10-25 Thread Hans Henrik Bergan
is mailing list: >> > List: php-internals >> > Subject:Re: [PHP-DEV] [RFC] Deprecations for PHP 8.1 >> > From: Nikita Popov >> > Date: 2021-06-15 12:23:50 >> > Message-ID: CAF+90c8wht+LpERZxj-XuY4sAYek8fH9hH_fc+JVZYg_yiAMpw ()

Re: [PHP-DEV] Unbreak git.php.net links?

2021-10-24 Thread Hans Henrik Bergan
. (but if there is no actual https links in the wild, I'm guessing it won't add much value) On Sun, 10 Oct 2021 at 13:10, Ayesh Karunaratne wrote: > > > > S, what's next? > > > > On Tue, 5 Oct 2021 at 18:06, Hans Henrik Bergan > > wrote: > > > > > @Ayesh thanks

  1   2   >