« first day (3947 days earlier)      last day (1008 days later) » 

12:10 AM
@Dharman You need to update the RFC to point to 8.2
 
 
1 hour later…
1:26 AM
curl_multi_select() not blocking ・ *Network Functions ・ #81333
 
 
1 hour later…
2:37 AM
@Dharman No opinion on the difference, but you could have a worse plan than giving afilina commit access, and saying she's free to change it.
 
 
1 hour later…
3:47 AM
... I just wasted 6 hours of my life trying to hunt down env variables that were never set because I forgot i'd unset the protected flag
 
 
5 hours later…
8:29 AM
Hi, hope you are all good =] Ive been writting some rust a few years ago and wanted to share how cool macros it has.. I made a couple friday examples with embedded php, check it out docs.rs/friday/0.1.0/friday/fn.friday.html
 
8:40 AM
@RonniSkansing damn it, now it's going to be stuck in my head for the rest of the day
 
yea, it is a awesome rust function
 
- ・ GD related ・ #81334
 
 
1 hour later…
9:48 AM
Hey, I'm getting an error that a class can't be found, while importing services from resource I ran dump-autoload and cleared the cache and checked the namespace. any ideas?
 
10:38 AM
PHP Warning, Packets out of order after connection timeout ・ PDO MySQL ・ #81335
 
@KerrialBeckettNewham do you have the autoload section configured correctly in composer.json?
 
& in filename doesn't read file with file ・ Filesystem function related ・ #81336
 
11:27 AM
"fatal error C1900: Il mismatch between 'P1' version '202110113' and 'P2 versio ・ Compile Failure ・ #81337
 
I hate the zend_ini code and the fact that it does special case the value == orig_value case regarding refcounting… wtf. If the value was originally not modified and assigning fails, it should still have modified == false ...
 
11:53 AM
morns
 
@SaifEddinGmati "App\\": "src/" like so
 
psr-4? it should look something like this:

"autoload": {
"psr-4": {
"App\\": "src/"
}
}

if it is configured correctly, and other classes are autoloading just fine, they you probably have a typo in the filename or classname
 
@SaifEddinGmati that's what I have and there is no typo.
 
weird o_o
 
Morning All!
 
12:08 PM
Morning guys
 
@SaifEddinGmati indeed!
The directory structure is untraditional.
 
12:27 PM
@KerrialBeckettNewham what do you mean? it needs to follow PSR4
 
@SaifEddinGmati yes, I think that's the issue.
 
@KerrialBeckettNewham If class names don't directly map to a path structure, you can use a different autoload strategy: github.com/zetacomponents/ConsoleTools/blob/master/…
 
From what I remember, composer will scan all the files in "src/" and then set up a static map
 
12:44 PM
@Derick the dir structure is /dirname/Classname/ Entity.php - ClassnameRepository.php no sure what path structure that is..
 
the "classmap" strategy should be able to handle it
 
yield from + iterator to array is returning only 1 result when I have 3, thing is I have some other yields from in other places, I will try to provide a code example, but perhaps someone is already familiar with such generator manipulations
works with foreach (I get 3 results), doesn't works with iterator_to_array ( I only get one result )
The returned value does not implements \Traversable if that comes to your mind
That puts in persepective I shouldn't be yielding from test1
hmmm
 
duplicate keys :) iterator_to_array will override the previous value with new value, since they have the same key
 
1:42 PM
readonly properties cannot be used with iterators ・ *General Issues ・ #81338
 
@Jeeves lol
Another broken recent feature...
 
2:01 PM
honestly doesn't look like a bug to me 🤷‍♂️
 
ield from $this->readonlyArray Job done.
 
@NikiC The above bug reminds me that ArrayIterator is terrible. Do you think we can deprecate nearly everything on the ArrayIterator and drop them in 9.0? I hate to wait that long but all my other proposals get sidelined.
 
@SaifEddinGmati It's not a bug as it is by design, but still feels meh to me
 
@LeviMorrison yeah like … no previous(), no getPosition() … it's like half the API just missing
 
@bwoebi And the API that does exist means it duplicates the array unconditionally, not just a copy-on-write situation.
It's really terrible.
 
