« first day (3555 days earlier)      last day (1376 days later) » 
00:00 - 16:0016:00 - 00:00

12:57 AM
Should I watch Good Place (TV series) or Sweeney Todd (movie)?
 
I liked the first three seasons of The Good Place (haven't seen anything newer yet).
 
Alright, I'll give it a go
 
 
1 hour later…
2:15 AM
@Girgias Yes, I think it's a lot clearer now. One small nit: the string offset examples are confusing when each one uses a different number. It would be easier to follow if they all use a variant of the same number (e.g. "2", "02", "2str", etc.).
 
 
4 hours later…
6:07 AM
Git mergin'.
 
6:21 AM
php-7.4.8.tar.gz checksum ・ Website problem ・ #79826
 
6:35 AM
morns
 
\o
 
cmb
7:11 AM
bugsnet seems to be down again :(
 
7:25 AM
@cmb if they lay you off or reposition you to a team/project you don't like, drop me a line.
 
cmb
Thanks! Will have to see how that goes first. :)
 
7:57 AM
Ugh
What this time
@Tiffany Good Place is awesome, but not like Friday Night Dinner is awesome :-)
bash: /bin/ls: Cannot allocate memory
that's... not a good sign
derick@bugs:~$ ps aux
-bash: fork: Cannot allocate memory
nor that
id: error while loading shared libraries: libpcre.so.3: failed to map segment from shared object
 
time for a Windows solution
on-error-reboot
 
Had to reboot it. I wonder what fucked up.
 
8:31 AM
!!rfcs
 
8:43 AM
@Jeeves I want a waterfall of yes votes for named args
 
here you go
 
done my deeds
 
Do we know what it's gonna be to @@ and namespace_as_single_token ?
 
@NikiC namespace as single token is also helpful for named arguments am I right? say i have an argument named "enum" (to stay with your example)
 
@beberlei no, that'll work either way
 
8:49 AM
yeah once i wrote it out, it made no sense ;)
thanks
 
@NikiC Did the named arguments RFC change since we spoke about it?
 
Oh snap, just saw the named params RFC moving :o
 
@Derick there were a few very small changes announced on list beforehand
 
I'll read it again then
 
9:06 AM
@Derick iirc, mostly centered around the inheritance fallback (removed) and cuf()
 
@NikiC you wrote in a mail that named arguments has its problems and you're not entirely sure if it's a good idea to introduce them. So now you're more sure about it? Is it because of the changes since then?
 
@MátéKocsis For me it's mainly a question as in "do we really want to - we we're going to be practically unable to revert that"
the semantics are about as sound as they can be I think
 
9:27 AM
@MátéKocsis I think the biggest issue is that it will now make argument names part of method's/function's signatures. And with no resolving or checking of inheritance, this could lead to a big mess. As the RFC states already "This is a pragmatic approach that acknowledges that named arguments are not relevant for many methods, and renamed parameters will usually not become a problem in practice." — so I'm really on the fence about this one.
 
Yes, this is the core tradeoff of the RFC, and I believe the fundamental tradeoff of any named params implementation.
 
If it was opt-in per method/class/file or something, then that issue goes away. But it also adds even more complexity.
 
Yes, unfortunately an opt-in also removes most of the usefulness (to me)
 
@NikiC Yes, I see that! I mainly asked this question because I saw that you voted yes, and I was curious if this means if you
 
