« first day (4001 days earlier)      last day (930 days later) » 

12:04 AM
@cmb I'm not sure why this is happening, but if you check out the "Run tests" step on any of the PHP 7.0 builds for uploadprogress on Windows, it skips all the tests because it fails to load php_uploadprogress.dll. This only happens for PHP 7.0 on Windows, though. All other versions are fine. github.com/php/pecl-php-uploadprogress/runs/…
 
12:27 AM
Okay people, amazing idea I have for a PHP RFC, how about, we make null a proper stand-alone type?
We could limit it to return-only type which can be useful for co-variance (which is mainly why I'm thinking about this because SPL actually has a case like that), but why limit it, sure it's kinda pointless on its own as an argument type but many type systems let you do that with the unit type
 
But... why?
 
So we could add a return type for every function that lacks a return statement, in a non-fucked up way.
 
I don't follow.
 
@Girgias for the record, I am still 'quite' angry about void being added before null.
Nov 3 '15 at 15:28, by Danack
@LeviMorrison Good news! There have already been suggestions to change the behaviour of the language to match the void behaviour!
 
@Crell We got functions in PHP which inherit from another class which has a nullable return type ?A where null might stand for failure, and a child class always errors, thus always returns null, but it is not void because LSP (and if you wondering where this exists... SPL
We also have functions which return null|false or null|true for some ungodly reason
@Danack I wasn't there so please don't blame me
 
12:33 AM
"Better document shitty APIs that should be replaced" isn't a compelling argument.
 
I frankly don't see the issue to have the possibility to declare the unit type null
 
@Crell "being able to declare the return type of all functions properly" should be.
 
Example of where it would apply? (Not just "SPL")
 
Sure, maybe not as an argument type, but then why the arbitrary limitation
Type system completeness
 
(I'm not necessarily opposed; I just want to see concrete benefits.)
 
12:35 AM
it might also help stop the confusion in the symfony people of whether null is a type or a 'flag'.
/might.
 
Also the fact that we currently need to document that null can only be used part of a union type is pretty bleh, because you have the weird case of null|false looking like a union type but this combination isn't valid >-<
 
Nov 3 '15 at 15:24, by Danack
@TheodoreBrown As well as the example above, it's useful when you do automatic code generation (which I probably do more than the average PHP programmer):
Nov 3 '15 at 15:24, by Danack
function foo() : null {}
function bar() : int {}
function fooOrBar($x) : null|int {
    if ($x) {
        return foo();
    }
    else {
        return bar();
    }
}
not being able to combine types, some of the time, is a bit silly.
 
1:38 AM
One of the competitors in Bake Off is @PeeHaa in little old lady form. In reaction to Matt Lucas saying he likes mint chocolate chip ice cream: "why would you eat toothpaste in an ice cream?!"
 
1:55 AM
"PeeHaa in little old lady form" - what's the difference from normal? Hair tinted blue?
 
2:23 AM
I want blue hair
 
 
3 hours later…
5:33 AM
@Girgias i am happy to get any silly comments for my method and class synopsis PRs. Most of them seem to be very straightforward (zend class synopsis and most of ext/intl method synopsis). Cc @Dharman
 
 
1 hour later…
6:36 AM
@bwoebi this just isn't really doable; the SAPI is the thing we provide, the consumers of the SAPI (various mpm, iis, cgi, fcgi) all have different processing models, or more precisely are free to have different processing models .... even among apache mpms they are free to use the SAPI differently ...
 
6:50 AM
named capture group key missing if not found ・ *General Issues ・ #81486
 
 
1 hour later…
7:55 AM
honestly, that would be a great idea! as Danack mentioned, it would really help people understand that null itself is a type, not a flag.

and special cases generally suck ( `: null|T` being valid but not `: null`)
 
@Girgias Feel free ^^
 
8:22 AM
Say some prayers, as I'm going need to dive deep into the mess that is timezone rules because the TZ Coordinator is hell-bent on removing data. :-/
3
 
@MateKocsis me too. I will try to review some of them in the afternoon if I get the chance. I still want to write a few more PRs
 
@Dharman cool, thank you!
 
@JoeWatkins I'm pretty sure it would be doable, fpm is our own code, and the others provide enough hooks
 
8:37 AM
feof() should return true after reading last chunk for HTTP requests ・ HTTP related ・ #81487
 
@JoeWatkins Second time on my todo list today is to write an ext showing that MINIT/MSHUTDOWN and friends, about what I said yesterday, is what Apache prefork does. If other SAPI implementations to it wrong, they need fixing.
 
8:54 AM
I can see that is what it does, when I say it's wrong, I'm saying it doesn't need to do it that way, and it doesn't make good sense
 
This is about calling minit multiple times?
 
yes
 
Fun fact: Apache support in PHP is completely untested. Completely untested.
Like, to the degree that we don't even check that it builds.
 
I know this, but when you say it outloud, I squeak a little
@bwoebi our sapi implementation (code in sapi/apache2handler or whatever) is a thin layer connecting Zend and APR, the MPM that consumes the API is what determines the processing model, we cannot control that by changing our Server API really ...
 
9:08 AM
I maintain that this has always been the intention:
Each process: MINIT/MSHUTDOWN
Each thread: GINIT/GSHUTDOWN
Each request: RINIT/RSHUTDOWN
Apache does an extra (or at least, used to) MINIT/SHUTDOWN before prefork, so that it knows which php_value settings it can support, IIRC.
 
since we talk about this partly in the context of apache2 graceful reload, php-fpm is also a bit weird when you reload the process and not restart it.
usually php-fpm is nevr reloaded, the apache failure turned up for customers on debian/ubuntu where reload is done by the standard logrotate script
 
@cmb Nice ^^
 
what does prefork mean if not that the engine is intialized before forking ?
it can't do mshutdown before forking afaik, that would break anything using shared mapping, which lots of stuff has been using for a long long time ... it does minit before fork because that is what prefork means - initialized before fork - I've no idea why it needs to re-enter minit stage, it seems wrong to me ...
I've never really looked that closely at apache, or at least not for a very long time and when I did it was in the context of threaded mpm on windows (even iis, it was that long ago) ... but it becomes clear now why so much minit code needs to be so defensive, and why allocations in minit create leaks you don't seem to be able to trace ...
 
 
2 hours later…
11:51 AM
Hey @SteeveDroz :) Thanks for this!
 
No problem.
 
@Danack if you have a few minutes for github.com/Imagick/imagick/pull/458
 
KInda new to code coverage (as you can probably tell) but I'm finding it useful - its just this one thing - trying to understand and identify paths
 
I check at your technology and I come back at you.
 
@ramsey if you have a few minutes for github.com/php/pecl-php-uploadprogress/pull/11
(I think will have be better to have it in 2.0.0... but... perhaps not too late)
 
11:55 AM
@Zakalwe So, as I can see, even the official PHPUnit website suggest you use either xdebug or PCOV to generate code coverage. I would suggest the same.
 
I am using phunit - the command I have is:
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-filter ./src/app --coverage-html ./coverage --path-coverage
 
OK, so you use XDEBUG.
 
Yup
 
Is there a place where I could access your code and test it? Or is it supposed to stay private?
 
Its for a third party :( sorry - i know that makes it difficult
I just ran a clover report and I think (you may be able to tell me if I'm right) that the issue is with the "$cartitem->getAmount()" line
Clover reads as::

<line num="97" type="method" name="getTotalOfType" visibility="public" complexity="2" crap="2.15" count="3"/>
<line num="99" type="stmt" count="3"/>
<line num="101" type="stmt" count="3"/>
<line num="103" type="stmt" count="2"/>
<line num="106" type="stmt" count="3"/>
 
11:59 AM
Is getAmount public or private? Can you test it separately?
 
Its public - cartitems implement a CartItem interface
and yeh - sorry - i have tested each implemntaion of that in the system - each one comes back as 100% for branch, line and path
that method is typed and will return a float - the comments in the SO question detail that. So these will always return a float and nothing else
 
Do you have any hints when you hover the lines of your HTML test report?
 
It just states what is covered for the green tests but nothing for the red (erroneous) tests which is kinda useless IMO
the green paths I mean
 
My problem is that I don't understand your report. Usually, reports don't have "copied" lines. They have your code verbatim with red and green lines, just like here: miro.medium.com/max/1838/1*SGpUnVpJMNpyYJbo6-8pfw.png
 
12:08 PM
@SteeveDroz Only Xdebug can do path/branch coverage.
 
In your question, you had multiple lines 101... Where did you get that?
Duh! Silly me. Thanks @Derick!
 
That's a section further down in teh path coverage report which shows the paths that are covered and not covered but the "noit covered" cases have no associated data with them - i.e detaling what path I'm missing
At least - thats my understanding
 
@Zakalwe You're going to have to show the whole page, and not just snippets - and then I can have a look.
 
Just exporting it now - thanks again for this! Sorry iof Im being a bit vague! :)
I've just found u on GitHuib and added u as a collab! :)
 
12:39 PM
ext/zip doesn't extract files with special names ・ Zip Related ・ #81488
 
@Derick I'm currently thinking, that this is actually not that strict, e.g. the user himself can call pcntl_fork() in his code, then the process doesn't get an additional minit it's just unproblematic in cli …
 
anyone got any exp with google drive API?
I am basing myself on github.com/googleapis/google-api-php-client but for some reason I just don't see any files listed in the service en the sample for the files, just says the method doesn't exist, eventhough it is there
 
1:17 PM
@RemiCollet Do you mean to delete the tag and re-tag with these changes?
 
1:39 PM
@Zakalwe I'm sorry, I can't help anymore. First I'm trying to remember how to use branch/path coverage, as I'm not an expert in that matter and haven't done it in a while, then I have my job actually taking time. Sorry to let you down.
 
@SteeveDroz hey no worries at all - I really appreciate you taking the time to even have a look - truly! I will find an aswer at some point! :)
Will removbe you from the repo - thanks again! :)
 
@ramsey no, of course, I was thinking about 2.0.1 (and forgot 2.0.0 ;)
 
@RemiCollet Cool. Just making sure. :-)
 
