« first day (4311 days earlier)      last day (634 days later) » 

3:03 AM
ah, guess this is a bit old news
 
Yes, es it is :p
The PR is somewhat active on web-php
 
hi new to the chat
this site looks kinda old
šŸ˜¹
but it's okay
 
SO chat was brought around 2010, I don't think it's been touched since
 
3:46 AM
à propos of nothing, I actually quite like interacting with enums in Twig, only thing I could bicker about being "constant" being mildly misleading but something like {% if someEnum == constant('Some\\Very\\Namespaced\\EnumThisIsAnEnum::SomeCase') %} meets all my enum needs. I am not subtweeting the auto string enum implementation rfc.
 
 
5 hours later…
8:34 AM
@bwoebi There's another use-after-free in an observer tests. github.com/php/php-src/runs/7683747140?check_suite_focus=true
One day nightly will succeed šŸ„²
 
At least ext/random is clean now :-)
 
 
2 hours later…
cmb
10:39 AM
@Crell Such purity might be very hard to detect. Consider that even E_NOTICE might call an error handler, which may have arbitrary side effects.
 
Any work on this issue?
https://stackoverflow.com/questions/1538124/php-array-key-exists-and-spl-arrayaccess-interface-not-compatible
"PHP array_key_exists() and SPL ArrayAccess interface: not compatible?"
 
11:28 AM
@Stephen It's possible, but I've never debugged it.
 
12:08 PM
@cmb Oh that's still active? :o
@OlleHƤrstedt Nope, an object which implements ArrayAccess is still an object at the end of the day
 
