« first day (3688 days earlier)      last day (1266 days later) » 

4:15 AM
zlib.inflate filter buffers entire read until file closed ・ Zlib related ・ #80384
Response data preceded by post data ・ FPM related ・ #80385
 
 
2 hours later…
6:30 AM
Good morning.
 
7:06 AM
posted on November 20, 2020

 
7:37 AM
morns
 
8:04 AM
mogguh
 
9:02 AM
Hi internals, I quickly wanted to check about a strange behaviour with named arguments before opening a bug report.

You can use named arguments in variadic functions like so:

```
class Foo
{
public function __construct(...$args)
{
var_dump($args);
}
}

$foo = new Foo(a: 'a', b: 'b');
```

But the same doesn't work with `func_get_args`, at least not in constructors:

```
class Bar
{
public function __construct()
{
var_dump(func_get_args());
}
}

$bar = new Bar(a: 'a', b: 'b');
```
 
Hey strangers; long time no anything.
 
The func_get_args approach gives a fatal error: PHP Fatal error: Uncaught Error: Unknown named parameter $a
Tested on RC5
 
That is odd, though I also find it odd that even explicit variadic with named arguments (not matching the signature) works.
 
@BrentRoose this is just a strict behavior that named arguments has. at call time it only sees the signature, and if it doesn't find a name an error occurs. Imagine the number of bugs when this wouldn't happen
 
So this is expected behavior too? 3v4l.org/UUhOK
 
9:08 AM
Then what about variadic functions? 3v4l.org/d7SHg
The RFC explicitly listed variadics and func_get_args as a feature btw
 
lol, beat you to it @BrentRoose
 
I'll beat you to the RFC link though! wiki.php.net/rfc/…
 
lol, that you shall; PHP is a distant memory and I'm trying to revisit the nostalgia after reading the PHP 8 features.
But yeah, that looks like it could be a bug, as per the spec.
 
9:26 AM
@BrentRoose Variadics are listed as a feature, but func_get_args is listed as an explicit non-feature
> All three functions are oblivious to the collection of unknown named arguments by variadics. func_get_args() will not return the collected values and func_num_args() will not include them in the argument count. Collected unknown named arguments can only be accessed through the variadic parameter.
func_get_args() is the deep end of legacy
Probably the other bit of deep end legacy (call_user_func_array) should not have supported named params either. Would have prevented most practical BC impact I saw
 
Aah yes, that makes sense
 
9:57 AM
wow. just had a conversation with haproxy devs
they back ported a new feature to a patch version, the online docs are only versioned in terms of major.minor; so the docs say "you can do X", but X was only added in a .26 patch
one dev understands the problem
the other dev essentially said its my fault because why am I not building from source.
this is not how you engage with users.
 
10:08 AM
Configure with opcache enabled fails ・ Compile Failure ・ #80386
 
@Stephen why use stable releases and prepared bundles when you can have the thrill of bleeding edge and custom patched code? ;)
 
@makadev of course. whenever I need to update something I always just eat some time-stopping-crystals, shit out an extra week of free time, and go through every part of the stack analysing upstream changelogs, building and testing new versions, and then packaging them to install on each server.
also, trying to decipher what existing features have changed or been deprecated between two versions just from changelogs, makes you really appreciate the UPGRADING docs php provides.
 
10:25 AM
True ye, and especially for something that isn't as widely used.
 
10:42 AM
Happy Fraidai!
 
Fridai fridai gotta get down on fridai!
 
11:26 AM
as far as I know, Friday is not a holiday there (out if Iran) .. is it?
 
11:51 AM
@Shafizadeh Yes it is, I just finished Zoom Jumuʿah
Now it's time for some Rauchbier und Schäufele
 
well, didn't understand what you mean exactly, but apparently, this is a special Friday for you ..
 
No, just a normal Friday, we're just happy it's Friday because most don't work on Saturday or Sunday (or don't have to work).
 
ah I see ..
 
Next Friday is a holiday for me :)
Well, it's a day off. Thursday is a holiday though.
 
12:11 PM
hi guys, am new here, what is shaking?
 
not much, are you shaking anything?
 
12:35 PM
@Stephen go find more of yourselves so I can shake you
although as I have explained to @Ekin lately, I do shake my little tush on the catwalk
 
@DaveRandom wut
 
Shakin' Stevens? wrong spelling admitedly
 
I say again... WUT?
don't make me find a meme
@makadev wait which are you saying isn't as widely used, haproxy or php?
 
@Stephen if you dare... don't think I won't rebecca
 
