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

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

2021-10-11 Thread Hans Henrik Bergan
dang, yeah completely missed that, sorry On Mon, 11 Oct 2021 at 13:14, Tim Starling wrote: > On 11/10/21 9:33 pm, Hans Henrik Bergan wrote: > > @Nicolas i hope mediawiki doesn't run on Windows, because that > > escapeshellarg-replacement you did is not valid for windows. >

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

2021-10-11 Thread Hans Henrik Bergan
@Nicolas i hope mediawiki doesn't run on Windows, because that escapeshellarg-replacement you did is not valid for windows. the code prints: echo 'foo && whoami && echo ' and when i run that in bash i get: C:\Users\hansh>echo 'foo && whoami && echo ' 'foo laptop-1plmku02\hansh ' - whoami was

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

2021-10-08 Thread Hans Henrik Bergan
S, what's next? On Tue, 5 Oct 2021 at 18:06, Hans Henrik Bergan wrote: > @Ayesh thanks, added support for those url ( > https://github.com/divinity76/git-php-net-redirector/commit/072a579d140a7481e76e95bd8c2d120ee2f71565 > ), also it looks like version numbers got mixed up in you

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

2021-10-05 Thread Hans Henrik Bergan
ee to make > > something better (also i have no idea how the "p" argument is supposed to > > be parsed, so i just guessed) > > > > it passes "Stanislav Malyshev"'s initial sample url, but it probably > fails > > on any other formats, if anyone h

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

2021-10-04 Thread Hans Henrik Bergan
st guessed) it passes "Stanislav Malyshev"'s initial sample url, but it probably fails on any other formats, if anyone has test urls, share em On Mon, 4 Oct 2021 at 08:38, Hans Henrik Bergan wrote: > >So who's going to work on it? Doesn't make sense to have 5 people work > > on

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

2021-10-04 Thread Hans Henrik Bergan
Mon, 4 Oct 2021 at 08:01, Andreas Heigl wrote: > Hey all. > > On 04.10.21 07:52, Hans Henrik Bergan wrote: > > there's also plenty of broken links on reddit to git.php.net , ref > > https://www.google.com/search?q=git.php.net+site%3Areddit.com > > > > it wouldn't

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

2021-10-03 Thread Hans Henrik Bergan
there's also plenty of broken links on reddit to git.php.net , ref https://www.google.com/search?q=git.php.net+site%3Areddit.com it wouldn't be hard to set up a redirector parsing commit ids out of the url and redirecting to github, +1 from me. On Mon, 4 Oct 2021 at 07:04, Stanislav Malyshev

Re: [PHP-DEV] DateTimeZone silently falls back to UTC when providing seconds

2021-09-13 Thread Hans Henrik Bergan
>What use-case does that serve? if some country want to change their timezone for whatever reason, to some timezone that didn't exist previously, could happen at any time really On Mon, 13 Sept 2021 at 13:32, Hans Henrik Bergan wrote: > > What use-case does that serve? > > if so

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-07 Thread Hans Henrik Bergan
WSL1 or WSL2? afaik they have significant performance differences, and we should only consider WSL2 as WSL1 is being deprecated afaik On Tue, 7 Sept 2021 at 12:31, Kamil Tekiela wrote: > > It would be great if someone on > Windows and macos could repeat this experiment > > I ran this on Windows

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Hans Henrik Bergan
PS i've seen *HORRIBLE* fs performance for php-running-on-windows, where the same filesystem operations on the same files took like 5 seconds on linux-running-on-vmware-on-laptop-running-windows-10, versus several minutes for the same operation on the same laptop on windows 10 directly.. for

Re: [PHP-DEV] Unwrap reference after foreach

2021-08-14 Thread Hans Henrik Bergan
well today you can do foreach($it as &$value){...} unset($value); - which is pretty close, but it will break with $value="initial";foreach($it as &$value){...}unset($value); echo $value; here $value will not be "initial", it will be undefined, however you *CAN* do

Re: [PHP-DEV] Unwrap reference after foreach

2021-08-14 Thread Hans Henrik Bergan
Speaking of, i hope that one day we can support javascript-style let in php :) like foreach($it as let &$v){} but that's a discussion for another thread (and i'm sure it has been discussed before, i haven't actually checked though) On Sat, 14 Aug 2021 at 15:23, Hossein Baghayi wrote: > On Fri,

Re: [PHP-DEV] Unwrap reference after foreach