@Girgias Sad :( But isset() works fine
 
isset works on everything :')
Also isset/empty are inconsistent between string and array dimensions IIRC
Opened a bug ticket and got a fix but it breaks BC
Need to talk on internals about it
3v4l.org/YhEYe found it again
 
@Girgias According to the SO thread, ArrayAccess do not behave the same as SPL array objects
But whatever, doesn't matter
 
Which dates from the PHP 5.3 era it looks like
So an up to date behaviour observation in PHP 8 is pretty much needed I think
 
Mm
Now, who's gonna make it for free.....
 
cmb
12:27 PM
So, array_key_exists(string|int $key, array|ArrayAccess $array): bool? Why not extend this to other array functions; or maybe just leave as is.
 
Also technically an ArrayAccess object can take other keys than string|int
 
1:26 PM
@IluTov this sounds like an actual bug and not just a zend_tests failure ā€¦ I'll check that out
 
1:45 PM
OK, what did I miss?
 
@Girgias The "AAAAAAA"s near the end. XD
 
2:29 PM
o/
 
o/
 
\o
 
2:44 PM
ô/
 
2:54 PM
combo breaker :(
array_map can only see single entries of the array it's looping over?
 
cmb
@Tiffany If you mean a single element of each array, then yes.
 
I need an interactive rubber duck
I have an array from decoded JSON, which contains an array of phone numbers. The array includes the phone type and phone number. I need to transform this data into an array of objects, where the object uses phone number and phone type. If the number is the same, but the phone type is different, then both entries should be included. Trying to figure out the best way to go about this... maybe loop through the JSON-decoded array, and instantiate objects based on the data present, then loop through the array of objects, and filter out if phone number AND phone
was thinking through a way of looping over the array of phones and checking if phone number was the same, then trying to check if phone type was the same, then instantiating the object then... but this means my code has to be aware of multiple elements in the array, which becomes messy
 
3:19 PM
Create a multi-dimensional array of objects as you decode, $decoded[phone-number][phone-type], then flatten when done?
 
that is a behavior I don't use often enough
 
cmb
basically 3v4l.org/6evNL
 
similar.... I would probably on the first pass of the data, create an array of UserPhoneDetails objects, and then as a second step iterate over those objects and do the checking inside that object of which ones needed to be added to the big final list - gist.github.com/Danack/ddcb5290720e4dbbeec1b233692bdd10
 
@cmb Precisely my point. A language-enforced pure flag would have to be near-perfectly enforceable, and I question if that's possible.
 
3:35 PM
@Danack I guess I'm confused on what $phoneDetailsToAdd should contain? this is roughly what I had started gist.github.com/tiffany-taylor/bec95a2651182a468badbf24a3dc7fa9
 
@Tiffany $phoneDetailsToAdd is getting the appropriate details per user inside that function. As I said, I'd split the problem into two parts i) build a list of all numbers for users ii) reduce that list to a smaller list by the rules about which ones are meant to be added or not.
And my days of wanting to work with multi-dimensional arrays of stuff is behind me.
 
I'm getting hung up on what a rule would look like, in the context of what I'm working with, because there are maaaaaany possibilities. Once I have an array of objects, I have consistency of data, at least. But I'm still confused how I would make a rule around that.
and it adds behavior that's out of scope for what I'm working on, however it's something that could be added
 
Yeah...that's why (imo) splitting parsing data into one piece of code, and then having filtering be a completely separate piece of code, would make the problem easier to reason about.
 
gotcha
 
And then when someone inevitably comes back and wants more special cases added to the rules....you'll be less likely to want to stab something.
 
 
1 hour later…
4:57 PM
Is there a setting to tell PHPStorm not to index phar files?
 
@Danack I don't have any phar handy but could maybe that last option work? jetbrains.com/help/phpstorm/…
though I admit I'm not totally clear on what exclude does within phpstorm, generally excluding folders I don't want to appear in my searches makes them not appear in my searches.
 
@FĆ©lixAdriyelGagnon-Grenier thanks but meh. I was hoping for a global exclude, as I don't make phars myself, so PHPStorm is just merrily scanning stuff that I consider to be blackbox e.g. phpstan. And so the amount of stuff it's indexing is way higher than if it just scanned my own project files. Excluding the files one by one is too much like work.
 
the file-pattern matching exclusion should do it then, probably something like *.phar
 
'Exclude' means, don't consider this file to be part of the project, so PHPStorm will never consider any code in there to be used by the rest of the project, so things like 'go to where this function is defined' would never take you to an excluded file.
ah, scrolling up.
 
Asymmetric visibility is probably nice, buuuut what happened to that namespace visibility PR/RCF??
RFC*
Package private properties would be nice... :')
 
5:12 PM
@Danack This is a pain point for me as well. PhpStorm likes to import functions defined in psalm.phar.
 
@Trowski adding *.phar as described in Félix's link above does seem to make a difference. But PHPStorm seems determined to look in a directory create that holds a copy of phpbench in it.
As an added mystery, for some reason all of the phpbench directories were marked as excluded individually. Deleting all of those and only having a single exclusion for the phpbench directory seems to make quite a difference.
As in, about 30 seconds to index after doing an 'invalidate caches and restart', rather than the multiple minutes before.
 
 
1 hour later…
6:40 PM
Flawless victory.
 
6:54 PM
For anyone in that conversation....gently asking him why his company doesn't sponsor might be amusing/appropriate.
 
his company is a startup and might not be flush with cash.....but it should be able to afford say 5% of an engineers salary....
 
7:32 PM
Happy Friday o/
 
\o happy friday!!
 
@PeeHaa hey. btw I replied to you on twatter.
 
Sorry life happened. Checking noaw \o/
 
Hi PeeHee :-)
 
@salathe! Hola o/
 
8:16 PM
Happy Friday. And vacation who celebrates. ^^
 
user17161735
hello guys.
 
user17161735
any way to check if pattern string for date is a pattern supported???
 
user17161735
    'A' => 'd/m/Y h:i A',
    'B' => 'd/m/Y H:i',
    'C' => 'd/m/Y h:i:s A',
    'D' => 'd/m/Y H:i:S',
    'E' => 'd-m-Y h:i A',
    'F' => 'd-m-Y H:i',
    'G' => 'd-m-Y h:i:s A',
    'H' => 'd-m-Y H:i:S'
 
user17161735
example of bad pattern given 'z' => 'FR-m-JJ H:i:S' but i need know it returning tru or false XD
 
10:04 PM
Read the docs?
 
 
1 hour later…
11:30 PM
TIL: security--stackexchange--com---z33c7www--hbcredit--gov--cn.ipv6.hbzw.gov.cn is a domain name that google at least thinks exist.
 

« first day (4311 days earlier)      last day (634 days later) »