Yes :-)
As for the namespace token RFC, as I begin to "hate" the @@ syntax very much, it might indeed mean I will vote against it :-(
 
9:32 AM
@MátéKocsis @Derick I think the BC / API issues are mainly something that is concerning to theoretical purists
This is why Nicolas (someone who actually cares about BC in a practical way, going so far as to support PHP 5.5 - 8.0 in Symfony) is in favor of this feature, while Marco (who is something of a BC nazi, dropping PHP versions directly on release) is against it.
 
I think there is a big difference between in-house projects, and open source library authors.
 
@Derick yes. Also, in practice, I found myself very rarely in need of actually changing public interface names of my classes without changing the semantics of the parameter as well. And if you change the semantics, it's good that things break.
 
There are quite a lot of the latter... and they will have extra maintenance burden because they can't control whether users of the libraries call their methods with named arguments or not.
 
@Derick A strawpoll about reconsidering short attr syntax?
 
hah, good luck.
 
9:35 AM
nah it doesn't make sense
I really wish the results were different
Today I saw some article describing the introduction to new features in 8.0, but since @@ is not a thing yet it used <<>>
 
@Derick I think that past the additional upgrade for PHP 8 support (where you might want to scroll through your method signatures to check if names are sensible) the burden becomes "just don't change parameter names, the same way you wouldn't change method names"
 
@brzuchal So does Nikita's named argument RFC ;-)
 
@Derick yeah but that was not described in that article
 
@NikiC What if random other projects subclass things and change names? :-) And I am not sure whether it's feasible that for a "PHP 8 upgrade" you should rename all the argument names that make sense to do, if the other part of a "PHP 8 upgrade" is just seeing it pass in CI
 
@Derick I don't do subclassing :P
Subclassing from other projects would only matter insofar as you are using named parameters internally in the library, right?
And would only break the code doing the bad subclassing?
 
9:42 AM
I suppose so... unless they're both third party libraries?
 
@Derick Well, Nikita did an analysis on that … I've been on the fence about that as well. But ultimately it's not a good idea to overload the meanings of parameters in subclasses… You should not only follow LSP merely in the in/out values, but neither violate LSP in the semantics of the code. And I feel not allowing a parameter rename is setting that even more in stone. Which is a good thing.
 
I might change my mind.
 
Is there any site tracking RFC mailing list discussions?
 
@kocsismate oops, i sent my last message too early 😃 judt noticed it
 
There usually is no reason to change names unless you do shady things.
 
9:44 AM
Anyway, I don't think named parameters will cause an issue for my own open-source libraries (apart from PHP-Parser, but only in the sense that I'll have to add parsing support for it :P)
 
if you are widening the parameter it may make sense string $str -> mixed $anything
 
@MátéKocsis Are you talking to yourself? ^^
 
@pmmaga because $str is also a terrible name… should be rather like $value or whatever.
$str bears exactly no meaning except repeating the type
 
@bwoebi Ok, but as an illustration. Maybe Dog $dog -> Animal $animal is a better example. I think the var name repeating the type is kind of common..
 
@NikiC yes 😃 btw if named params get accepted then we really should work on internal param names before the final release before this is our last chance for quite a long while
 
9:55 AM
@MátéKocsis yup
 
@Sean news-web.php.net/group.php?group=php.internals other than that, what are you looking for?
 
@pmmaga Dog $toFeed would be better
 
@NikiC out of interest, where are you looking forward to using it? aka what's the usecase that wouldn't be supported by opt-in?
 
@pmmaga param names should describe their role, not their type, on API boundaries. Named params are probably a good time to reflect about that.
 
@Danack A big one is constructors.
 
10:02 AM
@bwoebi yeah, I agree with that
 
@pmmaga feed($cow, $dog) … so, we're feeding a cows meat to the dog or the dogs meat to a cow? :-)
 
@bwoebi lol
 
:D
 
$strOrNullUsername?
 
@James ?string $username
 
10:03 AM
@Danack Cheers! Specifically I wanted to understand the opinions for the T_PAAMAYIM_NEKUDOTAYIM RFC
 
@Sean I try and maintain github.com/Danack/RfcCodex/blob/master/rfc_codex.md - but I deliberately avoid summarising things that are under vote/discussion because otherwise I might not be able to maintain any sense of neutrality, and start calling people dumb.
 
@bwoebi I know I was joking. Maybe it just wasn't funny..
 
it wasn't particularly funny nah
 
@NikiC and opt-in is no good, because you're creating objects from other people's code and they might not have opted-in?
 
@Danack Yes. The larger problem is that code cannot opt-in without raising their minimum required PHP version to PHP 8.0.
 
10:12 AM
...that seems like not a big burden? To me it seems fine to have new features only available in new versions, and that people need to upgrade to get the new stuff. Also, the side-effect of not working by default, means that there isn't a surprise new BC contract imposed on libraries that might not have had a chance to review the names of parameters. ¯\_(ツ)_/¯
 
