« first day (3493 days earlier)      last day (1681 days later) » 
00:00 - 21:0021:00 - 00:00

00:12
The question is if we'll every find a perfect solution. Using different platforms for different things is fine. Rust for example uses Discourse for discussions and Discord for chatting. I'm a big fan of not reinventing the wheel, if it works for others it's probably gonna work for us. Even if not perfect, it would be 100x better than the status quo.
Again, these are just random thoughts. I know you've put way more thought into this and also have way more experience with the mailing list in general.
@IluTov My experience with Discourse trying to host it is that it 's a steaming pile of crap. At least from a CI/CD hosting perspective...
I also quite dislike the interface.
@Crell Haha there's a reason I'm not a sysadmin :P
I'm always surprised by these tools, Sentry for example is fantastic to use, piece of crap to install and maintain.
You can host your own Mattermost quite easily.
(And it does install decently; at least we have a ready-made template for it at Platform.sh.)
@Crell Sounds good too :) I have no experience with either but Mattermost looks very nice at first glance.
We have a one-click install for it at Platform.sh. (30 day free trial, costs after that.)
Although if it actually gets used for PHP dev, we have a program to sponsor sites for OSS community efforts.
Gotta go for the night. Dinner time. (Let me know if you want to play around with hosting stuff. As I said, we're happy to sponsor hosting for community tools that actually get used. :-) )
00:31
@Crell That sounds great!
@Crell I don't want to interfere with what @Danack has planned (as he's put way more thought into this). But in case he needs somebody to help test and explore I'm happy to help :)
And good night :)
thumbsup.gif
> And, finally, you have to find a way to spare the group from scale.
The way that the code in open source projects is forkable, but the communication channels used by the each project is not, is one of the root mistakes.
 
3 hours later…
03:33
@Crell Will need a new opcode or three, methinks. One that will instead of initing a function call, it fetches the function. Then instead of sending vals, one that bind the given parameters by slot. Then, instead of calling the function, it makes a closure.
/cc @NikiC. Not sure if there are better ideas for that such as perhaps doing some of it at compile time.
Is there any way to update a table and return the old values in mysql?
If you can give me very explicit instructions I can give it a try, but I will likely need very detailed instructions. :-)
@DemCodeLines I don't believe so. At least not that I recall.
03:57
@DemCodeLines can you store the old values in memory before updating? Or is it something explicitly in MySQL? You may also want to look up stored procedures, that may point you in the direction
(I don't actually know if stored procedures will do the trick, I'm going by what I know about stored procedures in PL/SQL, which is an Oracle language, and MySQL has been owned by Oracle for awhile)
04:55
@Crell If I could give you that level of detail I would have already implemented it ;)
Also, I don't have time :'(
fcalls work basically by an opcode pattern of _INIT_, followed by SEND_ for each arg, then _XCALL_ which does the call, where XCALL could be UCALL, ICALL, FCALL, or FCALL_BY_NAME
I'm not entirely sure what INIT does, but at minimum if fetches the function; we'd need this bit. But instead of starting to make a call frame, it would instead make a closure, then each parameter would need bound instead of SEND_ (can look at what a closure does with use($var) to some degree, but there will be pioneering here because we need to bind it to a particular slot). I don't know if we need an equivalent of FCALL.
In the grammar you have to recognize ? and ... somehow and either emit a different AST or flag it differently and then in either case handle it in the compiler to emit the described opcode sequence above.
About all the detail I can give.
 
4 hours later…
09:12
@LeviMorrison @Crell Without having thought too much about it, I think the most promising approach would be to mostly leave it as a normal function call and only add one custom SEND for the placeholders and a custom DO_FCALL opcode
That is, create a normal call frame and then convert it into a closure retroactively
Otherwise the change is going to be too intrusive
 
1 hour later…
11:14
Question for English speakers not raised in the UK - how familiar is the word 'wibbling' to you? Example usage: "John spent 10 minutes wibbling about the proposed syntax".
@Danack I am English and I had to look this up.
@Danack Not familiar, from context I'd infer thinking, going in circles mentally, being a bit at unrest
wibbly wobbly timey whimey?
I'm an economic migrant, and I would have gotten it
So, when someone has been talking for a while in manner that started off well, but then they realise that they have just been performing a brain-dump rather than saying anything conclusive: "don't mind me, I think I'm just wibbling here." - is there any equivalent-ish saying in other languages?
@Linux4Life531 Hmm. It's a perfectly cromulent word.
11:31
@Danack potentially :-)
GoogleTranslate puts it as "wankelen" in Dutch. I guess that works.
(which is pretty much wobbly)
@Danack what's the difference between "wibbling" and "rambling"?
"Wibble" > "to wobble". Do they also describe "Wobble" as "to wibble" ? :P
11:53
@Sjon scale mostly. Rambling goes on to other topics, wibbling gets tied up in smaller and smaller details. But both mean the conversation isn't progressing usefully.
12:03
@Danack ah, thanks
12:44
@Danack, Yeah, probably just so used to PHP that I have forgotten half of English.
13:01
possibly of interest, easy to use meeting joiner for mac: twitter.com/pr0duktiv/status/1258949023010086913
13:26
I was just pondering the partial application discussion above, and thinking that you can almost do it entirely as an AST transform
because in the simple case $x = foo($a, ?, 42); can be mechanically transformed to something like $x = fn($_2) => foo($a, $_2, 42);
but that's missing the names and types of the real function, and you presumably want non-placeholder args to be immediately evaluated and checked against the signature, so I think you actually need it to look like this:
$x = (
    fn(int $_1, int $_3)
        => fn(int $bar)
            => foo($_1, $bar, $_3)
    )($a, 42);
