« first day (4735 days earlier)      last day (346 days later) » 

6:15 AM
posted on October 03, 2023

 
1 hour later…
7:39 AM
@Derick @nielsdos is the author. I just had quite a few opinions on it :-p
@IluTov thanks for letting me know. I'm not interested in a larger refactor when smaller, inconsequential changes create such noise in my day, and likely yours.
8:04 AM
@TimWolla Well, @nielsdos also didn't pick an opinion for a secondary vote :-)
My opinion on the second vote is that by respecting the external entity loader we are consistent with the existing behaviour people are used to, so it is the least surprising option. But I wouldn't be opposed to not respecting this if people find the current behaviour sufficiently annoying.
I just put my vote out on it.
8:28 AM
Let me re-read that section again. It was late last night.
I think the entity loader disabling is a security feature. As it has no impact on HTML5Document, I have voted "no" to it. It's just going to be another annoyance.
8:53 AM
@nielsdos BTW, did you manage to have a look at the security advisory wrt parsing HTML? Does anything need doing besides updating the docs?
@Derick I replied on the report some time ago, and I think updating the docs is the only thing we can do unfortunately...
OK! I'll get that sorted then. I might pass the text by you, if you're ok with that?
@Derick of course!
 
2 hours later…
11:01 AM
@nielsdos "WarningThe HTML parser in the DOM extension parses HTML 4, which is based on XML. It does not implement an HTML 5 parser, which is what modern browsers use.Therefore, you MUST NOT use the HTML 4 parser that is part of this extension for sanitizing HTML.
" — that OK? I'm suggesting to add that to loadHTML and loadHTMLFile.
11:14 AM
I'll reply on Slack
11:27 AM
@Derick That message doesn't make sense to me (as someone who coded for the web in the HTML4 and XHTML eras). HTML4 (in practice) is not remotely based on XML. If anything, I would say HTML5 as a closer relationship to XML than HTML4 does (for one thing, "XHTML5" is a thing while HTML4 predates even XHTML and was/is often "Tag Soup"). I think it would be helpful to include (links to) some information on what/why people can expect it to break.
 
3 hours later…
2:22 PM
@MrMesees Small PRs are a valid strategy if they make sense on their own, or if they are part of a larger strategy. It would be easier to merge parts of your work in separate PRs. E.g. GITHUB_ACTIONS -> CI, %~d0 -> %SCRIPT_DRIVE%, createdb.exe -> CREATE DATABASE test, etc. I don't agree with some parts like the bats, instructions, etc. This will block all changes.
*the new bats
 
1 hour later…
3:49 PM
@IluTov After thinking about it more, and looking at various cases... I am reminded that I hate references.
Don't we all
@LeviMorrison Solid conclusion ^^
I want block expressions to be a thing. I think that by-value binding for closures is still correct by default.
After examining everything again, I think you just don't allow by-ref in short functions. If you need it, use a long one. Kinda sucks if you have to switch from short to long but... I don't see a better way forward.
The only thing I can think of is if we add something like Hack's Ref but it would have to auto-deref to the right underlying type, and I'm not sure about that.
Basically, "box" the value type and then capture it "by-value" and you get the result you want. But then you have to deal with unboxing...
Internally, references essentially are a stripped down object. I wonder if it could be feasible to coerce them without much penalty into an object, and then expose that as PHP\Ref or something...
4:20 PM
Boxing means adjusting the outer scope to unwrap the value, unless you mean Ref<native_ref<T>> where the value in the outer scope can remain unboxed. Alternatively Ref would require auto-unwrapping, but I don't think that's a good idea.
Basically expose zend_reference as a userland type that you can explicitly opt into. Something like:
@LeviMorrison That is the same conclusion I have. If you want to do impure things with references, your code will be longer and uglier. As it should be, because doing impure things with references is ugly.
is trying not to have impure thoughts
<?php
use PHP\Ref;