user379888
Can anyone help share names of popular PHP web servers except Apache?
 
@fuddin nginx + caddy
 
@Danack It's not a matter of upgrading to get the new stuff, it's a matter of everyone else having to drop old PHP version support for you to get the new stuff.
And that's just not happening, realistically. 5-7 years minimum.
And I'm also not convinced that opt-in is a good idea on a purely conceptual level either
 
user379888
@Danack: Thanks.
 
I think that would increase the maintenance burden, rather than the other way around. It would add one more question to answer for every method you introduce.
And would result in style mismatches between the library author and the library user. If the library author personally doesn't use named args and doesn't bother to annotate things, suddenly the user can't use them either?
This goes against the concept of something like strict_types, which leaves the user the choice
Anyway, time to get some work done
 
10:27 AM
Can I force 2 classes to use a single parent class' methods and have body in the parent methods? I want to force using the same code to define data in some classes.
 
I must say that making more ctors private will likely mitigate all this @_@
Can already envision code that I'll have to review 4 years from now, when the first corpos start dipping their toes in 8.0.0
 
@James that sounds like an abstract class?
 
new to abstract, tried every which way. I can force the need to use parent methods but that's override. I want to force using the method body
 
mark the method as final in the parent?
 
@Ocramius I'm always happy to provide you with more lucrative consulting opportunities :P
 
10:31 AM
@NikiC there's already Laravel for that: I already make piles of money off removing framework integrations
 
@James sscce.org make an example following the instructions on that site. Trying to decipher code requirements from an english descrption is hard.
 
so class A is parent with getThing() {return 'foo';} class B has to use getThing() and will get 'foo' as the value, it can't set it itself.
 
@James and gist.github.com
 
I can try but I dont know what to do to make an example, it'd be wrong code. ie I tried making the parent class abstract and the function "final public function" but child isn't forced to use it. I tried making parent method "abstract public function" which forces child to use it but child can define its own value (I can't have body in parent method if abstract)
 
as[odjapsodjpas'ojdp'asjd[osd
> Trying to decipher code requirements from an english descrption is hard.
 
10:41 AM
@Danack you okay there, bub?
 
one of the few things that I get worked up about is when I spend the time telling someone how to ask for help in a way that might get them an answer, and then they tell me 'no, I'm just going to repeat my question again'.
 
@James Wrong code can still help to understand what it is that you're trying to achieve.
 
@pmmaga thanks making the abstract method "final" did it, I was setting the parent method in the child when I just need to use $this->parentMethod and it uses the value from parent body
@IluTov yeah fair enough, will remember for next time and fire examples from the getgo :)
 
do guys have any plugin for CRUD in php with AJAX?
*you
 
@AhmedAli Ajax how?
Maybe you're looking for a headless cms?
There's also API platform: api-platform.com
 
10:52 AM
no the plugin just take the table and create CRUD I made it by myself but as normally didn't finish it and get some messy code at end.
I will create a new one and make it open source by the way Thanks for the help @IluTov
 
@AhmedAli Yeah but CRUD how? Are you looking for framework that helps you with build REST APIs or just something that helps you manage data?
@AhmedAli Slow down :D There's tons of good solutions out there.
 
helps me manage data like showing it on table and have modals for edit something like that
 
If it's just about an admin interface you can also use Symfony's EasyAdmin bundle: symfony.com/doc/master/bundles/EasyAdminBundle/index.html
 
ohh nice stuff
 
@AhmedAli Yeah easy admin might be what you're looking for
 
10:55 AM
yeah Thanks bro
 
o/
 
o/
:)
 
ohai :)
 
@PeeHaa did you see the news that soon you might have to learn a real computer?
 
hehe I saw it yeah :P
I'm moving to .net now ;)
 
10:57 AM
bye, have a wonderful time.
 
Shivers
 
unrelated, I miss conferences : (
 
How's the beach?
 
I attended the dpc online this year and that was nice. Wondering if there's any upcoming
 
@Ekin I miss my local user group....they've been having them online but it's really not the same.
 
11:02 AM
@Tiffany mostly done pool time so far : P it's been nice
@Danack yeah I feel the same
 
@Ekin beside the pool or in the pool?
 
Still better than nothing I guess. Missing the hallway tracks though
@Tiffany well both. Working next to the pool, taking 5min dives : )
 