where the outer closure is a scope for the fixed expressions (in case they're not plain variables that can be captured), and a boundary to type-check them
anyway, there may be reasons why this line of thinking is a dead end, but in my head it makes more sense to try to generate some equivalent of that than to think of the partial application as a kind of function call
13:43
Hey @Derick: Whom do I need to nag when the current PHP 7.4.5 Docker-Image (build on the 6th of May) includes Olson DB v2019.3... Shouldn't that be 2020.1 by now?
We have nothing to do with these docker images, so, I don't know.
But 7.4.5 is from April, from before the Olson DB upgrade
13:54
Do I need to create a new RFC for revisions and eventually a new vote? I'm guessing yes.
Mornings
morning
@heiglandreas jordi I believe...
you mean the one on docker hub?
aka a link to the project please.
@IluTov yes, but I'd really recommend for any RFC that fails at the first attempt, getting it into a position where it is clearly the right thing, rather than making just enough changes to probably be ready for vote again.
tbh I am aware that I have stronger feelings about creating new RFCs rather than re-using existing ones than the average person.
@Derick Ah. Then that explains it. I got confused then because of the build-date! Then everything is fine
@Danack Yeah definitely. I have honestly no clue at the moment where to go with it. :/ I'll close it for now and take a few days to think about it.
14:04
@Danack Exactly that one. I'll check the repo. Though as @Derick already explained the release was from before the DB-update so everything is fine!
I just stumbled over it while localizing the slides for my talk at PHPRussia
@heiglandreas if you do get in contact with them, please berate them for me, over the ambiguous wording of "official PHP images" or similar they have. when I looked, they didn't seem to be as production ready as they should be.
@IluTov Remember to say thank you to it - huffingtonpost.co.uk/entry/…
Though I think throwing salt around has different connotations in western culture than Japanese....
@Danack Will do!
lol
14:22
rofl
you should have gone with T_SPACESHIP :)
@IMSoP the reason I changed it from server side request to ini settings in the tweet is that I go out of my way to avoid revisiting decisions for recent RFC, even if I don't agree with the choice that was made.
@IMSoP It's a dead end because you don't know the function signature in the compiler
(and generally try to avoid dragging up recently decided things).
14:34
@NikiC yeah, as I thought it through I realised it can't quite happen at compile time
but it still feels weird to reuse function call machinery for a function definition
in my naive mind, it feels like it should look like "OP_REMIX ( partial_declaration, real_function_signature )"
@IMSoP I mean, it looks like a call, not very surprising that a call is the best way to implement it :)
Makes sure you match existing semantics exactly, both in terms of how the function/callable is evaluated and how arguments are evaluated (especially reference arguments)
hm, I guess so
and my second example does evaluate a function call, just not the original function
it's an imaginary function with only the bound parameters
> "PHP is like the Borg: assimilate everything and take the best out of it to strengthen your own position. PHP assimilates C libraries. At its heart, PHP is a small language core which can be extended to do anything by embedding specialized C libraries."
the original page of that is gone. Anyone happen to have an archive, or know how to find one?
14:51
We are the Borg. Pointers are futile. We will add your syntax and semantic distinctiveness to our own.
hey
if I proposed an intrem(a, b) function for the PHP standard library, which does the same thing as % except with the sign behaviour you probably wish it had, would it pass
incidentally, I came upon the fact that Rust had a syntax for partial application and removed it; I don't really understand the details of why, but worth making sure we don't make the same mistakes: github.com/rust-lang/rust/issues/2189
$ php -r 'var_dump(10 % 360, 370 % 360, -10 % 360, -370 % 360);'
int(10)
int(10)
int(-10)
int(-10)
$ php -r 'function intrem(int $a, int $b): int { return (($a % $b) + $b) % $b; } var_dump(intrem(10, 360), intrem(370, 360), intrem(-10, 360), intrem(-370, 360));'
int(10)
int(10)
int(350)
int(350)
@Andrea I don't think I ever used a modulus on a negative number...
@NikiC remainder is very useful for a few things, like unix time and angles. unfortunately % is modulo
cmb
cmb
15:01
@bwoebi it seems you're hitting bugs.php.net/68383 (or a variant of it). I have updated gist.github.com/cmb69/d72336d2fc181c822046cbfa04aa90e0 to have something that fails. If I remove the erroneous "INSERT INTO …", then the script works as expected. So it seems to me it is "just" about missing error reporting.
@Andrea I can see why something(-370, 360) == 350 would be a useful function for angles, but calling it "remainder" isn't immediately clicking for me
that may just be my lack of post-16 formal maths education, though
@IMSoP Interesting. It sounds like the issue was mainly implementation issues? Like, bugs that arise because of Rust's memory handling approach?
that was my impression for the most part
@IMSoP I think I had learned about “remainders” long before I was 16, it was a concept introduced when learning about division
@Andrea yeah, just that "remainder" to me implies exactly what % does: divide two numbers, and what do you have left?
the function you're describing seems to also involve some addition or normalisation
15:12
only when implemented in terms of the existing %
there is a nice definition of the two, one moment
Sounds like a use case for an Arc class and operator overloading for modulus... ducks
it depends on whether you take the sign of the dividend or the divisor
And by Arc you obviously mean atomically reference counted, right?
:-P
@Crell the concerning point was the second bullet, about confusion and bugs from foo(_, f()) eagerly evaluating f()
one of the comments on the later related issue suggests limiting what can be interpolated
15:15
@IMSoP Which is a fair concern, I grant. Their answer seems to be "meh, closure syntax is close enough," which I frankly agree with, but it seems like partials block |> for at least a handful of key people. So...
oh, yeah, I actually quite like it
it = closures, parials, or pipe?
partials
Have any bandwidth to help/mentor me in implementing them? :-)
I wish I had the skills
15:16
Amen to that...
although, one thing that's a bit of a shame is that the foo(?) syntax isn't reusable for niladic functions, so can't be the general solution to the ::func / Closure::fromCallable problem
Morning
niladic? This is a new word to me.
n-adic -> n params; variadic -> varying number of params; niladic -> zero params
Ahhh...
15:21
in less jargon, you can replace $callback = 'foo'; with $callback = foo(?); only if it takes an argument
Yeah, it wouldn't handle those. But the use cases where you'd want a niladic function frankly don't overlap with cases where you'd want a partial anyway; I'm quite OK with making those few rare cases use a manual short lambda.
I want to create a friends table, which one has the best performance in PHP? A) One row per friend (user id|friendid). Or B) One row per user containing all friends id separated by comma in a column.
Actually... PHP allows you to pass more params than the function takes, no?
@mario It depends entirely on what you want to do with the data. It's much more of an SQL issue than a PHP issue.
it's more that it would kill two birds with one stone; we desperately need a better way of representing callbacks than nonsense like [$object, 'methodName']
In general, go with fully normalized SQL unless you have a specific profiled reason to do otherwise.
@IMSoP Oh, absolutely. I just don't see the niladic case as common enough to worry about; fn() => $foo->bar(); is "good enough" for me.
15:24
hm, I guess
Unless you have an even better syntax to propose; in that case I'm all ears. :-) (Not like I can implement any of them solo myself, at this point.)
just glancing at this: haxe.org/manual/lf-function-bindings.html if {foo} was (an optimised version of) Closure::fromCallable('foo'), you could do something like {foo}->partial(?, ?, 42)
I'm not sure I like it, though
because partial would still need some magic to say which parameters were being bound
That's even more typing that a closure is today.
not really; the key saving in either syntax is making the signatures match
The only things short lambdas don't already do for is are
1) They have more keystrokes than some want.
2) They don't automatically make the result type-safe. (It doesn't inherit the param/return types of the function being partialed.)
15:33
sure, the syntax above trades a little bit of (1) but still solves (2)
That seems like it would be a bad trade for the people who don't like |> until we have partials.
like I say, I'm not sold on it
just trying to see how it could fit with better general closure / first-class function support
@cmb my queries were actually working when executed consecutively on the mysql shell
I think the key is asking if it's a partial function application (in which case it applies to a single function only), or an "even shorter lambda", in which case support for full expressions makes sense.
@IMSoP The plan was to have ... placeholders in addition to ?
15:36
I think it's the former; if you want to partial f(?, foo()), that's an expression and you should just suck it up and use a short lambda like a big boy.
Those cover the niladic case as well
ah, that's cool
... placeholders? That's not in Levi's RFC.
Hi internals