@DaveRandom did I scar you?
And yes, scar not scare lol
@DaveRandom how is Sjon similar to Stephen/Steven?
 
12:51 PM
I have no idea what either of you are talking about right now
when in doubt..
 
@DaveRandom and you do your little turn on the catwalk, too
 
@Stephen I have a friend named Steven and a cousin named Stephen
 
Morning
 
orming statik!
happy friday
 
1:01 PM
\o/
 
/o\
 
@Ekin How is Mr. @PeeHaa this morning? You guys working on anymore music together soon?
 
I want toooo
It's been a while
maybe this weekend Mr. @PeeHaa? :-)
 
Yeah been too long
 
1:04 PM
Been even longer for me. Cannot find time...
 
that, yeah
 
Wes
morning. with this composer version, i shouldn't be installing version 5, right? "^3|^4"
 
That should be ||
AFAIK
 
Wes
uh, so what | does ? :B
 
No idea
It's not in the docs
 
Wes
1:19 PM
i am updating deps. everything go boom as it often does
holy hell it still works
 
Almost finished with The Unicorn Project; an extension of The Phoenix Project. Really good listen as an audio book if you're interested. Told from the perspective of the software dev side.
 
I need to get a new kindle
 
I would like to get a kindle. I enjoyed borrowing a friends to read a book he recommended. My iPad is heavy and clunky for reading compared to it.
 
@Tiffany and what am I, chopped liver?
 
@Stephen Stephens - 2, Steven - 1
my cousin also used to get offended if I used "v" or called him "steff-en" but we were kids then
 
1:36 PM
@Tiffany honestly the worst is email conversations. I've never had a non-throwaway email that didn't have my full first name in it. You wouldn't believe the number of people who can misspell the same name between the to field and the message field.
also, on weird name things.
 
@Wes It acts like ||: semver.mwl.be/…
 
Wrong behaviour of func_(num|get)_arg(s) functions with named arguments ・ *General Issues ・ #80387
 
Wes
aaaaah so it's just phpstorm not understanding it
 
my last name has a silent E in it. As long as I can remember, English speaking people where I grew up would get it wrong.
Here, hardly anyone speaks English. Never heard my last name mispronounced.
they've confused the concept of a middle name plenty
 
@Wes Yeap, probably
 
1:38 PM
but never once has anyone here mispronounced my last name. it's astonishing.
 
except the opposite :P
 
Wes
1:53 PM
halp
i am still confused by amphp's call. specifically on the reason it returns a promise
anyways. i am converting some existing basically sync code to amp, just to see if it works
how do i send data synchronously here
public function send(string $data): bool{
    return call(function() use($data){
        return yield $this->client->send($data); // client is amphp's websocket client
    });
}
 
@BrentRoose although there are some internals people here, to be precise this is not internals. We reserve the principle of capricious moderation.
 
Hi, I'm trying to run a tool on some code, but keeps throwing the error that the class doesn't exist, So I ran var_dump(class_exists('App\Controller\AnalyticController'));which returns false. The class exists. so, what does this mean?
 
> which returns false. The class exists.
You might think it exists, but your program disagrees. Probably the autoloader is failing to find it.
I'd check for dumb typos in either the namespace of the class, or the filename that holds the class.
 
@Danack Correct, so I checked the autoload in the composer.json and checked the namespace.
 
2:08 PM
You do not need the call wrapper there @Wes
 
If that didn't show anything, I'd write 'new \App\Controller\AnalyticController();', put a breakpoint on that line, and then step through the composer autoloader...
 
public function send(string $data): Promise {
    return $this->client->send($data);
}
 
Wes
@PeeHaa need to return bool, so must wait for the promise to resolve
gotta keep it sync for now
 
No you do not
The calling side should check what value the promise resolves into
 
@Danack How do you step through the composer autoloader?
 
2:10 PM
Everything returns promises in async land
 
...
 
Wes
ok but this is synchronous code and i am just trying to see if it works, as is
then i'll make it async
 
Wrap it in a wait
 
@KerrialBeckettNewham If you put a break point on that line, where it tries to create the class, one the code hits that point do "step into" and you will be inside the composer autoload code. youtube.com/watch?v=LUTolQw8K9A&ab_channel=JetBrainsTV
 
Wes
not my code, just trying to get rid of wrench for now
 
2:11 PM
wait() will spin up a loop resolves the promise(s) and kill the loop and return the value
 
Wes
thanks. that's it
 
@Danack Thank you very much 🙏
 
actually, it might be easier to put a conditional break point inside 'Composer\Autoload\ClassLoader::findFileWithExtension($class, $ext)'
For when $class === "App\Controller\AnalyticController"
@Derick if you were looking for inspiration of a video to make for xdebug ^^ - also then we could link to it...
 
