« first day (3863 days earlier)      last day (1076 days later) » 
00:00 - 15:0015:00 - 00:00

3:00 PM
..ohno kickstarter is becoming my new Steam (read : money wasting black hole) kickstarter.com/projects/jadelabo/…
 
cmb
@FlávioHeleno if you want to have a look into running Windows builds via GH actions, that would be helpful. You can have a look at .appveyor.yml to see what's done there.
 
@cmb will do :D
 
cmb
cool :)
 
3:15 PM
@JoeWatkins I'm going to add a test to confirm that $callable(?) is and remains equivalent to fromCallable(). Let me know when you're done fiddling so we don't collide. :-)
 
Incident with GitHub Actions ・ GitHub Pages has Partial Outage
 
@beberlei Any objections to PHP respecting current DOM spec and killing DOM strictErrorChecking with fire (i.e. no longer support disabling it)?
 
@NikiC no objections, i assume you intend to deprecate + remove in 9?
 
@beberlei No, I mean unilaterally drop in 8.1
Ignore assignments
 
i can't make a qualified statement of its use out there, so no idea :)
 
3:27 PM
Need to check how it is used in that one symfony test
 
ThW
I mostly see code that ignores XML/HTML errors. I have an wrapper that throws fatal libxml errors as exceptions, but not warnings
 
Ignoring XML/HTML errors is something we can continue to support, though I don't immediately see how strictErrorChecking plays into that. The problematic part is where it converts some dom exceptions into warnings
 
@Crell you go, I'm stopping for a rest a while anyway ...
@NikiC thanks for review, I'm working through it ...
 
ThW
If I mean libxml_use_internal_errors(TRUE) and ignoring the collected errors. Would strictErrorChecking change that (and throw exceptions)?
 
@ThW I don't think so
 
3:53 PM
@JoeWatkins Back at you.
 
ThW
@NikiC it's doesn't seem to affect loadXML() warnings at all - 3v4l.org/ssj4L So the difference should only be specific dom exceptions (and not error) on DOM method calls?
 
@JoeWatkins What are your thoughts on making partial placeholders one-to-one? That is, making f(?) not equivalent to f(?, ?), f(?, ?, ?), etc.
 
@beberlei Do you want to review github.com/php/php-src/pull/6644 ? It's a nice little PR ;)
 
That would reduce its functionality.
 
@Crell How so?
It would require more explicitness, that's for sure.
 
4:08 PM
Right now, you can use partials to reference any callable by name, without worrying about its signature, but the signature still inherits. strpos(?), array_map(?), etc. With what you suggest, I would at least need to know its arity to know how to partial it.
 
The solution seems pretty clear, ? matches exactly 1 argument, ...? matches 0 or more including passing over variadic
 
@Crell A little less convenient there, but writing array_map(?, ?) seems reasonable.
 
I don't see what benefit you get from it. You lose convenience, and gain... nothing that I can see.
 
You must recognise for example that a placeholder ? in a function that accepts no arguments would be perceived as... odd
 
@MarkR f(...?) to make the partial is a bit sub-optimal too.
 
4:15 PM
It would indicate copying every remaining argument, which is just how we use it for ...$ as a parameter type.
 
@MateKocsis declaring these properties just works even when dom has this weird dynamic handlers registered on them already?
 
function foo($x, ...$args) { } to make a function that accepts a variable number of args, $foo(...?) to create a partial that accepts the same number of args as the parent.
 
How is possible TOO_MANY_REDIRECTS only in private browsing mode (tested in Chrome and Firefox)? Where to start looking?
 
@MarkR Right. Though I'm trying to decide what is gained from one-to-one beyond explicitness. My objection is still primarily to named args with placeholders.
 
@Trowski IMO the main benefits are from making it more obvious as to what it's doing. I see a foo(?) and I think it's entirely natural (and obvious) to think it takes one arg
 
4:21 PM
Until you remember that PHP functions always take infinite args, if you want them. :-)
 
Which is why we now have ...$ syntax because it was a godawful design decision many years ago :)
 
@Crell Internal functions don't.
 
@Crell You gain the absence of confusion :)
@Trowski I believe an earlier version of the RFC used f(...) syntax
 