2:09 PM
I just want a lightweight API to operate on an array, ideally with a by-ref API or something equivalent. (because I see little reason to instantiate an ArrayIterator object just to get the last or second last element)
 
Well, we don't generally permit by-ref iterators...
 
@bwoebi Isn't DS a better solution in almost every case?
 
@PeeHaa Whether this is true or not, the fact is the built-in one has terrible performance and a needlessly complicated API (just use ArrayObject if you want that stuff).
 
No argument there
 
@LeviMorrison would make sense and is sanely possible thanks to zend_hash_iterator* API
Would love to see that API exposed in some way in userland
 
2:15 PM
Does ArrayIterator currently do by-ref for values? I assume not?
 
basically a possibility to retain a pointer to an array position in userland in a safe way
 
I think that can only be done directly on arrays.
 
whether that's now solved via an iterator API or ArrayPointer class or something like that, I don't care much
I don't like IAP either, but there should be a sane, proper replacement for it.
 
It would need complete ownership of the array, refcount == 1. It's also important to me that for common cases it doesn't copy un-necessarily. Maybe we could create a static method helper move that accepts an array by-reference and nulls out the caller. Have to think about whether to fail if refcount is still > 1, or if we should just duplicate it, but then we can call ArrayIterator::move($array) and for at least some common cases it won't duplicate unnecessarily?
 
@LeviMorrison no it does not require rc=1 ownership
 
2:24 PM
IMO it does, whether it is technically required or not. No way do I want an iterator to change the values out from under any other array... and if we invoke copy-on-write we can get unexpected performance issues. That's why I think it should be rc = 1.
Anyway, deprecating the existing APIs is the first step if we want to fix it. My attempts to provide an alternative haven't been met with much support.
 
@LeviMorrison What I want is actually an object having a view on an array, not an iterator as is.
 
Then adjust ArrayObject or something ^_^
 
2:41 PM
So far I can't trigger this rc == 1 check in userland -- you could do it internally, though. heap.space/xref/PHP-8.0/ext/spl/spl_array.c?r=bcefc31e4#1097
BTW, isn't there a helper that already does what that if/else does?
 
I use Nginx+PHP-FPM, in the case that nginx logs "upstream prematurely closed connection while reading response header from upstream", will nginx pass the request to the next upstream that is in the load balance configuration, or even use the "backup" server that is in the upstream list?
 
Do we have an attribute in stubs for deprecated stuff?
 
@LeviMorrison yes, @deprecated
 
Does it have a message or anything that it supports going with it? I assume not?
 
2:59 PM
@LeviMorrison The only effect it has is that a ZEND_DEP_FE function entry is generated for functions having it (and the ZEND_ACC_DEPRECATED flag is added for these methods)
 
3:10 PM
The deprecated attribute seemed to work correctly when used with the implementation-alias attribute, meaning the original function doesn't emit deprecated, just the alias.
 
3:21 PM
I really hate tests like this one: ext/spl/tests/array_017.phpt. 700 lines of output to verify? Seriously?
 
@SaifEddinGmati using false as a second arg to iterator to array worked, I forgot to tell you, thanks!
 
@ln-s Ah, i always forget about the second arg ^^ glad i could help tho!
 
Incident with GitHub Actions
Incident with GitHub Actions ・ GitHub Pages has Partial Outage
 
4:00 PM
I'm writing a php code which doesn't returns the state name even if it matches the condition. It only returns first condition.
$countries = ['US','Canada','France'];
$country = $countries[array_rand($countries)];
$state_abbr = 'NY';
$state_name = 'Paris';
$state = $country === 'US' || 'CA' ? $state_abbr : $state_name;

echo 'Country: '.$country."\n";
echo 'State: '.$state;
What I am doing wrong?
 
cmb
$country === 'US' || 'CA' doesn't test whether $country is US or CA
 
It always returns 'NY' even if the country is set to 'France'
 
It's executed as ($country === 'US') || ('CA')
Since 'CA' is a non-empty string, it's always true
You want: ($country === 'US') || ($country === 'CA')
or use: in_array($country, ['US', 'CA'], true)
 
This php-src job appeared to succeed but still has a non-zero exit status?
 
@AllenJB Thanks, it worked
 
4:05 PM
All issues have been resolved!
 