@Stephen haproxy, although it might be one of the more known proxies. Point being, the more specific and less widely used software gets (in this case for load-balancing/proxying) the less likely it is you get useful information about anything except from documentation or changelog (or upgrade info).
 
@makadev ImageMagick does the same. Though they also sometimes make api changes in patch versions, rather than just adding functions.
 
2:24 PM
Any internals folk here that can help my with an oddity about SPL Iterators?
 
Hi Mark - also "Don't ask to ask"
 
With the "baked-in" SPL Iterators like ArrayIterator, I can use pre/post-increment against an offset value like:
$foo = new ArrayIterator([1,2,3]);
var_dump($foo);
$foo[1]++;
var_dump($foo);
 
code style is 4 spaces indent or pressing ctrl+k btw.
 
@Danack "api changes in patch versions".. sounds like a lot of fun
 
But if I create a userland Iterator, in this case wrapping SPLFixedArray:
class Distribution extends SPLFixedArray {
    private $keyMask;

    public function __construct(int $digits = 1) {
        parent::__construct(10 ** $digits);
        $this->keyMask = "%0{$digits}s";
    }

    public function current(): int {
        return parent::current() ?? 0;
    }

    public function key(): string {
        return sprintf($this->keyMask, parent::key());
    }

    public function addValue(string $key, int $value = 1) {
        $this->offsetSet((int) $key, $this->offsetGet((int) $key) + $value);
$distribution = new Distribution(10);
$distribution['8']++;
 
2:28 PM
@makadev yeah sure, fun. I'm laughing. youtu.be/cpZBMXICua0?t=22
 
I get a notice: Notice: Indirect modification of overloaded element of Distribution has no effect
So I can't use pre/post-increment on a userland implementation
Is there some magic that I'm missing that would allow pre/post-increment to work with a userland implementation? Or is this simply a bit of internal magic that allows it to work with ArraIterator but not with SPLFixedArray?
 
@MarkBaker It looks magic and terrible. it seems there is a null-coeslesce work around that probably does what you want: 3v4l.org/28UL2
!!lxr Indirect modification of overloaded element
 
@Danack "Your script was stopped while abusing our resources"
lol
 
xD
Good morning / afternoon / evening all.
 
7 messages moved to Trash can
 
2:34 PM
also, I thought direct assignment operators on objects with getters/setters like arrayaccess etc require the function return by reference?
 
searching gives two uses both of which are in big code blocks that I'm not going to attempt to read at this time of day.
 
Im not saying adding references to his code is the best solution, but that's essentially the problem right?
 
cmb
 
The inherent null default for SPLFixedArray values... that I can resolve
 
@Stephen imo, attempting to use SPL library might be the problem:
Apr 15 at 14:11, by PeeHaa
If you want efficiency (and/or sanity) you might want to look into DS https://www.php.net/manual/en/book.ds.php
 
2:36 PM
I needed to wrap my SPLFixedArray in a userland Iterator anyway, because of the change from Iterator to IteratorAggregate in PHP8; so I can properly initialise it with zero values rather than nulls
I love ds; but until it replaces SPL datastructures in core, then it isn't an option
 
2:56 PM
--disable-debug prevents cli sapi from building ・ *Compile Issues ・ #80388
 
3:27 PM
Did we make DS core? Or are they just using the manual for their docs?
 
Just the manual
 
3:41 PM
@beberlei Yes.
 
For posterity, I think making it easier for users to use extensions, without touching system files is pretty much the highest priority problem to address...imho
 
Yahallo folks
 
PHP 5 vs 7 was obviously a big difference in code, and for the specific bits we integrate with in PHP 8 (observer API, error handling), the code is already substantially different. So yeah, PHP 5, 7, and 8 have their own source trees. We'll trim them down and extract some code upwards that will be shared (stuff that is version agnostic) over time.
 
lo all
hey danack :)
 
I deny everything.
/waves
 
3:44 PM
thx again for your explanation on form request handeling.
i found someone else who had the same system in symfony
 
I think it's finally time, folks. So long, and thanks for all the fish.
13
 
o/
 
@salathe laters salathe. Thanks for all the work you've done. Also....hope that's just the open source you're stepping back from....
 
@salathe Are you dying?
 
@salathe What's happening?
 
3:48 PM
@salathe sorry to see you go, but understandable. Thanks for all the help you've given me in the past :) good luck with whatever you plan to do
 
@salathe :( why that?
 
@salathe Best of luck with the future.
 
@salathe Thanks for all your work, wish you all the best!
 
Wes
what's going on?
 
I'm working on this app that deals with calculating currency and percentages. Getting "inf", my question is what would make PHP think that is an infinite number. At another part of the app I'm doing the same formula but getting the correct values.
 
@beberlei did you have time for the attributes docs?
@SalOrozco Because you are using floats which is always a bad idea for currencies
But if you hit the limit of what a float wants to represent you'll hit inf
 
ahh ok
 
Wes
of course today i had to waste ages on the weirdest thing ever. getting a load event without a domcontentloaded event
probably because of malformed html
 
What is the best practice for handling currency in PHP?
 
4:09 PM
@SalOrozco packagist.org/packages/moneyphp/money is probably in the top three.
Money::EUR(500);
 
@Danack thanks
 
Wes
that reminded me of something. in ext/intl there's something to format money that wants float values :B
and there should be a bug report about that (could be fixed by now)
 
@Wes That is reasonably safe. it's only when you start doing maths on currency stored as floats that the real problems arise....
 
Wes
hm, that makes sense, yeah
 
@Danack "Fowler's Money pattern", I've never heard of that. Is that a book, or article?
 
4:15 PM
yes.
 
@salathe Thanks for all the work!
 
@Stephen no, chopped lipher.
 
...
 
4:34 PM
@DaveRandom trombone sound
@Danack lol
 
With strict_types=1 catch type not validated ・ *Programming Data Structures ・ #80389
 
wat
 
4:52 PM
> * @author Tom Egan
ah! a vital part of a bug report.
 
if a leap year is when we add an extra day, surely adding an extra second should be a leap hour
 
A Leap Year has an extra Leap Day. So a Leap Hour contains an extra Leap Second.
Or would if date/time math made even the slightest bit of sense.
 
!!blame @Derick
@PeeHaa fixitfixitfixitfixit
 
 
5:07 PM
yeh I was just reading it
 
hahaha right said... Chris
 
@salathe Thanks @salathe for all your help!!!
 
5:25 PM
Thanks for all the work that you've done over so many years @salathe
2
 
5:42 PM
@IluTov I'm currently writting the docs for match, can you clarify the behaviour of block expressions?
Oh wait, I was on the V1 RFC...
 
 
1 hour later…
6:46 PM
@MarkBaker the offset thing reminds me offsets in memory in computer, but as far as I know, PHP can't access memory of the computer directly.
 
I'm getting Assertion failed: (is_handle_exception_set() && "HANDLE_EXCEPTION not set?"), function zend_throw_exception_internal, file /usr/local/src/php-8.0.0RC5/Zend/zend_exceptions.c, line 171. with RC5 when throwing an exception during shutdown. I'm not seeing any mention of HANDLE_EXCEPTION in upgrading. Any ideas? The code worked fine with RC1.
 
@Clarity No worries FFI has you covered for all your memory management screwup issues!
 
@PeeHaa I hope that this possibility won't be used in bad purposes.
 
7:10 PM
Actually just thought about it, but @Crell you might also be able to help for the match page: github.com/php/doc-en/pull/206
 
@Danack To what?
 
@Derick how to debug 'class not found' exceptions by setting a conditional breakpoint inside the appropriate composer code.
 
7:32 PM
@Girgias Want me to just throw edits at it?
 
Iterable not covariant to mixed ・ *General Issues ・ #80391
 
@Crell Go for it, I spent some time trying to write it but I'm pretty stuck :/
 
On it.
 
Can't close stdin of ssh2 stream ・ ssh2 ・ #80392
 
@Girgias Bunch of edits and comments for you.
 
7:51 PM
@Crell Cheers, you can always checkout that branch and propose some changes too :) (currently updating the FR translations with stubs changes)
I think the optional match (true) is rather important
 
I'm supposed to be writing stuff for work right now, but perhaps later I can. :-)
After I merge the constructor changes, since apparently PHP is an uncultured bunch of heathens who expects people to merge their own code...
 
@Crell Btw about that, I'm not sure that the "engine limitation" bit should be in it, but other than that I think its fine (from what I recall lol)
 
Pourquoi? I think it's important to know that you can't type a promoted argument as callable.
 
8:14 PM
Well, I don't think it's particularly important but not a major complaint tbh :)
 
