Re: [PHP-DEV] [RFC] Drop support for 32bit builds

2025-07-31 Thread Hans Henrik Bergan
On Mon, 23 Jun 2025 at 13:30, Marc Bennewitz wrote: > > As you can see, the memory usage differences aren't that big but it's > running much slower probably because of unavailable instruction sets on x32. > fwiw it's not the instruction set, it's mostly the registers, x86-64 have double the amoun

Re: [PHP-DEV] [RFC] Drop support for 32bit builds

2025-06-20 Thread Hans Henrik Bergan
On Fri, 20 Jun 2025 at 13:20, Marc Bennewitz wrote: > > > On 19.06.25 18:55, Hans Henrik Bergan wrote: > > On Thu, Jun 19, 2025, 18:24 Ben Ramsey wrote: >> >> > On Jun 19, 2025, at 11:08, Calvin Buckley wrote: >> > >> > On Jun 19, 2025, at

Re: [PHP-DEV] [RFC] Drop support for 32bit builds

2025-06-20 Thread Hans Henrik Bergan
On Fri, 20 Jun 2025 at 09:15, Marc Bennewitz wrote: > > > On 19.06.25 18:08, Calvin Buckley wrote: > > I think the biggest arguments against this would be: > > - embedded systems; think of PHP in use for i.e. router web UIs. While I > suspect a lot of these are going to be i.e. AArch64/RV64 in the

Re: [PHP-DEV] [RFC] Drop support for 32bit builds

2025-06-19 Thread Hans Henrik Bergan
On Thu, Jun 19, 2025, 18:24 Ben Ramsey wrote: > > On Jun 19, 2025, at 11:08, Calvin Buckley wrote: > > > > On Jun 19, 2025, at 11:08 AM, Marc Bennewitz wrote: > >> > >> Hi, > >> > >> During the discussion about the year 2038 issue it turned out that > maybe it's time to drop support for 32-bit

Re: [PHP-DEV] Proposal: Support for RFC4648 in PHP

2025-06-12 Thread Hans Henrik Bergan
On Thu, 12 Jun 2025 at 18:53, ignace nyamagana butera wrote: > > Greetings, > > I have been playing around with an RFC proposal for some time and recently > after discussing it with Tim Düsterhus he has volunteered > to do the implementation so I would like to submit to you an RFC around data >

[PHP-DEV] Can we make str_(starts|ends)_with variadic?

2025-06-10 Thread Hans Henrik Bergan
Can we make str_(starts|ends)_with variadic? PR: https://github.com/php/php-src/pull/18825 Code like ```php if (str_starts_with($url, "http://";) || str_starts_with($url, "https://";)) { // url } if (str_ends_with($filename, ".pdf") || str_ends_with($filename, ".doc") || str_ends_with($filenam

Re: [PHP-DEV] PHP True Async RFC Stage 3

2025-04-16 Thread Hans Henrik Bergan
is "True Async" a fancy way of saying multithreading? Seems like a threading api to me

Re: [PHP-DEV] RFC: blank() Function as a Complement to empty()

2025-04-07 Thread Hans Henrik Bergan
>If this can still be implemented in userland you don't need logic integrated >at low level Afaik it cannot be implemented in userland today. The closest you can get today is to use reference hacks, which introduce side-effects, like if you do function blank(&$value){...} blank($_POST['foo']) an

Re: [PHP-DEV] RFC: blank() Function as a Complement to empty()

2025-04-05 Thread Hans Henrik Bergan
Maybe a #[\SuppressUndefinedWarning] Parameter attribute could work, then everyone could implement their own blank() function with their own preferred logic Not sure if it's technically feasible tho, now the php engine would need to inspect the parameter attributes before deciding on generating a

Re: [PHP-DEV] Closure::getCurrent() for recursion

2025-04-01 Thread Hans Henrik Bergan
@Jorg the desired output is 14. @Morgan $second=function(array $a, callable $first){...}

Re: [PHP-DEV] Looking for a new job