@DaveRandom Sorry to hear about the stress, mate. =(
 
4:20 PM
@LeviMorrison search for "failed test"
It actually runs three jobs
failure is spurious tho
 
@NikiC Ah, I didn't realize it ran more than one. Thanks.
My plan is to next open a PR that won't merge and has all the perf improvements to make sure everything that needs deprecated is deprecated. Will take me a few weeks, I think.
I had an idea just now. We could create ArrayObjectIterator which becomes the new default iterator (why they allow you to override this, I don't care to know).
We'll alias ArrayIterator and ArrayObjectIterator but the former will have deprecation notices on basically everything and the latter won't.
Anyone who wants to preserve the (terrible) API has to switch from ArrayIterator -> ArrayObjectIterator in 9.0, because in 9.0 the ArrayIterator will drop all those methods and become efficient.
But this is would be an easier transition than switching from ArrayIterator to ArrayObject, I think? Since it's only a name change?
What do you think, @bwoebi and @NikiC?
 
4:40 PM
hah! That syntax literally came up on the socials like... yesterday... This universe is weird.
That said, I wouldn't mind an in operator, just for readability sugar
Not enough farts to push for it tho
 
I guess I'd have to do RecursiveArrayObjectIterator too? Bleh. This junk is in more places than I hoped...
 
cmb
welcome to the wonderful world of SPL
 
@cmb I've been here since my php-src beginnings, ha.
 
SPL was 5.2 iirc
 
My first commit in php-src was a simple bug in the test code of the SPL :) github.com/php/php-src/commit/…
Actually, I'd prefer not to add ArrayObjectIterator and such because of assumptions in the code for the internal array object that's shared by everything...
 
5:14 PM
is there a practical, real-world use of 3v4l.org/2dRdb? (from php.net/manual/en/…, last example)
 
cmb
@Tiffany obfuscating code maybe?
 
@Tiffany you could abuse it for having strings in different languages. And then regret your choice when it comes time to supporting numbers in sentences.
 
5:39 PM
Conversation in another venue; Exploring PHP 2 syntax and finding stuff like this which is just.... mesmerising....

function foo $bar, $baz ( echo $bar; echo $baz; );
Like... it's not that weird.... but it's just weird enough, ya know?
And then to make the transition to PHP3 easier, we have old_function which parses the same as a PHP2 function.
And now I want like old_* syntax all over an April Fool's release.
 
6:03 PM
@Sara omg yes XD though people would probably be very confused and/or frustrated but... it would be April Fool's...
 
cmb
I bet, some would actually upload that release to production – because PHP …
 
and/or annoyed and/or angry
... users are why we can't have fun things
Test
 
@Tiffany .
 
Flaky internet, been having issues on my phone for a week or so :/
 
@PeeHaa 3 hours til vacation! \o/
@Tiffany I still need to get the Sky girl to make me an avatar.
 
6:11 PM
@StatikStasis tik tok tik tok tik tok
 
6:42 PM
@RonniSkansing \o LTNS
 
I never knew that you could call private methods of a class from a different instance of the same class :O
I don't quite understand why that would be
 
I've encountered scenarios where it has been useful.
Because a class has visibility to everything about itself
 
I guess it makes sense in a way, because private static methods exist (where there's no object)
But still unexpected
 
7:10 PM
For what it is worth. stackoverflow.com/questions/21900632/… They're talking about Java but ultimately the same principle applies. A class can access the private fields of other instances of the same class.
 
7:28 PM
you even rejected it at that time
 
cmb
Nikita closed the PR on April 1st
 
@StatikStasis eh, shit happens :-)
 
that would be best described as "</font> never happens"
 
@DaveRandom That gives me anxiety the farther I scroll for some reason.
Like serious butterflies
 
7:39 PM
Man, yesterday got to refactor how some stuff was done to really speed up the use of our application and I'm fucking pumped!
 
weirdo.
 
I do not deny this.
 
I love refactoring
 
I love it too
A couple months ago I spent a couple days doing a lot of refactoring that didn't really result in major changes to the UX but it removed like 700 lines of UI cruft and really simplified how we repeat a common pattern.
#feelsgoodman
 
Yeah it does. Even when I don't get a net gain from it, just making it look cleaner is good for me when I look at it...
 
7:42 PM
Yea, more often than not, if done correctly, reading the code becomes easier
And Java isn't exactly an elegant language to read at times
 
7:53 PM
@Derick Hey. Have you made an 8.1-targeted tag of xdebug yet? If so, I'm game to try it out.
 
8:17 PM
@bwoebi Yeah... well... I'm an arsehole
I wonder what my objection was...
 
@Derick Did you write this huge commit yourself? github.com/php/doc-en/commit/…
 
@cmb apparently the JsonPath people tried to apply for a pecl account, but something may be borked: github.com/supermetrics-public/pecl-jsonpath/discussions/…
 
I am absolutely confused by this merge commit. How did it happen? I thought merge commits are disallowed in PHP organization
 
cmb
@Dharman this was a local merge instead of a rebase; not really an issue per se, but translators may be confused/annoyed.
 
cmb
8:43 PM
@Danack we're terrible at moderating these account request, and apparently there was no mail sent to ML. Done that now, and replied on that GH issue.
 
@cmb thanks.
 
Opinions please: in an ideal world, if that link could go anywhere, where would it go?
 
GitHub PR guidance README
 
Huh. resource isn't a valid type? TIL.
 
or maybe point it to the right XML file
 
8:54 PM
@salathe wysiwyg editor that works
 
No more WYSIWYG editor
 
You asked for ideal rite?
 
That was the biggest stopping point for me and for many others from contributing to the docs
 
All opinions welcome. :-)
 