2021-08-13 Thread Hans Henrik Bergan
+1 from me, and yeah lets not care about that edge case, i hope the edge gets removed at some point.. (but that's an issue for another thread) FWIW if attempts at getting it in 8.2 fails, i would welcome another attempt at this for PHP9 On Fri, 13 Aug 2021 at 15:29, Nikita Popov wrote: > Hi

[PHP-DEV] mb_check_encoding slow performance?

2021-08-07 Thread Hans Henrik Bergan
not sure if this message belongs on php-gene...@lists.php.net or internals@lists.php.net or elsewhere, i'll just try here first and see what happens, recently made some tests to check performance of UTF8 validators, and in that (simple non-comprehensive) test, preg_match() is ~33 times faster

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

2021-08-06 Thread Hans Henrik Bergan
btw why isn't foo.bar=123 decoded to array("foo.bar"=>123); ? this looks pretty bad to me https://3v4l.org/6Wa23 On Fri, 6 Aug 2021 at 10:29, Peter Bowyer wrote: > On Fri, 6 Aug 2021 at 08:18, ignace nyamagana butera > wrote: > > > I read your RFC and I understand the intent in improving the

Re: [PHP-DEV] [RFC] Under Discussion: Default User-Agent for cURL

2021-08-03 Thread Hans Henrik Bergan
> > or doing nothing at all. > Sounds good to me. On Tue, 3 Aug 2021 at 16:47, Sara Golemon wrote: > On Tue, Aug 3, 2021 at 4:45 AM Hans Henrik Bergan > wrote: > >> fwiw i think no self-respecting codebase is depending on an ini-setting >> being correct fo

Re: [PHP-DEV] [RFC] Under Discussion: Default User-Agent for cURL

2021-08-03 Thread Hans Henrik Bergan
fwiw i think no self-respecting codebase is depending on an ini-setting being correct for the ua in cases where the ua is actually important, so the breakage should be minimal. On Sun, 27 Jun 2021 at 09:25, Aleksander Machniak wrote: > On 27.06.2021 08:48, Michael Maroszek wrote: > > That's

Re: [PHP-DEV] [RFC] [VOTE] is_literal

2021-07-17 Thread Hans Henrik Bergan
, Craig Francis wrote: > On Fri, 16 Jul 2021 at 21:24, Hans Henrik Bergan > wrote: > >> short of a bug in esc_like(), i don't even see the vulnerability issue in >> that code? >> > > > Sorry Hans, I copied the wrong diff. > > There were only 2 changes fro

Re: [PHP-DEV] [RFC] [VOTE] is_literal

2021-07-16 Thread Hans Henrik Bergan
short of a bug in esc_like(), i don't even see the vulnerability issue in that code? that sanitize call looks like a data corruption issue and i bet it fails to search for binary data, but i don't see the critical vulnerability?

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

2021-06-22 Thread Hans Henrik Bergan
How is one supposed to use this? like if(!is_trusted($val)){ $val = htmlentities($str, ENT_QUOTES | ENT_HTML401 | ENT_SUBSTITUTE | ENT_DISALLOWED, 'UTF-8', true); } echo "$val"; (...) if(!is_trusted($val)){ $val = $mysqli->real_escape_string($val); } $mysqli->query("INSERT INTO tbl

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

2021-06-15 Thread Hans Henrik Bergan
15 Jun 2021 at 14:24, Nikita Popov wrote: > On Tue, Jun 15, 2021 at 12:48 PM Hans Henrik Bergan > wrote: > >> i don't like this part of the RFC: >> >> > There's a number of bug reports related to this. From what I understand, >> the core problem here is not tha

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

2021-06-15 Thread Hans Henrik Bergan
i don't like this part of the RFC: > There's a number of bug reports related to this. From what I understand, the core problem here is not that the ISO8601 format is *wrong*, it's just one of multiple legal ISO-8601 formats. As DateTime formats always refer to a specific format, not a set of

Re: [PHP-DEV] A little syntactic sugar on array_* function calls?

2021-05-25 Thread Hans Henrik Bergan
fwiw this can be implemented in userland, and i bet someone already made a composer package for it ^^ On Tue, 25 May 2021 at 11:20, Karoly Negyesi wrote: > Hi, > > I was wondering whether $array->map($somefunction) would be possible. I am > not a C programmer by any stretch but reading

Re: [PHP-DEV] [VOTE] Deprecate implicit non-integer-compatible float to int conversions

2021-04-17 Thread Hans Henrik Bergan
just want to double check, 1.009 will then be an incompatible cast to int(1), right? because the 0.009 will be lost? On Wed, 14 Apr 2021 at 13:41, G. P. B. wrote: > On Thu, 1 Apr 2021 at 12:39, G. P. B. wrote: > > > Hello internals, > > > > It's been a couple of weeks

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

2021-03-22 Thread Hans Henrik Bergan
i would prefer to soft-deprecate them like we did with the mysql_ api, where they do not generate E_DEPRECATED for quite some time, but the documentation say "this function is deprecated, instead use mb_convert_encoding ( $str , "UTF-8", "ISO-8859-1" ); or iconv("ISO-8859-1","UTF-8", $str)" and..

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-03 Thread Hans Henrik Bergan
if FWIW if DateTime::__toString() was just function __toString():string{ return $this->format(\DateTime::RFC3339); } i certainly wouldn't complain. On Wed, 3 Mar 2021 at 12:16, Bruce Weirdan wrote: > On Wed, Mar 3, 2021 at 1:07 PM Moritz Friedrich wrote: > > > but I’m not too fond of the

[PHP-DEV] support for BLAKE3 hash?

2021-02-24 Thread Hans Henrik Bergan
BLAKE3 is a very fast cryptographically secure hash algorithm, when i run this implementation https://github.com/php/php-src/pull/6358 against ext/hash/bench.php on an i7-8565U, it's competing against adler32 in performance, and it's significantly faster than every other cryptographic hash (~2.6

Re: [PHP-DEV] password_verify() and unknown algos

2021-01-30 Thread Hans Henrik Bergan
PASSWORD_THROW_ON_ERROR password_verify ( string $password , string $hash, int $flags = 0 ) : bool On Fri, 29 Jan 2021 at 16:01, Benjamin Morel wrote: > Hi all, thanks for the constructive feedback. > > On Fri, 29 Jan 2021 at 15:52, Marco Pivetta wrote: > > > > > Gonna be the usual person

Re: [PHP-DEV] ENT_COMPAT for htmlentities and htmlspecialchars

2020-12-26 Thread Hans Henrik Bergan
FWIW i'm surprised with the lack of ENT_DISALLOWED , personally i use tohtml(string $str):string{ return htmlentities($str, ENT_QUOTES | ENT_HTML401 | ENT_SUBSTITUTE | ENT_DISALLOWED, 'UTF-8', true);} On Sat, 26 Dec 2020 at 12:03, Craig Francis wrote: > Hi, > > Could htmlspecialchars() use

[PHP-DEV] why doesn't file_get_contents() support LOCK_SH ?

2020-12-14 Thread Hans Henrik Bergan
given that file_put_contents() supports LOCK_EX -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Restrict $GLOBALS usage

2020-12-04 Thread Hans Henrik Bergan
if this gets rid of a significant amount of implementation complexity or runtime overhead, i'm all for it, and don't think i've ever seen code like $GLOBALS = []; before, given that it's technically a BC break, would have been nice as a 8.0.0 thing, but i hope it's small enough for an 8.x instead

Re: [PHP-DEV] Re: PHP 8 is_file/is_dir and imagecreatefromstring()

2020-12-02 Thread Hans Henrik Bergan
so.. will the imagecreatefromstring() thing be fixed in 8.0.1 or 8.1.0 ? On Wed, 2 Dec 2020 at 10:57, Nikita Popov wrote: > > On Wed, Dec 2, 2020 at 10:21 AM Aimeos | Norbert Sendetzky < > norb...@aimeos.com> wrote: > > > Am 01.12.20 um 18:24 schrieb Christoph M. Becker: > > > On 01.12.2020 at

Re: [PHP-DEV] [RFC] Draft - Closure self reference

2020-11-11 Thread Hans Henrik Bergan
if i have understood the "as"-suggestion correctly: $fn = function() as $lambdaOrAnyName {var_dump($lambdaOrAnyName);}; (function() as $lambdaOrAnyName{var_dump($lambdaOrAnyName);})(); then that syntax is fine with me. this is also very close to how it works in JavaScript (except the "as"

Re: [PHP-DEV] [RFC] Draft - Closure self reference

2020-11-10 Thread Hans Henrik Bergan
something i'm missing from Javascript is the ability to give names to closures, this both gives closures the ability to reference themselves, but it also makes for meaningful stack traces, eg this is legal javascript: (function TheClosuresLocalName(){console.log(TheClosuresLocalName); throw new

Re: [PHP-DEV] Rename PhpToken::getAll()?

2020-11-07 Thread Hans Henrik Bergan
+1 for ::tokenize() -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Re: hash BLAKE3

2020-10-31 Thread Hans Henrik Bergan
@Levi > However, I still see CPU related code in get_cpu_features. Are you > sure you pushed the right thing? I think it's correct, yes, the problem is ext/hash/blake3/blake3_dispatch.c, which is just a copypaste of the upstream

[PHP-DEV] Re: hash BLAKE3

2020-10-30 Thread Hans Henrik Bergan
est secure hash on the list, for exact numbers check the PR. thoughts? On Wed, 21 Oct 2020 at 21:34, Hans Henrik Bergan wrote: > > i want BLAKE3 hash support in php, > > some justifications can be found here https://bugs.php.net/bug.php?id=79492 > primary reasons being that it's a

Re: [PHP-DEV] why is non-crypto hashes excluded from/ext/hash/bench.php ?

2020-10-27 Thread Hans Henrik Bergan
PR to make it "a constant number of bytes to hash" here: https://github.com/php/php-src/pull/6386 .. was bugging me -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] why is non-crypto hashes excluded from/ext/hash/bench.php ?

2020-10-26 Thread Hans Henrik Bergan
@Christoph M. Becker haha that's probably it, i guess that long ago PHP didn't have any non-crypto hash algos, one of the results read "256MB Windows 2000" when was the last time someone rolled a 256MB ram windows 2000? (am rolling some 128MB ram VPS's, but rolling Windows with such amounts of

Re: [PHP-DEV] why is non-crypto hashes excluded from /ext/hash/bench.php ?

2020-10-26 Thread Hans Henrik Bergan
@Nikita Popov > How did you draw the conclusion that non-crypto hashes are not included? yeah i know they're there when you run them, but if you look at the benchmarks in the source code, from line 4 - 71, all the non-crypto hashes are absent there,

[PHP-DEV] why is non-crypto hashes excluded from /ext/hash/bench.php ?

2020-10-24 Thread Hans Henrik Bergan
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Is there any interest for object constructor shorthand*just for stdClass*

2020-10-22 Thread Hans Henrik Bergan
@Rowan Tommins not saying this is a good idea or anything, but i just want to point out that there's another way to do it in 7.4 $object = new class($foo, $foo * 2, $nextBaz) { public int $foo; public int $bar; public int $baz; public function __construct($foo, $bar, $baz) {

[PHP-DEV] hash BLAKE3

2020-10-21 Thread Hans Henrik Bergan
i want BLAKE3 hash support in php, some justifications can be found here https://bugs.php.net/bug.php?id=79492 primary reasons being that it's a "cryptographically secure hash", predecessor BLAKE was nearly crowned "SHA3" (SHA3 finalist), and it's very fast in software, when i run it against

Re: [PHP-DEV] Re: want an Object-oriented interface for HashContext

2020-10-21 Thread Hans Henrik Bergan
@Rowan Tommins >I think I'd prefer to drop the fluent interface (returning void on most > things, and relevant values on others) well both approaches has pros and cons, that said, the sample implementation Sara posted returns $this, if you (or anyone) feels strongly about it one way or the

Re: [PHP-DEV] Re: want an Object-oriented interface for HashContext

2020-10-13 Thread Hans Henrik Bergan
On Tue, 13 Oct 2020 at 10:43, Hans Henrik Bergan > wrote: > > > i know this is unrelated to the thread at hand, but am i really > > supposed to find the email of everyone who has replied to a thread, > > and add them all manually to cc? > > > > > Nope, just

Re: [PHP-DEV] Re: want an Object-oriented interface for HashContext

2020-10-13 Thread Hans Henrik Bergan
i know this is unrelated to the thread at hand, but am i really supposed to find the email of everyone who has replied to a thread, and add them all manually to cc? (or is it sufficient to just send it to intern...@list.php.net ? ) (also funfact, it seems if you regex the innerHTML after opening

[PHP-DEV] want an Object-oriented interface for HashContext

2020-10-12 Thread Hans Henrik Bergan
something like $result = (new HashContext("SHA1"))->update($str1)->update($str2)->final(); (userland sample imp: https://3v4l.org/lXd3u ) I tried asking on the bugtracker ( https://bugs.php.net/bug.php?id=80221 ) , but was told to ask on this mailing list instead. -- PHP Internals - PHP

<    1   2