btw, I don't think adding arginfo may break anything
 
cmb
2:05 PM
@RemiCollet could only be a problem wrt. return types of methods
 
2:27 PM
@Zakalwe I don't know what that means?
@RemiCollet It certainly can break, as internals now also enforce these arginfo types.
 
3:03 PM
Morning o/
 
\o
 
cmb
@Derick for functions only in debug mode, I think
and without arginfo, debug builds don't work anymore
 
3:34 PM
@RemiCollet I consider this a bug fix, so if it breaks anything, it's because it was broken before ;-)
 
tbh I feel like that about most of my features as well
 
4:09 PM
o/
 
\o
 
o/
 
\o
 
4:24 PM
\o
 
Does anyone know why this was true in PHP 7 but not in PHP 8? stackoverflow.com/questions/65986942/…
How did this even work?
 
cmb
@Dharman this might be Apache; if the object is destroyed during shutdown, mod_php looses the CWD, so another file may be read
 
4:41 PM
Ohhh
 
So, I'm not sure I understand what dom_register_prop_handler() does... like I see it assign function pointers to a HashTable, but I don't get when they are executed
 
Ok, so even on PHP 8 when running from Apache it is the same problem
I wonder if this can be fixed
 
It can be fixed by never using cwd in your code :-)
 
5:03 PM
@NikiC How fragile would you regard this weaken() function? Specifically, the bit where I'm binding a Closure to stdClass to remove the $this reference and how I'm detecting that it's an anonymous closure comparing the short name to '{closure}'.
It works wonderfully in 8.1, but do you forsee any changes that would break it is basically what I'm asking? :)
 