I guess I don't find it confusing. shrug
 
@NikiC Either one, wasn't sure if ... was possible.
I think I prefer the explicitness. $partial = f(?, ?) clearly now declares a closure that calls f and requires two args.
If f requires 3, you may be able to error at declaration rather than call.
If f requires 1 arg, I guess that's fine, because PHP.
 
4:26 PM
What if you don't know what the arity is to begin with?
$callable(?, ...$args); // How many ? do you use there?
 
You should be able to resolve $callable there.
If you can't, the declaration is invalid anyway.
 
You could throw it through reflection, but then... how exactly do you specify a dynamic number of ? You can't.
 
@Crell A dynamic number of ? is declared with ... or ...?
 
Then all you're doing is adding 3 characters to doing what you can already do now, without adding much useful information. I'm -1 here unless Joe has a good argument for it.
 
@Crell You could make a similar argument of "How do I know how to call $callable?"
@Crell But it's unambiguous.
@Crell I'm not really sure what you mean by "How many ? do you use there?" There's 1.
 
4:31 PM
All issues have been resolved!
 
...? is clear I want to except a variadic number of args. ? means 1, and only 1, arg.
 
So, apparently people do register custom stream wrappers to add declare(ticks) to all files github.com/php/php-src/pull/6967#issuecomment-841344456
 
@NikiC O_O
 
I don't know if ? meaning "any amount of arguments" is enough to make me -1 on such a useful feature, but I'd much rather see ...? and kill off the confusion from the start (for those who haven't spent a couple of dozen hours writing and re-writing an RFC on it :-))
 
sigh.gif
@LeviMorrison @JoeWatkins ^^
 
4:43 PM
$x = foo(?, 1, ?) the first ? is one, the second ? is an arbitrary number? I get that the presence of any ? means "copy over all the rest" but that brings us back to foo(?) looking like it requires at least 1 argument. Counterpoint.mp4 :-)
 
@Crell wow. so I barely just succeeded in not adding Yet Another Broken-Ass Way To Cache Images, and sucessfully read the documentation just as I was about to start writing a whole file server from scratch
It's now Apache's problem, and I am very happy
 
I think I agree that ...? would be clearer
the foo(?, 1, ?) example particularly
with the current syntax, you're using the same placeholder with two different meanings in one expression
 
In that example i think the final ? could be omitted, which is back to making it look like it only has 2 args
 
uh, that's even weirder
 
foo(?) = One arg
foo(...?) = All args
foo(1, ...?) = First arg fixed, require all the rest
foo(?, 1, ...?) = First arg required, fixed 2, require all the rest.
 
4:49 PM
yeah, that seems logical to me
then ? has a fixed meaning
otherwise it's doing two jobs: 1) mark this as a partial; 2) if there is something other than a ? after it, stand in for a specific argument
 
@MarkR Yeah, much, much prefer this.
foo(?, 1, ?) = First and third arg required, fixed 2, yes?
 
@FélixGagnon-Grenier A win for everyone, I'd say.
 
5:05 PM
@NikiC stream wrappers around PHP files should honestly be set on fire.
 
@Crell I grow tired of humans, and they're not my problem, they're yours :D
 
:-P
How do you feel about making ? be single-place only and using ...? for arbitrary? I am -1 myself.
 
I'm not really listening to the conversation going on in the bikeshed, I'm too busy ...
 
That's basically what is being requested. Instead of ? meaning "one or more placeholdered params", it means just one, and we'd add ...? ti mean "one or more".
 
* zero or more
 
5:11 PM
? already means zero or more
 
only sometimes though, righT?
 
what ?
 
@JoeWatkins I think the explicitness makes more sense. chat.stackoverflow.com/transcript/message/52202890#52202890
 
e.g. foo(?, 42)
 
Sometimes ? means 1 arg, sometimes it means zero or more.
 
5:12 PM
@JoeWatkins exactly, the request is to make ? only 1, and ...? zero-or-more.
 
what the fuck, why isn't zero or more inclusive of one in your head ?
 
$partial = foo(?, 42); $partial(1, 2, 3); <- where do 2 and 3 go?
 
1 required != zero or more.
 
I presume it's actually equivalent to foo(1, 42, 2, 3), so the ? is in that case standing in for exactly one parameter
 
