« first day (4448 days earlier)      last day (725 days later) » 

00:06
looking at the internal threads and the RFC, i think it was suggested that `: void` becomes mandatory?

what we are saying here is keep the same behavior as now when it comes to return types, but internally, make it return `void`, so that `return`and `yield`are also banned by the engine at compile-time.
@SaifEddinGmati Same objective, it wouldn't have become mandatory yet, but allow to specify void and deprecate other return types
nope, don't even allow : void or anything else. just like we do now ( 3v4l.org/4BReF )
just make it implicitly return void.
@SaifEddinGmati That's dumb, if it has the semantics of void, it should be allowed to declare itself as void
The reason why you can return whatever you want is that the RFC to enforce those semantics got voted against
well, i don't see the point of allow `: void` when it is completely useless, if we are making all ctors return void implicitly in the engine, defining the returning type would be prohibited just like now.

if we change that and say "well, void is okay since it's implicitly void", we are not adding any value, nothing will change.
actually, we don't need to ban by-ref, if we make ctor void, by-ref will get banned as a result of that
@SaifEddinGmati To be explicit, and that one can start forcing people to put that return type. Like yes it doesn't add anything but if you specify it than you clearly opt into this correct behaviour while others may get deprecation warnings for returning stuff
I assure you, you won't be able to "just" change the semantics of it
00:22
@Girgias a deprecation warning for not specifying : void on ctor? that sounds like a nightmare.
if we just trigger deprecation when returnor yield are used in the ctor, that adds complexity.
Constructors are already special and weird, and I rather have them be somewhat more similar to other methods than not being allowed to type
@SaifEddinGmati For returning a value...
@SaifEddinGmati Welcome to trying to make this language saner when people do bat shit stuff with it
00:59
lol. we added the $eol parameter to fputcsv/fgetcsv in 8.1
it was something I had needed two years ago at a different job, but it ended up not mattering
 
5 hours later…
05:53
So, what would you call the PHP (Zend) VM? I mean, it's kinda register based ... sorta? ... The temporaries are basically kinda registers, right?
I mean I know they aren't, as far as I know, anywhere near 1:1 with a real CPU register. But in terms of a high level VM?
 
8 hours later…
13:29
Morning
\o
13:48
Whats up
14:34
@A.B.Carroll John.
John is a great name for a VM.
5
 
1 hour later…
16:00
@A.B.Carroll I would say it is, because instructions take input/output operands and do not push/pop from the stack. Even though temporaries live on the stack
My keyboard backlight turns off when I turn off my space heater. I want to ask why on ServerFault, but I don't think anyone will believe me. =o(
seems like an electrical thing
Entire system runs through a APC UPS. After some experimenting, it doesn't turn off if I move the space heater a few more feet away. But then my hands get cold. =o\
@crypticツ you should probably not care what rando's believe or don't believe. But also, running a space heater through a UPS sounds...ungood.
No, the space heater is not running on the UPS, the computer and all it's parts are.
16:13
oh, cool.
"it doesn't turn off if I move the space heater a few more feet away." - my guess would be it's a sudden change in magnetic field when the current stops flowing. No idea what to do about it though.
16:39
Faraday cage 🤣
yeah....wrap the keyboard in tinfoil....and look totally sane while programming.
@Danack wait, you guys don't already do that?
Not the keyboard, just myself.
picture from my desk
16:44
Alright, posted this serverfault.com/questions/1118500/… expecting some downvotes for sure.
a glitch in the simulation
If it does, it might get a better reception on physics.stackexchange.com the people on serverfault are kind of psychos about things being on topic.....and they might claim that spaceheaters don't belong in a business environment.
17:10
@crypticツ I thought of one thing to try, maybe. Is your keyboard connected via cable? And is there a lot of spare cable?
Yeah, it's USB and the cable is so long I had to wrap it multiple times around my keyboard tray rail. Which, now makes me wonder if I made an antenna.
Induction coil...but same idea. Let me try to find a picture, or take comedy set of instructional pictures.
So, something to try. First, put the cable in a coil. Second, grab the coil with two hands and twist so that it's in a figure 8. Then fold it in half to make single coil again, and then get some string or similar to hold it in that shape.
That should make the direction the wire is running in one half of the final coil be in the different direction to the direction of the other half.
And any transient current caused by a magnetic field should mostly cancel itself out.
17:25
While you were writing this I unravelled the wire and moved it as far away as I could from the keyboard and heater. The distance the space heater has to be has now decreased. Further testing shows that it has to be within about 6 inches from the cord coming out of the keyboard to cause the lights to go out. Will the above instructions help with that?
50:50, either it will or it won't.
aka I have no idea.
@crypticツ UPS is lowering down your tension, when you turn on your space heater tension rises, those suckers draw a lot of power, more tension gets to your UPS and then it's able to power your keyboard, try plugging directly to AC and see if you still have that problem
@ln-s But that doesn't explain why distance of the space heater effects the keyboard. Also the UPS would click and kick-in if the power surge is too much. That's why I had to move my laser printer to other room, it would trip the UPS when it powered on.
The UPS baseline tension is lower than your actual power requirements to power all your connected devices, that's my guess
@ln-s did you learn about electricity from someone who was born before 1950?
17:34
@Danack didn't change anything =oP, still has to be more than 6inches away to work.
@Danack How nice, I was missing your aggressive remarks
the word 'tension' used to be used.....but it went out of fashion around 1980. Ah, and back to ignore it is then.
Try it without the UPS
We call it tension, sorry if the term is incorrect
Not used to deal with electrical terms in English my bad
@Danack Apologies for my misinterpretation
And thanks for that clarification, which word I'm I looking for then ?
Voltage ? We use voltage too but tension when speaking in "electrical terms" (so I've learnt when learning ohm's law)
and circuits ... which I haven't done in about 20 years lol
@crypticツ Well, I tried. tbh, if you can keep them apart by more than 6 inches and that stops the problem then great. Otherwise will be interesting to see what answers to your question say. Possibly trying a electronics.stackexchange.com/questions/133937/… might be worth trying if you can acquire one cheap.
oooh, I think I have one of those lying around.
Found it! Does the placement matter? Should it be as close to the wire coming out of keyboard, closer to the USB connector, or placed on the loop?
17:46
Absolutely no idea.
Just going off of times I've seen those used on cables, I believe they tend to be close to the end that goes into the device.
But you should definitely try it in different places and see what works best
I tried it on both far ends and even the loop. Didn't make a difference. I probably need two, but I only have one.
Well, at least I can how keep my fingers warm without having the keyboard lights go out. Thanks for the help everyone!
@ln-s English does use "voltage" now though many other languages still use "tension" electronics.stackexchange.com/questions/605960/…
@crypticツ ah that's too bad that it didn't work. at least you found some improvement though
18:29
@crypticツ I wonder if the sudden surge in available amps is having an adverse effect on your keyboard causing the light on the keyboard to turn off.
@crypticツ Ah.. nvm, just reading this part.
 