is that really needed as part of the public API?
 
@Trowski fun
that code probably throws for static closures when trying to rebind?
 
@SaifEddinGmati Avoiding circular references in loop callbacks is the use-case. And yes, that's quite a common thing.
@NikiC I believe the early return if $closureReflection->getClosureThis() returns null should avoid rebinding a static closure.
 
@Trowski ah right
 
@Trowski is this supposed to be a dirty hack to avoid circular references with the event loop? :-D
 
5:14 PM
@Trowski Well, let's say it like this: I don't have any specific changes planned that are going to break it :P
 
@bwoebi Mostly within a class, so you can reference $this directly within a watcher callback or looping coroutine. Otherwise we have to use references to properties or declare another object that can be shared between the closure and parent object. Here's an example: github.com/amphp/byte-stream/blob/master/lib/…
Not planning to change that necessarily, but that can be common in application code too, which is where weaken() would be most useful IMO.
@NikiC Alright, thanks, that's all I wanted to know.
And you didn't scream and tell me how terrible it was, so there's that too.
 
@Trowski yes, that's what I was thinking of. As long as weaken() is not called in hot code, looks like a nice utility (though weaken() is only really useful in objects with limited lifetime, so there's that)
 
5:43 PM
@bwoebi I'd love to use it within objects like the one I linked as that's fairly common in Amp, but yeah, I wouldn't want to use weaken() in a hot path. If references go away we'll have to switch to using a shared object.
 
@Trowski why should references go away?
 
@bwoebi T'was on someone's wishlist AFAIK.
Not sure who, maybe @NikiC or @Girgias.
 
Remove refs, allow inout params I believe was Nikic's want
 
@Girgias :-P
 
6:02 PM
@MarkR inout params are great, but they don't replace refs
 
6:16 PM
I disagree about their greatness.
 
@Crell why so blasphemic today, @Crell?
 
What makes today different from any other day? :-)
inout params are intrinsically impure. Basing your data flow on inherently impure techniques is a fail.
Especially when there are other options available.
 
@Crell it depends on how they are designed, i.e. is inout equivalent to a normal by-value passing at function bundaries, like args and retval too?
 
I... don't understand what you just said.
 
@Trowski Well I don't like references but it's gonna be hard getting rid of them
 