$partial = foo(?, 42) should declare a closure taking 1 arg.
 
5:13 PM
@JoeWatkins inclusive of one, but not exclusive of 0 and > 1 ( personally don't care, just explaining others PoV )
 
More args are just ignored.
i.e., foo(?, 42) == fn ($value) => foo($value, 42)
foo(?, 42, ...?) == fn ($value, ...$remaining) => foo($value, 42, ...$remaining)
@JoeWatkins ^ This is essentially what we're talking about.
 
that's not the case.

$a = foo(?, 42);

is

$a = function($value, ...$args) { return foo($value, 42, ...$args); }
 
that's the discussion; we think it should be the case
 
@SaifEddinGmati I know. I don't want it to be that.
 
well, more like:

$a = function(...$args) {
[$value, ...$rest] = $args;
return foo($value, 42, ...$rest);
}
 
5:18 PM
the "?" currently stands for "one argument here, and also zero or more arguments somewhere else", which is a bit confusing
 
PHP essentially has an implicit ...$args in every function. I don't think it's unreasonable for partials to work the same way.
 
I don't see the connection
foo(?) and foo(?, 42) currently have different meanings of "?"
 
To quote the docs, re: implicit extra args not defined using ...$args:

Note: It is also possible to achieve variable-length arguments by using func_num_args(), func_get_arg(), and func_get_args() functions. This technique is not recommended as it was used prior to the introduction of the ... token.
 
@IMSoP assuming $a = foo(?, 42) is implemented as "1 argument placeholder", what difference would it make in $a(3, 4, 5);? both are going to be executed the same way, PHP never minds extra arguments
 
@SaifEddinGmati it's different if you run $a()
 
5:22 PM
@Crell So I guess it would be fine for foo(?, 42) to pass through remaining args, fine. But IMO foo(?, 42, ?) should declare a partial that requires two args.
Thinking about it, my objection is that foo(?, 42) == foo(?, 42, ?) == foo(?, 42, ?, ?)
Those should require 1, 2, and 3 args respectively.
 
If the people in this group think it's confusing, what hope do end users have :-)
 
@IMSoP what difference beside different trace?
 
If the underlying function has 3 args, then yes, the partialed function in that case would require 2.
 
5:25 PM
@SaifEddinGmati foo(?, 42) requires an argument, foo(?) does not
 
the only difference is the trace back.
 
$a = foo(?); $a(); calls foo with zero args; $b = foo(?, 42); $b(); throws an ArgumentCountError
note that it's not the signature of foo making the difference, it's purely the fact that "?" is overloaded to mean "exactly one parameter here" when it's not the last argument
 
@IMSoP so you want $a to behave the same way as $b? IMO, $b should be behave like $a
 
@SaifEddinGmati I don't see what other sane behaviour would be for $b
where would the 42 I asked it to fix go? just be ignored?
what if I create a partial like foo(?, 1, ?, 2, ?, 3) and then pass two parameters instead of 3?
 
@IMSoP That's an error because you're missing a parameter.
 
5:30 PM
so is $b = foo(?, 42); $b();
 
why add more special cases?
 
So does this seem reasonable? foo(?, 42) == fn($value, ...$args) => foo($value, 42, ...$args), foo(?, 42, ?) == fn($value1, $value2, ...$args) => foo($value1, 42, $value2, ...$args). foo(?, 42, ...) would be equivalent to foo(?, 42), but allow partials without required args, i.e., foo(...).
 
It seems quite clear to me there is a real gain in intuitive behaviour if ? means exactly 1, and ...? means 0 or more, and this maps almost identically onto ...$args as a parameter, and ...$args to unpack onto the stack.

What is present now works, but as we're going to be using it for decades to come, it's worth discussing if it's the best way of doing it
 
@Trowski yeah, I think that makes sense; I think that leaves the behaviour of extra parameters consistent as Crell argues, but makes the required parameters more obvious
 
5:34 PM
@IMSoP Right, looking for the best of both worlds here.
So if I just want to bind the second param of a 4 parameter function, I can write foo(?, 42) rather than being force to write foo(?, 42, ?, ?).
I think that still makes sense without being overly cumbersome to use.
You can bind the first param only with foo(42, ...?)
Or foo(42, ?), but that partial will error if not given at least 1 param.
Say if foo only required the first, foo(42, ...?) would be correct as the partial could be called without params.
 
which then makes foo(42, ?) and foo(?, 42) consistent in requiring at least one parameter
 
Yes
 
foo(...?, 42) would just be an error in the same way you can't declare function foo(...$args, $something)
 
...? would only be required when binding the 0 - nth params and have no other required params.
 
@Crell Sorry, I'm busy. Would you be kind enough to summarize the sigh?
 
5:42 PM
foo(...?) or foo(42, 73, ...?), but not required for foo(42, ?, 73) as this is equivalent to foo(42, ?, 73, ...?).
...? is there to declare a partial in absence of a ? that would require a param.
 
@LeviMorrison Trowski and IMSoP (I think?) are arguing that ? should not mean "or more" arguments. If you want to match multiple, you should use ...?

Joe doesn't want to deal with it.

I find it a less convenient syntax, because then you would have to use foo(...?) instead of foo(?) to reference an arbitrary function. If anything they discussion above is confusing me way more than the current RFC.
 
Go all family fortunes and ask 100 people what foo(?) means and they'll tell you it expects 1 argument :)
 
I think the proposed change is:
- non-trailing "?" (e.g. foo(?, 42)) keeps its current behaviour of marking a required parameter
- trailing "?" (e.g. foo(42, ?)) no longer has a different meaning; it marks a required parameter as well
- extra arguments are still passed through at call-time, no change needed
- the special case of trailing "?" is replaced by a new syntax, "...?", for use when you have no other placeholders, e.g. foo(...?) and foo(42, ...?)
 
@IMSoP That summarizes it well.
 
foo(...?, 42) is illegal; foo(?, ...?) is allowed but redundant
 
5:49 PM
If extra arguments still pass through, then... that has the same effect as now. The function becomes a partial anyway.
 
the difference is in the number of required arguments to the closure
foo(?, 42) currently requires an arg, but foo(42, ?) doesn't
because "?" has a different meaning when it's the last arg
 
So then the only difference is in the case where you want to pre-supply all arguments, but not actually call it yet? So you'd then have to put ...? at the end instead of ? That... seems even less valuable to me.
 
what? I'm talking about foo(?, 42) and foo(42, ?)
right now, "?" means something different in those two, and that's weird
 
foo(?) == foo(?, ?) == foo(?, ?, ?), enjoy explaining that to most people.
 
The presence of any ? anywhere means pass along the extra arguments, but there's obvious confusion as to ? meaning 1 argument or zero or many arguments, depending on its positioning.
 
6:00 PM
I'd feel better about the definition of ? if foo(?, ?, ?) created a partial that required two args. At least you could say the final ? always means 0 or more, where-as prior ? creates a required arg.
 
Like I asked yesterday:
17 hours ago, by Levi Morrison
function f($a, $b) {/*...*/}
f(?)(1, 2); // what happens?
 
If the final ? means 0 or more, then it becomes more clear.
 
Why should the final one be any different?
 
Or if we used ...? it would be very clear.
@LeviMorrison Because in foo(?, 42) the ? means 1.
 
@LeviMorrison current suggestion is that that would still call f(1, 2)
f(?) would mean at least one parameter is required, but more than one is allowed
the difference would be that f(?)() would be a guaranteed error
but f(...?)() would be allowed
 
6:06 PM
I think ...? is better, even if it does add 3 chars to some uses.
 
I am okay with ? meaning "create an argument in this specific place". I'm not sure about one being the last given arg meaning "and the remainder too".
But still, there implications to work out in error cases.
And other cases, like named parameters.
function f($x, $y) {}
f(x: ?); // what does this mean?
 
isn't the special case for if it's the last arg the current behaviour?
 
My opinion is named args with placeholders should be an error.
 
It's an artefact from having a ? anywhere
 
no, foo(42, ?) explicitly allows zero args
 
6:09 PM
@Trowski Even if we change the meaning of ?, then?
 
I don't know about the implementation, but semantically, a trailing "?" currently has a different meaning from a non-trailing one
 
One of the things @NikiC seemed really excited about was replacing basically all callable syntax with foo(?). Making that syntax more cumbersome doesn't seem like a win.
 
BTW, why ...? instead of just ...
 
yeah, that would work
 
@LeviMorrison Without reordering as some may expect, it should be an error. Then we could support reordering in the future.
@LeviMorrison No reason, ... is fine too.
 
6:11 PM
basically some way to distinguish "required parameter here" and "just be partial I don't care about params" more explicitl than "if it's trailing, don't require it"
 
foo(...) to declare a 0 or more arg partial seems fine IMO.
 
@Trowski Tell me what it should mean in such a future.
 
/me needs to go get lunch. Peace out for now.
 
no such future is practically possible
this is not a productive area of discussion
 
Named arguments are inherently not positional, so I tend to agree with Joe.
 
6:13 PM
Methinks you might find yourself in the minority in that view Joe
 
Then there's no point to using them in a partial declaration, so make it an error.
For the placeholders that is, it's fine for the bound args.
 
it's not a view based on opinions, it's a view, based on knowledge of the thing we're changing ... it's not practically possible ...
 
I don't care about reordering, don't want it. I just don't want people to think they can do it.
 
@JoeWatkins Just in case I've lost the plot, are you talking about argument re-ordering, or the ? = 1 arg thing
 
documentation can educate people without placing arbitrary restrictions like "named parameters should not be supported" on the implementation ...
reordering
nothing being said is a clear win with regard to changing the meaning or number of placeholders ...
 
6:18 PM
Ah ok, sorry my previous comment was based on ? = 1 arg
 
7:04 PM
Wait, are you guys still trying to argue that pretending to support named arguments is better than a sensible error?
Woof.
 
Well, most of the conversation was about making ? one-to-one, but yes, named arguments came up again.
 
The specifics about ? representing a bound positional arg versus a "hole" is at least a matter of opinion and worth arguing over. Shipping a known buggy implementation is just objectively bad, and I honestly don't understand attempts to argue for that.
 
FWIW I agree that the named args handling is wrong
 
7:26 PM
@NikiC Any thoughts on this schema: chat.stackoverflow.com/transcript/message/52203170#52203170 ...? could be ... instead.
 
8:08 PM
@Crell Only userland functions behahe that way
 
8:19 PM
@Girgias I can see the argument for partials to automatically forward extra args.
 
I haven't read the proposal, just pointing out that internal functions will throw when you pass them more arguments then what they take :)
And frankly I think this behaviour of automatic passing of arguments passed their required one should be deprecated too for userland functions, but partials could be a way to reintroduce this
In a more saneTM way
 
Yep, so $partial = strlen(?); $length = $partial($string, $extra); will still throw.
 
Yeah, really need to read the RFC
but not tonight
 
It wouldn't be the call to $partial that throws, but the call within the partial to strlen.
 
Yeah that makes sense
 
8:26 PM
nobody asked but even so I cannot recommend this album highly enough open.spotify.com/album/…
still, 15 years later
 
@DaveRandom never heard about them before, enjoying the music so far :)
 
8:44 PM
<3
 
9:20 PM
Phpstan does not finish on Windows when opcache is enabled ・ opcache ・ #81041
 
 
1 hour later…
10:35 PM
So you know how phpsadness.com exists? Turns out no-one had registered jssadness.com
3
 
so you did
 
How could I not?
 
😂
 
10:48 PM
Be nice...
 
probably going to i) add some stuff from jamie.build/const ii) NPM iii) get in touch with the phpsadness guy again, as it's annoying he doesn't accept PRs for stuff that is fixed.
 
or just buy phpgreatness and list them all :-D
 
@Crell I'm almost always nice......it just sometimes takes a few years for people to realise that I wasn't trying to be nasty.
@MarkR not sure whether to go with '404 not found' or '501 unexpected T_PAAMAYIM_NEKUDOTAYIM'.
 
Just make sure to add a X-Powered-By for PHP 6.0
 
11:36 PM
open_basedir does not work as it should ・ *Directory/Filesystem functions ・ #81042
 
@PeeHaa About to stream my custom keyboard build!
 
00:00 - 15:0015:00 - 00:00

« first day (3863 days earlier)      last day (1076 days later) »