@Dharman I said editor that works
:P
Also we never had a wysiwyg editor?
 
8:57 PM
>Fatal error: Uncaught TypeError: a(): Argument #1 ($resource) must be of type resource, resource given
Confusing errors are confusing, because they confuse me
 
Expected string instead got string :D
@salathe Should go to the XML file I guess too
 
cmb
9:15 PM
@salathe that should go to the respective GH edit page; in this case github.com/php/doc-en/edit/master/reference/datetime/functions/…
@Dharman then don't make mistakes ;)
 
The biggest mistake one can make is to say they don't make mistakes.
 
cmb
"to err is human"
 
Hey @StatikStasis
 
@Allenph ltns :O
@salathe the XML file hosted on GitHub
People can press the pencil and fork and edit in the browser
@Allenph hope things are well for you
 
Hey @Tiffany. Yeah! How are you?
 
9:30 PM
@Allenph finally happily employed :)
In a dev role too!
 
@Tiffany Nice! What are you doing?You have the Discord by chance?
 
I'm in the one @StatikStasis has for his youtube channel and an Among Us one
(as well as others, but they aren't related to PHP)
 
Yeah! I was just looking for the R11 one with Teresko. I know there's rules here and I just wanted to catch up with you and my other friends!
 
I left the r11 one awhile back, dunno if it still exists.
 
Ahhh. I'll see if I can find his YT. :)
 
9:46 PM
/cc @Danack +english ppl especially
 
English people? You think we don't have twats over here? :)
 
I think the non-twats don't put as much effort into worrying about whether they are twats, anywhere else on earth
 
nothing to see here
 
Cool. Thanks Dave. :)
 
10:00 PM
@Allenph you there? eh, just view deleted history on the next message.
 
cmb
@DaveRandom the grass is always greener …
 
@cmb ...are you skinning up or should I?
 
cmb
:D
 
@DaveRandom skinning up?
 
10:07 PM
Ah
 
10:19 PM
@StatikStasis VACATION! WHOOP WHOOP! \o/
 
10:40 PM
@PeeHaa ^ autocorrect, should read "vaccination"
 
10:56 PM
@Crell master branch on github
 
Hm, OK. Now to figure out how to compile it within a Docker container, which seems to not have php-dev packaged. :-)
 
@Dharman Uh, that looks odd! I just thought I'd merged master into my own before pushing
@Dharman Looks fine in my local checks, just with a strange merge commit
 
I don't think we can do anything about it now.
 
11:29 PM
@Sara @Crell do you know of any place in Chicago that makes a sushi burrito?
 
I am certain I have seen them advertised.
 
Where?
I guess asking google at that point is just as well
 
yelp.com/… - I have not been to any of these places, but it seems you have ample options.
 
Yessssss
 

« first day (3947 days earlier)      last day (1008 days later) »