2025-03-18 Thread Hans Henrik Bergan
Notified my employer, but I fear the Russia-Ukraine war prevents hiring from Russia :( @Bilge 1996: PHP is dead, learn ColdFusion 2003: PHP is dead, learn ASP.net 2006: PHP is dead, learn Ruby on Rails 2008: PHP is dead, learn Django 2012: PHP is dead, learn Flask 2013: PHP is dead, learn AngularJ

Re: [PHP-DEV] BLAKE3 hash redux

2025-01-24 Thread Hans Henrik Bergan
On Fri, 24 Jan 2025 at 21:54, Tim Düsterhus wrote: > > Hi > > (Hans, apologies for the duplicate copy, I accidentally did not send the > first reply to the list) > > Am 2025-01-24 20:39, schrieb Hans Henrik Bergan: > > Can we add the BLAKE3 hash? > > > > Cr

[PHP-DEV] BLAKE3 hash redux

2025-01-24 Thread Hans Henrik Bergan
Can we add the BLAKE3 hash? Created a PR here: https://github.com/php/php-src/pull/13194 Created a RFC draft here: https://wiki.php.net/rfc/blake3 BLAKE3 is a cryptographic hash function based on the SHA3-finalist BLAKE, offering SHA3-256-like security at much higher speed. Benchmarks from /ext/h

Re: [PHP-DEV] Inaccurate documentation on return values from native functions

2024-12-02 Thread Hans Henrik Bergan
On Mon, 2 Dec 2024 at 16:16, Christian Schneider wrote: > > Am 02.12.2024 um 13:31 schrieb Rowan Tommins [IMSoP] : > > On 01/12/2024 23:50, mickmackusa wrote: > >> I can appreciate that. Going forward, is there any benefit to preserving > >> the behavior of returning integers beyond -1, 0, and 1

Re: [PHP-DEV] Re: Inaccurate documentation on return values from native functions

2024-12-01 Thread Hans Henrik Bergan
On Sun, Dec 1, 2024, 20:12 Christoph M. Becker wrote: > On 01.12.2024 at 19:26, mickmackusa wrote: > > > On Sun, Dec 1, 2024 at 10:01 PM Gina P. Banyard > wrote: > > > >> This should just have been an issue on the php/doc-en repo. > >> > >> Please open such an issue so that we can track it (or s

Re: [PHP-DEV] Re: Which IDE do you recommend for php-src development?

2024-09-16 Thread Hans Henrik Bergan
+1 for VSCode, I use it practically everywhere these days, HTML/Javascript/TypeScript/PHP/C/C++/Python/Lua, all on VSCode. On Mon, 16 Sept 2024 at 13:07, Barel wrote: > > On Sat, 14 Sept 2024 at 23:44, Barel wrote: >> >> Hi >> >> For C/C++ development I usually use CLion from Jetbrains but I tri

Re: [PHP-DEV] Deprecate ext/curl `CURLOPT_DNS_USE_GLOBAL_CACHE`?

2024-07-29 Thread Hans Henrik Bergan
>make it a no-op for now (and to deprecate for PHP8.5/9.0 whatever is next) Sounds perfect. Fwiw CURLOPT_BINARYTRANSFER was deprecated in 8.4.0alpha without an RFC, but it had been a no-op since 5.1.4 in 2004 On Mon, Jul 29, 2024, 12:23 Christoph M. Becker wrote: > On 28.07.2024 at 19:26, Aye

Re: [PHP-DEV] Inconsistencies between parameter number and index when reflecting a method/function

2024-05-03 Thread Hans Henrik Bergan
On Fri, 3 May 2024 at 17:49, Derick Rethans wrote: > > Which *API* in PHP is 1-indexed? > > cheers, > Derick Certainly isn't normal but found 1 (and only 1!): $stmt = $pdo->prepare('SELECT name FROM users WHERE id = ?'); $stmt->bindParam(1, $id);

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 by

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 fail

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 &g

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 to sl

[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 https://github.com/php/php-src/pull

[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:

[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 P

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 accep

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 -O2

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 portabl

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 > actuall

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 impl

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 b

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
nk 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: > >

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
tions: ["length"=>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? > > > >

[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 BLAKE

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 > > > > ❯ ~/p

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
_unicode" > > ini-option is specifically to scan 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 > > wrot

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

2023-11-28 Thread Hans Henrik Bergan
i-endian encodings (like 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 larg

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 nee

[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: https

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. > https://github.com/php/php-src/issues/1

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
sorry for late. > I confirmed works 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

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 cod

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 17:50,

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

2023-09-12 Thread Hans Henrik Bergan
ash) Cost 14: 140.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 > >

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 | h

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, becaus

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 anyw

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

2023-08-29 Thread Hans Henrik Bergan
9 Aug 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 large

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 h

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

2023-06-14 Thread Hans Henrik Bergan
faster too: https://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-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 all

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 12:17,

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 on

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
7;s just hardcoded in German. (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 ca

[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 we

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 origina

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 P

[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 " . compile_time_routine(function(){return

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: > >

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 sho

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 share

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 still

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 GMT

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 wr

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 preference)

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

2022-12-20 Thread Hans Henrik Bergan
($min === $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) desig

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 pro

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 > wrot

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 > > checke

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 p

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 mi

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 suggestion

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

2022-07-22 Thread Hans Henrik Bergan
ntionally disabled Hyperthreading 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)

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

2022-07-22 Thread Hans Henrik Bergan
Jul 2022 at 01: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 hav

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

2022-07-13 Thread Hans Henrik Bergan
22 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

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

2022-07-12 Thread Hans Henrik Bergan
. On Tue, 12 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 co

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
air assessment 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 port

  1   2   >