We need waterproof laptops...
Lay on a floaty and work :D
 
heh
@Danack just a thought... what if we did a casual r11 conf sometime? :)
 
That could be interesting
 
11:11 AM
As just a social thing or maybe a set of lightning talks with some interaction?
 
Por que no los dos?
 
Well mostly the latter but with some hallway time along with it would be nice
 
I realize giving talks requires more preparation for the people giving the talks, but it'd be fun
 
for sure
 
what day of the week would be best? Weekend or weekday?
 
11:23 AM
why so much nay for named params, its soo much amazeballs :-( :sad:
 
Can we have methods with same name but different parameters, like Java :P
 
Feels like weekend would be better @Danack
 
@beberlei suddenly having names of parameters be part of the contract for code. There is a non-insane case for making it opt-in. though that also has downsides - nikic above: chat.stackoverflow.com/transcript/message/49879644#49879644
@Ekin yeah. If nothing else, I would like to try running a casual online meetup to see if it can be done with a better social interaction than happens over zoom.
and weekends are more casual.
 
yep, agreed
 
grml, i composer install projects into my phpt folder, these dependencies now suddenly ship with a phpt test. Can i somehow ignore that tests/vendor/*/*/tests/*.phpt gets executed when running "make test"?
 
cmb
11:49 AM
you can specify the directories to use (make test this-dir that-dir)
 
@cmb but wouldn't it still use that as the root dir and search for all tests and find them in the subdirectory? :D
maybe i need to move the dependencies out to another folder than tests/
 
cmb
The given list must not include vendor; if there are too many directories, you may be out of luck. OTOH, maybe you want to provide a patch for run-tests.php adding an option for an exclusion list. :)
 
but be careful about how you name it!
 
mornings o/
 
12:07 PM
@MarkR mumble
Haven't had caffeine yet...
 
I know that feels. My dad came to say hi at mid day and I was still fast asleep, trying to engage in social conversation 5 minutes after waking up doesn't w ork
 
@Derick I hope people will vote for the RFC on its own merits, rather than based on dislike for the accepted attribute syntax. I think the opportunity to reduce BC impact of new reserved keywords is pretty valuable.
 
12:22 PM
"dislike" is not strongly enough describing my feeling about it
 
ok so:
1st August, 6pm UTC PHP social meetup. Suggested format will be lightning + short talks i.e. 5 minutes to 20 minutes in length, followed by some questions. Almost certainly will be using whereby.com for the communication channel. So will be hassling people to volunteer for talks closer to the time.
11
 
I hate @@
¯\_(ツ)_/¯
 
whereby.com only does 4 people
 
unless you pay: Up to 50 meeting participants. 12 participants can be on stage with video at the same time, the rest will be audio-only.
 
DId you look at jitsi as well?
I found that platform nicer
 
12:28 PM
@Derick not yet. planning to but I will probably regret trying to host that myself.
 
Yeah, I wouldn't host that myself either
You can also stream that to YouTube for more viewers...
 
Anyone know of a beginner's instructional video to SQL offhand? I'm trying to convince someone to stop using Excel for what they're doing and switch to a database and SQL, which I think is better suited to what they're working with.
 
@TheodoreBrown I wasn't sure if using the same wasn't more confusing so I used different ones, but will change it to use the same offset
 
I have paid accounts for both Whereby and Zoom that we could use.
We hosted our own Jitsi for a while but it was a hassle.
 
@Derick assuming I have time, and that my back pain doesn't prevent me, my plan is to i) setup OBS to be able to stream to youtube/twitch ii) use whereby for chatting social interaction. iii) actually run it as a 'show' where there's an output stream that is shown to people, that is a different view than participants see.
 
12:33 PM
@nikic Not sure whether I ever thanked you for PHP-Parser. Thank you! It's a pleasure to work with.
 
@SebastianBergmann cool. how has your experience been with managing people's access to it? Does the 'knocking on door' work reasonably well for managing who gets in to it?
 
@Danack We use Whereby for small groups and for that the knocking is good enough. We use Zoom for larget groups and have some code that talks to their API for access control.
 
Ask Slack to provide sponsored account, they be using it :P
 
I was at a virtual conference this week that used crowdcast.io although it seems to have no free plan, but maybe reaching out could be worth it
 
Slack has constantly issues with connections also IIRC not able to controll voice access since ther's no host and everyone can mess with meeting setup
 
12:39 PM
I think they've switched to AWS or something, should be smoother. Limit was 15 people for calls.
 
So the thing about whereby is that it's pleasant to use. UX is a really important thing when it comes to promoting social interactions, and both slack and zoom are not pleasant to use in my experience.
@beberlei are your results available anywhere for your measurements?
 
12:56 PM
Looking at the crowdcast.io presentation it looks nice
 
@Danack Microsoft Teams is pretty good for calls/interactions I would say.
 
Yeah but it's MS Teams
 
@MarkR Yay! Let's merge 8 to 7.4.954 and further and make that version support forever :D
 
@DejanMarjanović howfuckedismydatabase.com/nosql like typing detected.
 
1:12 PM
@Danack Feel free to hassle me.
 
@NikiC github.com/php/php-src/pull/5371#issuecomment-656661139 Is there an obvious way the opcodes can be restructured or will this need more fundamental changes?
 
@Danack Haha I didn't tell you to f* yourself but it can be interpreted that way :D
 
@IluTov I think it should be easy to fix by adding a dummy result to MATCH_ERROR
Seems to work locally at least. There are some additional (unrelated) opcache issues
 
@Danack not yet, i am a bit warry posting stuff
how the fuck does this get posted on theregister.com?
 
Well it was posted on Reddit
 
1:25 PM
/me is looking at Rust code with #[derive(Copy, Clone, Vertex)] sigh
Syntax Envy ;)
 
i found an "invoice" i sent to some dotcom boom company for some php work i did in 2000. thought they got under when the bubble crashed, given how their bosses at the time were super proud of their porsche cars. found out the company still exists today and plot twist, one of their subsidiaries is even a tideways customer. crazy
 
@SebastianBergmann I'm still waiting for someone to demand an extra vote on @@ vs #[] on the wiki.php.net/rfc/namespaced_names_as_token RFC ;)
 
@NikiC If I could already vote for namespaced_names_as_token then I would have voted for it.
 
@NikiC is the grammer for #[ OK? not that we find out that one is also bollocks: github.com/koolkode/php-src/pull/5/…
 
@NikiC random ping, could method/function overloading be a thing in php, like same name but different arguments?
 
1:36 PM
@DejanMarjanović no, never ever
 
@beberlei nah, that grammar is sane
 
@NikiC Well that settles it :D
 
o/ raises hand, I'm all for a vote on invalidating @@
 
@beberlei That one looks good to me
 
@beberlei unpaid invoice?
 
1:43 PM
@beberlei I also found an invoice of mine from 2000 recently :)
 
@NikiC I demand a vote recount!
 
@Tiffany i think they paid, but i dont remember
 
(Well, don't expect European friends to understand that one, anyway)
 
@LeviMorrison we read the news :)
 
@LeviMorrison We all live in Amerika
 
1:50 PM
Thankfully: no.
 
@LeviMorrison I dread to think how this year will turn out...
 
@NikiC What extension namespace handling approach would you suggest?
 
oops misstype
 
Hm, named parameters is going to be a close vote.
I can see that now.
 
2:06 PM
@SebastianBergmann @SebastianBergmann I mean it's Americanized, you're listening to their news and they don't give a shit about your news. (not meaning to offend anyone, nobody should give a shit about mainstream news)
 
debug_backtrace() does not return passed args ・ Scripting Engine problem ・ #79827
 
@beberlei Hi! :) about gaps... what time you use for graph? local time from server or your server time?
 
2:22 PM
@NikiC We should sneak that in as a secondary vote to every RFC until the result is the right one. :P
 
hehe
 
@NikiC Is there a particular reason why github.com/nikic/PHP-Parser/blob/v4.6.0/doc/component/… is not part of PHP-Parser? Feels weird to copy/paste that into my repository: github.com/sebastianbergmann/complexity/blob/master/src/Visitor/…
@salathe Please don't immitate real-world politics.
 
Any ideas on how to improve this bit of C code?
 
@SebastianBergmann Sorry, didn't mean to poke a sore spot.
 
2:33 PM
@SebastianBergmann Been using PHPUnit to improve some Xdebug performance! → vimeo.com/437114245
 
@Derick Nice!
 
@SebastianBergmann Because it's not always needed and has some costs
In particular it makes the AST cyclic. And one has to keep those parent references updated if one does changes
@Derick improve for what metric? performance?
 
@NikiC I'm particularly interested in your comments on github.com/derickr/xdebug/blob/performance-improvements/src/lib/… :-) It's very much a bottleneck
yes, performance
 
@NikiC All that is clear to me. But it appears I expressed myself not clearly enough. I am wondering why the code is not part of PHP-Parser. So that when you need it you can use it.
 
@Derick Why do you need to encode xml?
@SebastianBergmann oh
 
2:39 PM
Not XML per se, but HTML
it's a misnomer :-)
it's like html_entities, but... differentish
 
@SebastianBergmann Good point. It would seem reasonable to include a predefined visitor.
 
@NikiC I mean, the type/name resolver is also not always needed, yet it is part of PHP-Parser.
 
@Derick Just to mention the obvious: estrdup -> estrndup, don't refetch xml_encode_count[string[i]] in the inner loop
 
This code gets run for every argument to every function so that Xdebug can show stack traces with argument information. I can probably get away from this if it's safe to addref in my book before execute_ex, and then delref just after it's called. But I remember you saying that this is potentially not safe?
 
@NikiC Would you like a pull request?
 
2:46 PM
@Derick Is it possible to change the API? I see it is usually used in conjunction with xdebug_str_addl. Seems like a shame to go through an intermediate string allocation
@Derick I think I'm missing a connection here. Was your last link supposed to point something else?
@SebastianBergmann Sure
 
No, the link is good
str_addl is like zend_str_addl
 
@beberlei imo, you should link to tideways for all the things you write and contribute.
 
I guess I can hook that in, but it doesn't look like the alloc is currently the problem.
 
@Derick What is the problem?
Do you usually have to escape, or not escape?
 
about 66% of strings requires escaping, but I don't know up front which ones
I am not explaining this well :D
have 5 mins on whereby?
 
2:54 PM
@Derick ok
 
You know where
 
@Derick possibly dumb question - have you tried using: github.com/k0kubun/hescape ?
or similar
 
I haven't - but I just had a chat with Nikita and we came up with a way better idea
(or rather, Nikita did)
 
3:22 PM
He's a gem :)
 
@Danack i try to be defensive about mentoining tideways, i don't want to be pushy
@Derick the latest version of run-tests.php generated .sh flies allow you to pass "gdb" as second argument to do exactly "gdb --args $@"
 
@Derick I have been listening to your podcast on Spotify. Great stuff.
 
@NikiC YSHPR :)
 
@beberlei I'd also like the colouring scheme in the base test runner, disable behind a --no-colour option
 
3:37 PM
@Girgias yes, spotting failures is hard when they run by
 
@IluTov I had a totally random thought that might be terrible, regarding enums.

enum Foo {
case Bar = 5;
case Baz = "something";
case Beep = new class(int $param) {
// ...
};
}

Every enum option is always a real value... but that real value could be of any type including an anon class.
 
@SalOrozco Glad you like it
@beberlei My run tests is out of sync... lots of changes
 
Which would technically also allow for enum Foo { case Beep = new MyClass(5); } I don't know if that's good or bad yet.
I'm... actually kind of leaning good, as it allows you to break up code more easily should the enum get long, although then there are inheritance issues to think about.
 
@Girgias I did that in Xdebug's version: github.com/xdebug/xdebug/commit/…
 
@Crell Wouldn't you want a to/from scalar support for that (thinking how would you store that enum in a DB for example)
 
3:43 PM
@Derick I know I saw that from your Vimeo stream log :p
 
Possible downside: Since then Foo.Baz is of type string, not an object, I don't know what that does for matching logic.
@ircmaxell The original proposal I had was that enum had a built in __toString() that just returned the name of the enum value, which you could override. (cf github.com/Crell/enum-comparison#for-php )
 
@Crell do I understand correctly that it would allow defining a class inside an enum?
that has the potential to become messy :S but then that's how a lot of PHP is ...
 
No less messy than what Kotlin, Swift, and Java do.
Actually, I think allowing it to be a separately defined class has the potential for it to be less messy if classes get long.
 
the code complexity could easily get out of hand... what owuld happen if someone defines an enum, which defines a class, which defines another enum...
I mean, I guess it's up to the programmer to keep the complexity in check so that it doesn't get out of hand...
only use it for cases where there are clear and concrete ideas that someone else can easily grasp
I would be concerned also for php-src though, could that lead to a memory leak or segfault? (speculation)
 
That... actually makes a stronger case for what I'm proposing here, I think. :-)
 
3:49 PM
That's a good enum comparison by language.
 
Any enum mechanism that supports objects as enum values (which we absolutely want) has the potential for it to get messy. The goal is to make it as easy as possible to be not-messy while still getting the full benefit. A developer who wants to be messy will always be able to make it messy.
@SalOrozco Thanks.
 
@Crell true
 
I think I got all the interesting ones. My proposal for PHP at the bottom is still in flux, see also, this discussion.
 
and as is the case with PHP - people can write messy code, people can write clean code, core devs usually steer clear of arbitration (I think... I may be speaking out of hand)
 
The original proposal was to do something kinda like what Kotlin does. But that puts all the enum cases in one giant file; no big deal if they're small, possibly big deal if they're big.
 
3:52 PM
I would identify enum values by their name - and you can attach as much data as you want to an enum, but hidden behind specific accessors
 
By allowing it to be arbitrary value, you get the freedom to split it off to a named class if you want or inline an anonymous class.
@bwoebi If I follow you correctly, that's the idea. Foo.Bar (int), Foo.Baz (string), Foo.Beep (an object). Foo.Narf (fatal error)
 
would dot be the accessing operator?
 
It can't be, as it's the concat operator already
 
Actually... no, probably ::.
 
No, I rather mean an immutable property
 
3:53 PM
riiiight
 
on the enum value
 
The tricky part then is handling inheritance.
 
Foo::Bar->integral
 
@bwoebi I don't follow.
You could do that, certainly. If it's an object, just make it a public property.
 
how would you access a property inside a class, which is inside an enum?
 
3:55 PM
enum Foo {
    Bar(integral: 1),
    Baz(custom: ["abc"])
}
 
Foo::Beep->someMethod(); foo::Beep->aProp;
 
or, to make things more confusing, how would you access a property inside a class, inside an enum, inside another class, inside another enum...
 
something like that
 
@bwoebi Named parameters + constructor promotion. :-)
@Tiffany I... don't know how you'd even get yourself into that situation.
 
I don't either, I'm speaking in hypotheticals
 
3:56 PM
@Crell yeah sounds good.
 
An enum would just be a restricted type. If you type check against Foo, then the only legal values are Foo::Bar, Foo::Baz, Foo::Beep. Anything else is a parse error.
 
Either that. Or completely opaque value-less enums only identified by their name.
 
@beberlei I'll try and find a better link that says this more clearly but "If you are comfortable doing your job, you probably are avoiding doing things that would be of great benefit".
 
Enums are a top-level definition, though, so you can't define an enum "in" a class.
 
@Crell How can run time values be a parse error?
 
3:57 PM
A property of an object could be an enum value.
 
But I wouldn't do MyEnum::BAR === "123" ever return true
 
@Derick Possibly a fatal then. That implementation detail I defer to @IluTov, since I'm just helping with design and research. :-)
 
@Crell that makes more sense and reduces confusion for me, thanks
 
@bwoebi I haven't thought that part through yet, I guess. :-) This is a different concept than what is in the writeup right now.
 
00:00 - 16:0016:00 - 00:00

« first day (3555 days earlier)      last day (1376 days later) »