$lookup_table = Ref::new([]);
$add = fn(string $x) => {
  $lookup_table[$x] = true;
};
The only difference between this and a regular reference, is that it gets auto-captured by reference instead of by value. Dunno, it's a half-baked idea, but could be useful.
5:03 PM
I felt a great disturbance in the force, as if someone reopened the PHP\ namespace debate :P
@LeviMorrison I guess this could work if Ref can store actual references. Otherwise there would be certain limitations. E.g. if I already got passed a reference, I could not wrap the reference into Ref to pass it to an arrow function without detaching it from the original reference.
5:34 PM
Aren't there extensions out there who do weird things with internal functions? Like they make some at runtime? I seem to remember this when implementing observers but can't remember details.
@LeviMorrison runkit maybe?
I was thinking something less crazy, like PDO.
Making functions at runtime seems unlikely
PDO does wrap arguments as reference if the constructor for the class uses by ref args
Which is the only place this happens AFAIK
Or do you mean that certain drivers will have certain functions?
That would be fixed by Dan's subclassing RFC but that didn't land in 8.3 because for some reason PHPDBG fails with that PR
And ... idk who understands it
@Crell @Girgias github.com/php/doc-de/pull/161#discussion_r1344490778 / php.net/manual/en/function.crypt.php. Can you tell me whether the comment within the example is clear to a native speaker of English?
Because apparently it caused confusion for the German translation.
Let me look at it, I do speak German so I can also read the translated version
> for compatibility with non-PHP software.
reads correct to me
5:44 PM
I was asking about “clear” rather than “correct”, i.e. could it be misunderstood by a native speaker?
Even if it's grammatically correct, it might be unclear / ambiguous.
IDK what else you'd put there
Okay, thank you. Then it's probably just a misunderstanding from Martin as not-a-native-English-speaker.
Except if you want to rephrase the whole thing as
> [...] hash to ensure compatibility with non-PHP software
ensure -> enable?
No no ensure is what I meant
But the current phrasing reads clear to me
5:50 PM
Okay, let's wait for Martin's response. Otherwise "Validate an existing crypt() hash to interoperate with non-PHP software." might also work.
Yeah that would also work
@LeviMorrison Xdebug overrides a few, such as var_dump
@Derick Do you just override the internal handler inside the zend internal function?
no
I replace the entry in the symbol table.
but maybe not run-time.
Compile-time is not a worry for what I'm doing.
5:59 PM
it's even earlier... on minit
That's what I actually meant >.<
@LeviMorrison Did you see the conversation I had with @bwoebi about observers last week?
@Derick Internal observers, IIRC?
I have a problem where something short circuits an include/require, if all functions and classes can be early bound, it is skipped.
internal observers now work.
Ah. Any ideas to work-around or fix this yet?
@Derick What functionality do you need here?
four messages later he shows some code that when execute_ex is overridden, it doesn't short cut.... I want that for observers too (but I suspect, you don't)
Like... if it's not actually executed, why do you need this hook? I understand it's a difference from zend_execute_ex, but what functionality do you need there?
it is so xdebug can have it in traces showing these "include" file calls — it's how it always worked with overriding execute_ex. And I can't seem to replicate it with observers.
I got to run, making dinner.
6:23 PM
@Derick If they aren't executed, why do they need to be in the trace? Again, I understand it's a difference, but what is the point? I'm being genuine, sometimes that gets lost in written text.
7:23 PM
@TimWolla I don't know what "compatibility for non-PHP software" means in context. That would be my main concern. The grammar of it is fine.
7:35 PM
...it's been a long week already. o/
 
1 hour later…
8:55 PM
Is there a PHP library that will help filter technically correct, but still invalid emails? EG: [email protected] or somesuch?
The only way to check an email is valid is to send an email
3
Yeah, were a sales org and my boss is concerned about our email reputation to keep us out of spam folders :(
apparently, sending too many undeliverable emails ear marks you as such
9:30 PM
You need a mailer provider that will provide it to you
10:06 PM
You can check that it has correct address format, but that's it. To know, you have to send.
@Crell crypt() is a standard algorithm that is broadly compatible with effectively everything out there, specifically the operating system's /etc/shadow. The password_* APIs might not.
So if you want to interoperate with such software you better use crypt() directly (even if password_verify can technically validate those hashes).
As an example, my latest info is that Linux distributions don't support BCrypt as the hash algorithm for local users, because glibc does not implement BCrypt for crypt. Don't know if that changed by now.
Perhaps something like "Validate an existing crypt() hash in a way that is compatible with non-PHP software." ?
Sold. I'll PR that and you may approve :-)
lol
Your suggestion also translates to German more nicely.
10:21 PM
Shall I merge then?
Feel free if you're happy.
:merge emoji:
I'll definitely also request a language and comprehensibility review once I've finished writing the docs for Randomizer::getFloat(). That thing is going to be complicated, because floats are complicated :-D
@Crell While you're at it, github.com/php/doc-en/pull/2817 is also pending the merge. I'd press the button, but I don't know if you're waiting intentionally.
Merged. :-)
10:43 PM
@LeviMorrison It's a BC break. They're currently in traces as "functions". After moving from execute_ex to observers, they are not.
11:31 PM
@MateKocsis Am I reading the docs on the Zen container correctly that autowiring is entirely opt in? You have to stick an attribute on a property to make it auto-inject?

« first day (4735 days earlier)      last day (346 days later) »