Agree to disagree then. :-)
 
9:09 PM
cd foo \
ls -l
What is \ called for that?
 
Reverse solidus?
 
@Danack newline escape?
 
@bwoebi ta
 
@Danack continuation line
 
@makadev actually - yeah....that seems to actually be more common. so ty.
 
9:15 PM
Isn't it just escape character?
For either newline / space or whatever?
 
@Girgias Thank you for taking the time to document the match expression! I'll read it right now.
 
@PeeHaa Na, the continuation line is consumed and ignored, escaping would mean it is still there. For example you can also break strings but it wont introduce a newline.
 
Is it really eaten? Not escaped?
Guess that makes sense
 
Build of PHP extension fails due to configuration gap with libtool ・ Compile Failure ・ #80393
 
Wrong chat :D
 
9:37 PM
@Danack continuation
 
@Girgias I don't have much else to add apart from what @Crell already said. The rest lgtm :)
 
@IluTov Right :) will try to get back to it
@Crell by compound arm you mean a, b => val right?
 
Right.
 
10:28 PM
@nikic I did not expect whining about union types.
 
Fatal error when using cakephp/chronos with preload ・ opcache ・ #80394
 
Eh, big corporations are always anti-union, so they can exploit the workers even more.
 
@Danack Your tweet prompted me to look at this, must say the title is very confusing too
But I've heard people whine about union types for a while
For some reason people would rather have intersection types than union types
 