1 hour later…
19:50
Anyone work at Cover Whale before?
morning all
Loooking for a help with Psalm psalm.dev/r/2f116fdea7
I try to fix the types annotations for 5h now, running out of any ideas
I'd like them to be compatible with Psalm & PHPStan
@crypticツ this probably defeats the point of keyboard back lights but looks cozy flickr.com/photos/bekathwia/2387173546
What I've noticed is both template keys T are separated as pinned to the method but calling one from another prevents from inferring the template type used inside
20:14
@brzuchal I noticed that declaring T|null as the return on get is fine, so maybe a bug with conditional types?
Or this seems to work: psalm.dev/r/a3049e26aa
@Trowski This I haven't tried. Checking against PHPStan
> Condition "T of object is object" in conditional return type is always true.
I don't see parameters referenced in the docs with conditional types, so perhaps that's not supported.
This is what PHPStan gives
:(
Well here it shows templates can be used with conditional
The template param, but not the param name.
That is, T not $type
Ahhh, ok I see it now
It works in PHPStan but not in Psalm
For both @return T|null seems to work
20:23
Missing feature in Psalm I think then.
Consider using @psalm-return and @phpstan-return, with @return being T|null
The thing is that if I use get with $type being class-string in another method and return it directly then it doesn't recognise the return type is not nullable
function foo (): object { $this->get(Bar::class); }
@Trowski Thanks at least I know it's not me doing something wrong
Why does get have to be nullable in the first place?
Yeah, thinking about making a variant with void return type and other with object return type
it's a minimum example of more complex code, designed to deserialize HTTP response to object if $type is given a real class
@brzuchal psalm.dev/r/fa1a52a817 something like that?
If $type is null (default) then don't expect output from HTTP response at all
And don't deserialize
@Krzysiek this works in PHPStan
I need a moment to move it to my desired code as it seems not working in Psalm maybe something else is wrong
20:33
That's not really correct, since Container can produce many different T, not one.
@Trowski The class name doesn't reflect the purpose here
Thanks guys, am gonna split the nullability of the return type and param in two variants of the method with void and object it'll be easier to manage the code also easier to grasp
20:53
@brzuchal I have something weird, adding @var T before return removes errors. psalm.dev/r/b5ca206131
I wasn't even aware that you can use @var for return, unless psalm is wrongly interpreting this, but makes it work.
21:33
@Krzysiek You're explicitly defining the type of the expression, overriding any inference, which isn't ideal.
That does work nicely though, Psalm is detecting the return type based on the conditional then. Apparently ($type is class-string ? T : null) does work, but something else is breaking the return of type of $this->instantiator()
22:16
If a method in a class calls FILE for the current filename, and an object of the class is being instantiated and the method being called in a different file, FILE should return the current filename, not the class' filename, right?
@SlamJammington __FILE__ returns path of file where it was placed, doesn't matter where method was actually used.
Ahhh gotcha, that makes sense. I'm assuming if it's in the constructor that it'll be the class filename too?
From what I remember __FILE__ is replaced with string path at compile time.
Yes, filename where it was used.
Sweet, thank you!

« first day (4448 days earlier)      last day (725 days later) »