I closed the vote on the match expression RFC.
https://wiki.php.net/rfc/match_expression

First of all, thank you to everybody who participated!

It was declined with 28 no and 6 yes votes. There were three main criticisms:

1. The RFC wasn't discussed extensively enough and too many changes were made last minute
2. match should be expression only (no blocks)
3. Omitting (true) should loosely compare the arm condition to true

Criticism 1 is absolutely justified and 3 makes sense to me.
Too negative?
cmb
cmb
@bwoebi oh, then I have not been able to reproduce your issue :(
15:40
@IluTov If you don't want to move forward with a "pure match expression" RFC, I'd encourage you to find someone else to pick it up as there did seem to be a great deal of interest in it. Or at the very least make it clear that you're OK with someone doing so even if you don't find an "heir" for it.
You wanted go-switch, it seems people are more interested in rust-match.
@Crell Well, it's not that I'm not ready to do it it's just that I don't think it's the right decision. I also don't know how to argue for an expression only match (why is it different than switch if the switch is fine, if the switch isn't fine why can't we use match 60% of the time).
you just need to stop thinking of it as a replacement for switch
it's "here's a thing that people do quite often that the language doesn't support well"
It's easier to argue for it as "extended ternary" than "simplified switch". If you're open to it I'm willing to help with the RFC to make the case. (English I can do; it's C-macro where my skills are still paltry. :-) )
particularly given that we can't nest ?:
@IMSoP But then, why is comparison strict, for example. That seems like an arbitrary distinction. If it's fine in switch, why is it different in match?
15:44
just don't mention the word switch in the RFC, anywhere
@IMSoP It's a prelude to the introduction of pattern matching. It should be unarguable that we cannot introduce pattern matching for expression contexts only.
@NikiC I don't see that as particularly "unarguable"
but then I don't really grok pattern matching
I don't either in this case...
I think you severely lack understanding of real-world usage of Rust match
oh, I absolutely lack that
15:47
Even though it is an expression, it is very, very, very, very, very commonly mixed with "statements" in the match body
Even if it's just something like a return in one arm
then maybe match is still the wrong keyword; I find the feature "match this expression to one of these arms and evaluate to the result" compelling and easy to understand
@IMSoP Those things are not mutually exclusive
You just evaluate the result to either a nil or a bottom type, depending
sure, I just find the "we want it to eventually be a back door to import cool stuff from Rust" part of the discussion rather abstract
@IMSoP As the RFC is written it actually is, but even if you "fix" that the RFC has ..., which would work here.
@IMSoP The pattern matching part is really not important besides the general point that it's use should not be limited to certain contexts only just because the language construct it is part of is limited in that way
The important part is that we already have a language that implements this language construct, and from the usage there we can clearly observe that a limitation to "single expression only" would limits its applicability very significantly, though maybe not quite to the point of uselessness.
The conversion of throw into an expression is certainly one way to "hack" around the restriction (and we could, with significantly larger technical effort, do the same for return/break), but doesn't really address the root problem
16:04
@NikiC I thought it was a Linux distro
16:18
Reading through the Rust book section on pattern matching... I'm not clear on where it would be beneficial to PHP. It's mainly useful for "structs, tuples, and enums"... none of which PHP has. The only compound type we have is objects, and given the overwhelming prevalance of no-public-property objects I don't see how pattern matching on object methods would be useful.
@NikiC does Rust have other cousins of switch as well? if not, is it possible that a lot of the places that use match with statements would happily use switch in PHP?
because that takes us round in circles, to whether match is instead of or alongside switch
@IMSoP Nope, Rusts switch is match and it's used for almost everything. Even for many things where you'd use if statements in PHP.
I think that mainly just because switch in PHP is so bad that many people fall back to if statements, even when the compared object is always the same. Which is unfortunate.
PHP developers, asking for your advice please. I am writing a test case which requires creating a resource, any resource (but not a stream). What is the best/easiest to go for?
Preferably something which doesn't require any optional extension to be compiled in
@Crell Rust structs are our classes, and tuples our arrays. Yes, we're missing algebraic data types but there's definitely interest for that.
@IMSoP Keep in mind that many uses of match in Rust are specifically mixes of the expression / statement forms.
16:23
And is not very dependent on the platform, what is installed there -- something which will work anywhere
@AlexD Maybe a stream context?
Ooh
Let me look at that
Hey guys :) any idea how to get an short unique id "from md5"? md5 is too long for images just need something like "2fdg54gf14" .. maybe its possible to generate it from md5 hash?
@AlexD These all seem like streams to me: php.net/manual/en/resource.php
@NikiC my point is, is it a fair comparison? if Rust has match as a swiss-army-knife of flow control, that doesn't really tell us much about how it would fit in a language with half a dozen existing idioms for that flow control
16:24
@Crell it is enought to have it unique?
@Chris substr(md5($foo), 0, 5); // First 5 chars of the md5 hash.
unless we go back to the "let's replace switch" argument, which I'm not really sold on
Note: Uniqueness not guaranteed with that few characters, but statistically likely.
@Chris ah, cool on the parser :)
Depends how strong a uniqueness guarantee you need. Even sha256 doesn't have a 100% perfect uniqueness guarantee. It's all a question of the odds of duplication.
16:28
as I understand it, each bit of output of a hash function theoretically contains as much entropy as any other bit
@AlexD e.g. OpenSSL X.509
so if you truncate to one hex character, you'll get things evenly spread between 16 outputs
if you truncate to two, evenly between 16^2, and so on
Thanks all. stream context worked.
i just wil try. if there is an something wrong, just recode :D
@IMSoP Depends on the hash function.
16:30
yeah
I was generalising wildly
If you're already going to the expense of computing an md5, why bother truncating it and losing entropy?
why do we generally refer to git commits by 7-to-8 character prefixes rather than full sha1 hashes?
I usually use full hashes :P
Easier to retype by hand; but it still uses full sha1s under the hood, and if it detects duplication it starts showing more characters by default.
If the goal is like a randomized file name, I don't see why you wouldn't just use the full md5.
who knows; maybe there's limitations on the length for some reason
16:33
I assume @Chris knows, since it's his code. :-)
We shortened hashes for embedded images in emails, because otherwise the filenames are shown if the images don't load, which looks bad if filenames are long. :)
given the requirement "generate half a dozen pseudo-random hex digits", taking an md5 of something and truncating it is not an unreasonable thing to do
Right.
base64(random_bytes(6)) is another viable option. I've no idea off hand which is faster. Depends if you care about repeatable seeds, too.
@Crell yeah, working fine... I'm coder since I'm 9 years old.. now 38... so i get it done.. somethimes its better to ask and don't code crap sh*t :D
I think if we want Rust-style pattern matching, we have to go all-in; otherwise, it's going to be far too easy to paint ourselves into a corner
for instance, I don't think you can do de-structuring meaningfully without block scope
16:46
I'm not sure we can do de-structuring meaningfully at all.
@IMSoP Why? Yeah, I'd love block scoping but everywhere, not just match blocks.
look at this example in the Rust manual: doc.rust-lang.org/book/…
@IMSoP Sure, but again, we have that problem everywhere. Not just here.
it talks about the de-structured vars shadowing vars from outside the expression, and I'm not sure what it would look like if that didn't happen
do we? foreach is the only case that comes to mind
@IMSoP $y would just be reassigned.
16:48
reassigned when? only if it matched? assigned to null if it didn't?
@IMSoP We only have a single scope per function call, all local variables are shared. Usually declaring a variable (which we don't also don't have) overshadows the variable from the upper scope.
> declaring a variable
At least not explicitly I mean.
right, but that's not generally a side-effect of anything else happening
@IMSoP Definitely only when it is matched.
I'm coming around to the idea that we should just not have match at all, in any form :)
Ello, ladies and gents.
16:51
@NikiC 💔
@NikiC You make me sad panda.
A comprehensive solution to the match space is complex, and I don't want something half-baked.
that's kind of where I'm coming from
@NikiC Well, half of the people say let's start simple, the other says it MUST INCLUDE ALL THE FEATURES!!
I don't know how to make you people happy 😂
I'd like to see a strict (and/or customisable) switch; and I'd like to see a replacement for nested ternaries; I'm not fussed what either is called
16:52
@IluTov Such is life in PHP Land.
(I'm in the same boat with |>)
@IMSoP We can just fix ternary associativity
Not a fan of ternaries.
true
It's an error in PHP 8 now, but doesn't make a whole lot of sense when we did the precedence change for + / . as a silent behavior change
Those ended up de-synchronized...
actually, one thing I'd really like is a way to branch on instanceof, like catch blocks do
16:54
@IMSoP aka pattern matching
:)
enum unions would let you handle that polymorphically instead, no?
it's useful in cases where you don't handle the classes involved
* Deletes all of php-src, starts over, creates Rust*
"if thingFromLibA do foo elseif thingFromLibB do bar ..."
16:57
@IMSoP From the pattern matching experimentation branch:
@ircmaxell When I have time I'll have to update you on the rollercoaster I've been on with work. They've been jostling around ideas about my Director responsibilities and then COVID occurred. We finally got some resolve last week. It's been interesting.
var_dump(match ('foo') {
    is int => wrong(),
    is object => wrong(),
    is float => wrong(),
});
var_dump(match ($value) {
    $v @ is int|float => var_export($v, true) . ': int|float',
    $v @ is ?string => var_export($v, true) . ': ?string',
    $v @ is FooInterface|Bar => get_class($v) . ': FooInterface|Bar',
    $v @ is object => get_class($v) . ': object',
    $v @ _ => var_export($v, true) . ': _',
});
@NikiC Counter argument: switch comparing things non-strict :-/
so, you've abbreviated "instanceof" to "is", but I still have to repeat it
@IMSoP What is repeated? The is?
16:59
yeah, what I really want is this:
match( $x instanceof _ ) {
    Foo => something(),
    Bar => somethingElse()
}
to save two characters? what if you're matching a deeper nested value?
I'm not, though :P
match ($value) {
    [is int] => ...
}
@Derick Right. I would be happy if that problem could be solved, but the whole "match" thing seems to be straying too far from that to get a consensus...
Yeah.
we can just modify that with a strict keyword, or just ... change it :-)
17:02
other than `is` being shorter than `instanceof`, it doesn't feel like much benefit over