Porque no los dos?
 
As apparently "union types incentivise bad function design"
Oh I am for both
 
10:42 PM
@crell the context is stuff like: en.reddit.com/r/PHP/comments/jxtjx1/…
Where some people are saying emotive statements about programming techniques.
while being 'slightly' wrong.
 
LOL
Oh Reddit. Good to know you never change.
 
and at least a couple of people in that thread regularly comment in /r/php and think of themselves as reasonably informed individuals.
Nov 6 at 14:29, by Danack
May 13 at 13:15, by Danack
@StatikStasis Thanks. When I ragequit the PHP project, I will go through the chat log of this room and find who it was who said the problem that PHP internals has it "not enough community involvement" and take the piss out of them until I get kicked.
 
@Danack I'm sure their valuable feedback will be given all the consideration it deserves.
 
Must love the comment saying that will encourage breaking LSP
you know that it's enforced by the engine right?
oh wait, no you don't, you don't know what it is
 
11:00 PM
Woah. Nikita snark. That's not something you see often.
 
@Girgias I think two things. i) trying to be precise with semantics when it comes to descriptions of properties of code is not particularly useful but also ii) LSP doesn't actually say anything about wideness, that's more what contravariance says about code. LSP doesn't say much about what mechanism is used to make the subtypes 'behave' the same way.
or to recycle some words:
> PHP allows contravariance (aka type widening) for parameter types to obey the LSP principle. A subclass may use a 'wider' aka less specific type in place of the inherited type for a parameter.

PHP allows covariance (aka type narrowing) for return types to obey the LSP principle. A subclass may use a 'narrower' aka more specific type in place of the inherited type for a function return.
though examples of stuff breaking is easier to demonstrate...
 
@Danack Might be true, but I feel most people have trouble going into very abstract notions (not saying I find everything easy) but I consider a type specification as a union of sets, which makes a subtype easier in my brain
 
...that doesn't fit into my head most of the time....I normally either google words I've previously written about this, or just think of examples of how stuff would break.
meh....downvoting stupid people prevents useful conversations from being had imo....
 
I mean... I like abstract math and that's what I mostly enjoy studying, group theory is rather neat in seeing how much you can "know" about a given structure when only a couple of properties are true
 
The preloading article posted recently was an interesting read, although I'm not sure about the sense of leaving validate timestamps on with preloading enabled.
 
11:12 PM
@MarkR maybe something like where you have a PHP file that is used for caching values?
 
@Danack Hmmm. Good call.
 
@Girgias I did chemistry and molecular physics at uni.....so I'm better at figuring how to make stuff burn/desolve than limits of knowability...
 
@Danack It's also a more practical uni degree one could argue :p
 
11:28 PM
@Danack feel free to decline to tell the story, but how did you end up in programming from chemistry/physics?
 
At school I did science subjects, and knew I wanted to either be a scientist or programming as work. And I reasoned, it's a lot easier to teach yourself how to program, than it is to teach yourself university level chemistry + physics.
 
fair reasoning
 
It's slightly annoying that if I'd gone to uni a couple of years later, there were many 'computational chemistry' courses available, which would have been a better fit than......a course that involves far too much quantum physics for my taste.
 
cmb
@Crell I think that's more about generality; if another type would be introduced that can't be used for properties, that would have to be added in this particular place as well. That said, I don't really mind whether callable is explicitly mentioned or not. :)
 

« first day (3688 days earlier)      last day (1266 days later) »