« first day (4488 days earlier)      last day (442 days later) » 

1:59 AM
@nielsdos Welcome! Nice to see you here :)
 
@IluTov btw did you mrge the CCache thing?
 
@Girgias Nope, I didn't have as much time as I had hoped. I'll try tomorrow. I mean, if you really want to I'm not going to stop you :P Just remember that I wanted to rebase for PHP 8.1.
 
Oh I'm not going to touch anything related to GH actions
Just was wondering
 
Got you ;) I'll have a look soon then.
 
Would also be nice if mvorisek would actually finish his GH Actions PRs before openning new ones :|
 
 
8 hours later…
10:22 AM
@IluTov thanks :)
 
 
7 hours later…
5:01 PM
I know I criticise other people for doing this...but......for the "Introduce the abiltiy to use the first-call-callable syntax on non-static methods" thread.
class Foo {
    function bar(string $name): string {
        echo "Hello $name";
    }
}

$fn = Foo::bar(...);

// $fn is equivalent to:
$fn = fn (Foo $foo, string $name): string => $foo->bar($name);
Other than aesthetics, is there a technical reason why that's not a good idea?
 
5:13 PM
My main objection is that Foo::bar(...) is also/already the syntax for creating a closure on a static method.
class Foo {
  function dyn(string $name): string { echo $name; }

  static function stat(string $name): string { echo $name; )
}

$dyn = Foo::dyn(...);
$stat = Foo::stat(...);
Both of those are useful things to do, but they should not use the same syntax. I don't know about the engine complexity, but it from a user POV, it's a recipe for confusion.
 
Yeah....that's the aesthetic reaction I have also. But it would be fully static analysable. i.e. any code inspection tool could know that creating a closure from an instance method has any extra parameter of the instance at the front before the other parameters.
 
What is really being asked for is, I believe, called "lenses" in the FP/compsci world.
 
> but they should not use the same syntax.
Other than "it's not something you're used to" what's the exact problem? They both generate closures of class methods, both for static and instance methods. It would be possible to argue it's consistent...
 
And I am totally here for adding lenses to the language in some way! I already have a user-space version, which is the best you can do for now: github.com/Crell/fp/blob/master/src/object.php#L28 But I'd much rather see first class support that is therefore also recycleable.
Foo::dyn(...) generates a callable with a signature that matches dyn(). Foo::stat(...) generates a signature that has one additional parameter at the start of type Foo. Visually, I cannot tell how many parameters the resulting closure will have without going to look at the other source file to see if it's static.
Which... may be hard for the engine to do as well. I'm not sure there.
 
"Visually, I cannot tell how many parameters the resulting closure will have" - that's true for static methods also. You need to go look at the function signature to tell what the parameters are. At which point you can also look to see if it's static or not.
 
5:21 PM
Actually... my example above is backwards. Which I think illustrates my point. (It's Foo::dyn() that has the extra parameter.)
 
Okay, let me know if you see any technical reasons then. I mean I get your not used to it....but after using it for a few hours it would seem fine, probably.
 
5:48 PM
In this case, I don't think so. It's not just "new" (I'm hardly one to avoid new syntax), it's the exact same syntax meaning 2 different things depending on the context of some other file., which may not even be known at dev time That's my issue.
That may also cause a technical issue there; not sure.
I think the $$->dyn(...) syntax (Or similar, there's lots of variants to consider) is much more promising.
 
 
2 hours later…
7:57 PM
Anyone have an opinion on the best ReactPHP book?

Learning Event-Driven PHP with ReactPHP - Sergey Zhuk
ReactPHP for Beginners - Sergey Zhuk
Building RESTful API With ReactPHP - Sergey Zhuk
 
I mean, the topics are in the title, it depends on what your goal is...
 
I'm thinking the "beginners" one, but it may not teach me all I need to know.
 
if you're starting out ReactPHP, or if you want to learn event-driven PHP, or if you want to learn how to build a RESTful API.
...
 
I need to write a Ratchet/PAWL handler, and I know a lot about many PHP but zero about event driven promise coding
oops, not restful API then.
 
I would check the table of contents and a sample chapter, if one is available
they would give you an idea if those meet your needs
 
8:00 PM
I've looked at the examples, but I'll see if I can find sample chapters too. Thanks.
 
my assumption that a beginner's book would get you started and build a foundation... but it's unknown how advanced it gets... and that may be one of your requirements
Learning Event-Driven PHP with ReactPHP may require that you already have an understanding of ReactPHP which could be problematic, too
 
That's my fear. It gets me (the beginner book) kinda where I am now. I have a little, but not a lot and many detailed questions. But maybe the other book doesn't answer some of my questions.
 
but it usually says that somewhere in the beginning, before the chapters
 
bingo, yes.
 
"this book is for..."
 
8:11 PM
What does SEPARATE_ARRAY do?
 
https://www.phpinternalsbook.com/php7/zvals/memory_management.html#separating-zvals?
(might need to ctrl-f "separate_")
not sure if that's what you're referring to
 
@Dharman guessing, as it's a few years since I used it, but takes a proper copy of an array, so that changes to any reference stored entries in the original one, don't get copied across?
 
thanks
 
new Object()->method()
I would like this allowed in 9.x
 
@Mwthreex Is this creating a new class from the output of Object()->method() or of the name Object?
 
8:23 PM
'yes'.
 
@Dharman That was equivalent of (new Object())->method() just removed the parentheses
 
@Mwthreex Yes, that works
 
@Mwthreex That was equivalent of (new Object()->method)() just removed the parentheses.
 
But you see, if you tried to make one of these parentheses default it could be confusing. So I think it's better to stick with parentheses
 
8:53 PM
good evenings
 
9:23 PM
Can we deprecate request (GET/POST) based sessions? i.e. can we make the use_only_cookies = 1 mandatory? I can add this to the deprecations for 8.3 unless someone has objections.
 
thats quite a huge change, I am in favour of it but that almost certainly needs an RFC
Maybe huge is overstating it, but for some reason I seem to remember there's some major forum software that uses it by default, I could very well be wrong about that though.
 
 
1 hour later…
10:47 PM
If anyone has any energy to check for typos/inanities/obvious mistakes, would be appreciated:
 
11:00 PM
I think you misslinked your last 2, the pages are swapped
 
11:11 PM
yep.
 

« first day (4488 days earlier)      last day (442 days later) »