if ( $x instanceof Foo ) something();
elseif ( $x instanceof Bar ) somethingElse();
it's not a hard change
@IMSoP Not without general pattern matching, yes.
@Derick switch strict ($x) {}?
for example
@Derick I think opt-in safety is very bad
17:03
I not keen on the word "strict" though.
@IluTov BC breaks are worse ;-)
If you expect people to use it it should be easier than the non-safe version.
switch ($x === ?) { } ^^
that's basically the idea I had ages ago (I think I even wrote to the list about it)
¿
make it swìtch
switch ($x) use(===) {}
17:05
yep
@Derick haha amazing, I'm sold
switch ($x) { case === "Foo": }
case Foo !!!!:
which then lets you also do switch ($x) use(instanceof) or switch($x instanceof ?)
@NikiC which is almost the same as switch (true) { case $x === 'Foo': }
17:06
aaanyway
or put things into bands with switch ( $x <= ? )
I need to make some dinner :-)
@Derick case Foo !important:
Makes it match first, out of order
case <b>Foo:</b>:
real_case 'MySQL'
17:08
wow thanks guys so many incredibly helpful ideas ^^
switch strict ... is my favourite still though
@IluTov It's Saturday, and I've had some beer.
@Derick cheers ;)
switch ($x op ?) would be kind of pattern matching in reverse: rather than each arm being able to do complex matching and de-structuring, the pattern would act as a template that every arm copied
@IMSoP Right, but I'm not sure it's really worthwhile to have it at that level of generality
I can imagine using it; but I can also imagine it getting out of hand
17:11
Especially as your "instanceof" example would require interpreting case arms as something other than simple expressions
it would be better than the switch(true) hack, IMHO
I'm all for making it strict by default in PHP 8.
Is that the beer talking or are you serious? :-)
@Derick Well, I'm almost certain that would fail too.
And it only solves one of the issues
maybe just deprecate switch, and let everyone use if-elseif
we seem to have lots of ideas on what we don't want it to do, but less agreement on what we actually want it for
that would be my tip for a future RFC on the topic: start with use cases, then say why no current syntax is good enough, then propose the new syntax
if people want fallthrough, they can use goto :P
17:28
If only the Edition proposal could advance in some way... then we could probably make switch strict by default
whether it's a version or an edition, there still needs to be some way to know if your code is ready; I'm not sure what that would look like for switch
let start reusing E_STRICT
also, I have the same fear as with strict_types: people will just use explicit casts all over the place
maybe I should RFC the "cast or throw" operator (int!)$foo
My main qualm with strict_types it that it should have been decided at call site not definition :(
I couldn't disagree more
17:33
@IMSoP Is that meant to throw when it can't cast (in a reasonable manner)?
for reasons I mentioned in a recent thread: the library author has no business telling me how it ends up as the right type, that's my code style
yes, (int!) would have the same semantics as a parameter passed in strict_types=0 mode
which despite the name is stricter than an explicit cast
@IMSoP Well yes, that's what I'm saying, the library using strict_types should sill allow you to use weak types in your files and having the automatic casting to the type hinting without yeling at you
that's what it does do
the library doesn't need to be in any mode, it just declares its expectations
it's the call site that decides how to meet those expectations
Well yeah, but internally it may want to be sure it's not doing any type juggling
But that's what I'm saying lol
again, that's what it does
17:36
We are agreeing that the current strict_type behaviour is suboptimal
no, I'm saying it already does everything you're asking it to do
function foo(int $x, int $y): int { return $x + $y; } can't do any type juggling regardless of mode; only when calling a function defined elsewhere can that happen, and strict_types decides what those calls will do
It... is controlled at the call site already?
either I'm not understanding something, or you're not
Maybe I'm just being tired
Had my head in MultiVariable calculus for too long
17:41
it does seem to confuse people, which is probably it's biggest failing
maybe a better name would have helped; declare(cast_on_call=off) or something
Hey guys, if I'm setting up php-fpm in docker - can I have it in 3 containers? One nginx, one php-fpm, and the other the PHP application? I haven't set up this in a while....
Looks like PHP-FPM has to be in the same container as the application
just realised you can actually write a try-cast function just by specifying a return type in non-strict mode: 3v4l.org/eGoWO
a slightly more elaborate version that gives a better message: 3v4l.org/srBAX
that's basically what I'd like to be built in
18:00
@Danack as opposed to "rambling"?
Hello, can anyone explain why we need '\\\\' to match a backslash instead of a '\\' in PHP preg_match() ?
because `` has meaning to both PHP, and the regex library
er... and this chatroom, apparently :(
Because you need to escape the backslash in the regex, as it is also used to escape special regex characters
true story: I once wrote a script which nested through so many different layers it had 15 backslashes in a row
it was not a good script
18:07
When we want to escape a forward slash we just need to use '\/' but why is it different for backslash ?
because forward slash has meaning to the regex, but not to PHP
think of it like people passing on a message; each person who sees it interprets the parts that mean something to them, and passes the rest on
okay so one time is for escape char in php and the second time for regex ?
yep
hence my horror story of 15 backslashes
it was something like PHP calling bash calling sed
18:11
:D
18:42
@Derick @cmb Mind if I ask your help with RM stuff? Under https://github.com/php/php-src/blob/master/docs/release-process.md#new-release-manager-checklist, there's this introduction:

> Add new keys in the php-keyring.gpg in distribution repository using: gpg2 --export --export-options export-minimal --armor <all RM keys>

How do I do that? Because that command is just outputting my public key, not sending someone :(
process manager:      static
start time:           09/May/2020:20:08:58 -0000
start since:          1818
accepted conn:        21646
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       187
active processes:     13
total processes:      200
max active processes: 50
max children reached: 0
slow requests:        601
In php-fpm, does someone have any idea how it's possible to get 601 slow requests with only 13 active procesess? The server normaly get 2-5 active processes per minute, and there's no slow requests, but when it gets +10 active processes per minute i see a lot of slow requests, could some one point out where maybe is the problem?
@Tiffany yeah, I mentioned the difference a bit lower.
@mario the slow requests is the total number of slow requests since php-fpm started, not the current number per minute or anything.
@mario so something is going more slowly when you have mor than 1 request at once.... it will almost certainly be your database queries, but you could find out with: tideways.com or similar tools.
Ok, i will check it.
19:20
@Jimbo " one php-fpm, and the other the PHP application" - I have no idea what that means.....
@Danack My thought were that this PHP-FPM pool is calling the actual PHP application running somewhere else, not that it was running on PHP-FPM. Yeah me neither, too much Go.
Haven't touched Symfony in ages, excited to get something running with SF5 then will throw in react and all that front-end bullshit
20:22
@IMSoP you must've never tried to escape single quotes across multiple levels of bash commands, like parallel calling ssh calling bash calling sed… it's going to be a chain of "'"'"'"'"'"' etc.
@bwoebi well, you can always just escape your spaces with backslash instead :P
I wish everything would use XML-style escapes, because at least &amp;amp; grows linearly rather than exponentially
@IMSoP which still doesn't improve anything if you nest that 4 times
&amp;amp;amp;amp; is better than \\\\\\\\ IMO
yeah agree on that
I think you need 6 levels before it's strictly shorter, but it's a lot more human-parseable
20:30
@Danack tbf, the more experience I get with systemd-spawn, ip and iptables, the more I start to despise docker and the likes… because you can just do a few linux commands and things just work instead of having to figure out arcane yaml syntaxes and flag options.
especially because docker etc. sometimes just do magic things like bind mounting (via overlayfs) your /etc/hosts so that you cannot do an atomic mv to replace the hosts file, but have to write it…
which are nice ideas but they sometimes get in your way and you either cannot turn it off or have a very hard time to turn it off
(this is just the most recent bigger annoyance I couldn't really work around I had recently, but there's obviously more…)
20:47
Setup appveyor pull-request hook for github.com/php/pecl-file_formats-y ・ yaml ・ #79577
00:00 - 21:0021:00 - 00:00

« first day (3493 days earlier)      last day (1681 days later) »