6:24 PM
A pure function is one where you put stuff in at one end and get results out the other, and nothing in the world changes other than the results coming out the other end. That's what gives you idempotency, referential transparency, composition, etc.

An inout param means stuff goes in one end and comes out both ends.
 
let's say we have function foo(inout $var) { $var += 1; return 2; } $var = 2; $ret = foo(inout $var);, this is functionally equivalent to function foo($var) { $var += 2; return [2, $var]; } [$ret, $var] = foo($var);
 
There are ways you can use a pure function with multiple returns to simulate an inout parameter. But not vice versa.
 
99% of my reference usage is with use() lists. I'd be half tempted to scrap them in place of a class instance but it seems less clean
 
How do you compose (pipe) an inout function? How do you memoize it?
 
@Crell what I am saying is that the value of the inout var (in caller scope) only gets updated after returning, so it is, in effect, pure
 
6:28 PM
bar(foo(5)) // What is that supposed to mean if foo() takes an inout param?
 
@Crell 5 gets passed - that's it
it's a caller choice whether to update the value or not
 
Then all you've done is make an overly complicated multi-return syntax. :-)
 
@Crell which is ssentially what you need inout for ...?
for everything else there's references
 
I thought that was Mastercard. :-)
I'm undecided about multi-return. I can see the value for them Go-style, but with union returns and enums I'm not sure they're needed. Plus, I don't know how you can compose them.
 
6:33 PM
You forgot to change the name. :-)
 
yea, it's just a draft :p
also return ("foo", 1); is not going to work, so it's most likely return tuple("foo", 1); or return tuple["foo", 1];
 
Honestly, I've never really understood the point of tuples other than a cute way to implement function parameters and multi-return. I want something descriptive with a name 99.3% of the time. And for that... we have objects.
 
TS has a much better way of doing it with: foo(): { a: number, b: number } although foo(): [ number, number] has its uses too
 
IMO, inout parameters are needed in PHP because we have by-value array semantics.
Those are great, but sometimes for efficiency you need to do something mutable in-place, like sorting a large array.
 
sort()? :-)
 
6:43 PM
Most places that use a reference today should use inout instead.
The outward semantics are similar but the differences are important in some cases.
 
I just wrote a library that has a whole crapload of functions that take an array, modify it, and return the modified array. It's also super fast.
And that makes it trivial to use in reduce(), map(), pipe(), etc.
 
Those are stream-like operations, which is great. But if you have an array of 10,000 elements, and you need to add one or two more with array_push, you really don't want to copy it...
 
@LeviMorrison yep, the issue i see with references is that whenever i read a code calling another function,i don't know if it would modify its arguments or not unless i look at the function signature.
 
I think Nikita wanted to bring back call-site & for that reason. Or at least he's talked about it.
 
If I had to make do without i'd make a single-property class and then pass the class instance around gist.github.com/markrandall/9d9d77c0495fb1d0764ce9b346645385 (pseudocode)
IMO call-site references would be a welcome step towards making reads on undeclared vars go away. Much of it could be done up front.
 
6:52 PM
@MarkR i actually made a class just for that :D github.com/azjezz/psl/blob/1.9.x/src/Psl/Ref.php
 
Yup
 
@Crell yeah, I talked about that … but then its caller and callee
@SaifEddinGmati yeah, that's what you have to do in c# and I hate it
 
7:18 PM
@NikiC You didn't move forward with optional & at function call sites. Is that because you wanted to reserve call-site & for inout, or because of some other reason?
 
@LeviMorrison Mainly because people didn't seem to find it compelling without an ability to opt-in to it being required
And I didn't manage to get anything close to a consensus on how an opt-in could look like
 
Ref also exists in Hack, even tho inout is a thing, because there are still cases were you have to use Ref, especially in tests
 
@NikiC I see. Static analysis has increased in adoption the last few years; do you think that may have shifted this enough to discuss it again?
 
7:54 PM
strpbrk = string pointer break?
 
@NikiC so, you need something like namespace declares for that?
 
I would imagine more like editions?
 
8:25 PM
@MateKocsis Your PRs are very difficult to review. They are good, but it takes a lot of time to go through it all. No wonder they are still not approved.
 
passive aggresive like typing detected
@RemiCollet thanks, I will try to do a release tomorrow. Kind of feeling like I've had the crap kicked out of me right now.
 
cmb
@Tiffany yes
 
@NikiC IMO there's a large number of things that aren't currently possible in PHP, that having a declared package system (, separate to namespaces) would make at least possible to solve: poorly written words here, github.com/Danack/Package/blob/master/rfc_words.md but I'm not in a fit state to update them right now.
 

« first day (4001 days earlier)      last day (930 days later) »