« first day (3802 days earlier)      last day (1152 days later) » 

3:44 AM
@makadev thanks for the reply. A bit of debugging later, I've isolated the problem to... "somewhere in the CSS file". When I remove the CSS and style the image manually, the issue doesn't happen. I guess better than no progress, but it's a big file.
 
 
4 hours later…
7:50 AM
I drafted something: wiki.php.net/rfc/enumset
\cc @Crell @IluTov
\cc @NikiC maybe for feedback on the Generic part?
\cc @Danack if you wouldn't mind doing some proof-reading? :-D
Feedback is welcome from everyone before I start implementing :-)
 
@bwoebi awesome! Could you add example code to turn them flags into a combined value, i.e 0644 - this would be code written to serialize or store in a database
 
@beberlei that's to be done in section examples, marked TBD right now :-D but can do that one
 
8:08 AM
@bwoebi no rush :) thanks
 
@beberlei wiki.php.net/rfc/… like that?
 
8:24 AM
@bwoebi yep, that is really generic so you dont have to customize it for every EnumSet. Given individual enums value are unique across the set
 
@beberlei yep, values are unique ... actually that would be an use case for a trait :-D
 
8:48 AM
erronous array key overflow in 2D array (only with JIT) ・ JIT ・ #80861
 
@bwoebi ah base class would not be possible, another would be to bit shift depending on case
 
9:15 AM
@bwoebi Cool! I'll read it sometime today.
 
@bwoebi uh, hard NO?
Introducing ad-hoc generic classes outside a larger feature sounds like a really terrible idea to me
 
10:05 AM
@NikiC I take it you haven't heard from Dmitry yet?
 
@IluTov We briefly discussed it but don't have a great solution
@IluTov An option is to implement the functions as op_arrays with a special opcode
And well, the possibility of dropping cross-process shared memory support on windows was raised again...
 
10:57 AM
@NikiC I was going to post an SO question regarding an unexpected change in preg_split()'s behavior since PHP7.3, but it feels so buggy to me that maybe this needs to be reported rather than asked on SO. Please see the first preg_ call in this demo: 3v4l.org/6EvPV The \K seems to break the limit flag.
I read "_REPORTED MATCH POINT SETTING
\K set reported start of match
\K is honoured in positive assertions, but ignored in negative ones._" but I don't understand why this would only break the count and not the functionality of the splitting.
@NikiC is this, in fact, a bug?
Further investigation indicates that the foulplay is specific to the restart metacharacter. Other techniques with zero width delimiters do not suffer the same result. 3v4l.org/3KP1T
 
11:32 AM
@bwoebi Implicit bool cast seems like a bad idea.
 
11:43 AM
Why an array instead of a variadic constructor?
 
11:54 AM
@bwoebi My initial thoughts:
* I'd prefer limiting coersion (bool, array)
* EnumSet should probably have value semantics, should new EnumSet([Perm::Read]) === new EnumSet([Perm::Read]) be true?
* Not a big fan of extending EnumSet
....* Would mean all enums coerce to true
....* Would mean all enums are traversible
....* Would Perm::Read === new EnumSet([Perm::Read]) be equal to true? How do we guarantee uniqueness of unit cases this way?
* Does EnumSet really need to be ordered?
 
^ same thinking on my side :)
 
"Class not found" using Opcache & Xenforo ・ opcache ・ #80862
 
@mickmackusa This odes look like a bug
Can you report it on bugs.php.net?
 
12:58 PM
@kelunik uhm, i just mean ... if($object) is usually true - this would be false now if empty- maybe implicit is the wrong wording here
 
@bwoebi I understand the argument for coercion of EnumSet to bool. I think it would be more acceptable if enums didn't extend EnumSet.
As for array, I think ->toArray() should be sufficient as that is probably not a very common case.
 
@NikiC the alternative would be creating an inner class for all enum… maybe I should do that. I just imagined an ad-hoc generic would be more forwards-compatible… I mean fitting the future ecosystem better
 
@bwoebi But I assume takesBool($set & Foo::Bar) would also coerce to bool?
 
@bwoebi It it's a set object, it should also be true if empty. What if I pass an enum set to a method bool param?
 
@IluTov I wasn't considering this case and it should not.
@kelunik TypeError.
 
1:03 PM
@bwoebi Hm, that feels inconsistent then. Because sometimes you'd have to do !($set & Foo::Bar)->isEmpty() (or $set->contains(Foo::Bar)?) and sometimes you wouldn't.
 
@IluTov No, EnsumSet does not have to be ordered, but it would be a natural property of it's implementation - if people observe that they'll take it for granted and rely on this.
 
@bwoebi I just wouldn't add generics. The variadic constructor could make sure all instances have the same type. For an empty set, there could be EnumSet::noneOf(Foo::class).
 
@bwoebi I don't feel too strongly about the ordering. But I feel more strongly about the other parts.
 
@bwoebi It could also always be ordered based on definition order in the enum.
 
@kelunik it could, just needs extra handling in the code, hence I didn't want to
 
1:06 PM
But as @IluTov said, this is the least concerning :)
 
@kelunik yes, Perm::Read === new EnumSet([Perm::Read]) would be true.
 
@IluTov I think methods are a lot more readable.
@bwoebi That's very weird.
 
@kelunik Yeah, me too. But that kinda begs the question whether we wanna go the whole operator overloading route in the first place...
 
@IluTov I wouldn't.
 
They can be more readable for combining enums | for sure.
 
1:08 PM
I'm using EnumSet in Java quite often, I don't see the API as problematic.
Apart from not being immutable, maybe. :P
Auto-boxing sounds fine until you start to run into problems. I don't see it being viable in PHP.
 
@kelunik There is no autoboxing necessary
The enum values are EnumSets of a single value
 
@bwoebi Yeah, I'm not a big fan of that. That means all functions that accept enums are implicitly accepting sets of enums, right?
So all the functions will have to guard against that.
 
@bwoebi As said, that's weird.
@IluTov No, I think just the other way around, no? @bwoebi
 
@IluTov no the other way round
yes
 
@bwoebi Oh, right.
 
1:15 PM
@kelunik it's fine - as long as you don't envision ubiquitous usage. The aim of the RFC is making enum set essentially replace all places where you have bitmask integers for options currently.
And at that scale, it's going to be much easier to just use the overloads.
 
@bwoebi I got that.
 
@kelunik I just recall that we wanted to use EnumSet at $work. But we dropped that after a couple weeks because people found integers so much easier to use :-/
 
@bwoebi EnumSet::of(Foo::bar, Foo::baz) vs. Foo::bar | Foo::baz. Yes, the latter is shorter, but the first one might be more readable. Especially given Foo::bar and Foo::baz might be an enum or constants.
@bwoebi In which language?
 
@kelunik java
@IluTov Anyway, I took inspiration from C#, except for the small detail that I'm using an extra name for EnumSets so that you don't have to guard against them being not a single value.
@IluTov regarding (array) cast, it's just describing the semantics of casting an object to an array, creating an array with all its properties as values. It's nothing special. Maybe I should make that explicit in the RFC.
 
@bwoebi (array) EnumSet::([Foo::Bar]) would result in [Foo::Bar], not ['values' => [Foo::Bar]], right? So it's a list of a specific property, so it is special, isn't it? Which I guess is fine, as long as it's not implicit.
 
1:28 PM
@Wes ten5 or something......and yeah, mental illness sometimes goes on forever. btw do you know of a website that shows code, that doesn't look like complete garbage on mobile? Or is that just an impossible thing to achieve, as no-one seems to do it at all well.
 
@IluTov it would be internally property [0], property [1], ...
and thus result in [0 => foo::Bar, 1 => ...]
 
@bwoebi I guess inheriting feels wrong to me for a few reasons. 1. I'm not sure if there are implications that I can't think of right now. 2. Since we have no multi inheritance it would block any other feature that would potentially require adding a parent class.
 
@IluTov Any parent class could be made parent of EnumSet?
 
@bwoebi Ok. On that note, might want to store them in a hashmap, otherwise we have an O(n) operation which could be slow for large enums.
@bwoebi I guess, although that might depend on the kind of enum you have which again would make it difficult. I don't have a specific argument, it's more of a gut feeling.
 
@IluTov yes. (but in internal storage, not public props)
 
1:32 PM
@bwoebi Oh ok.
 
@IluTov Regarding 1. I'd like to hear about that though … can't think of any.
 
@bwoebi where do you work, so I can avoid that place? :P
 
@kelunik haha
@IluTov * EnumSet should probably have value semantics, should new EnumSet([Perm::Read]) === new EnumSet([Perm::Read]) be true? I agree on this … But I need to verify the technical implications on that first
 
@bwoebi IMO these are questions to be solved for lists, sets and others and not specific for enumset
 
extractTo sometimes does not extract anything ・ Zip Related ・ #80863
 
1:46 PM
@bwoebi We'll need this (IMO at least) for ADTs anyway, unless we want to maintain a huge map of enum values. I did try it in a prototype, exposing it to userland. But we'd probably just want to make it an internal handler for now. github.com/iluuu1994/php-src/commit/…
But yeah, I'm sure that violates a few assumptions.
 
@IluTov In case we anyway need that mechanism…
 
@bwoebi It works well for immutable data structures. Nikita wasn't too fond of the idea though. But I don't think for technical reasons.
 
@IluTov I am also a bit wary of that, but in the end it's probably a good idea.
@IluTov dunno… can you be happy at all with class MyEnum extends EnumSet or is that just so terribad that I can forget about the whole RFC?
 
@bwoebi My intention is definitely not to shut you down :) Even if I wanted to, that's not the way PHP operates. If enough internals are happy about it there's nothing I can do about it. And that's how it should be. :)
I'll think more about it. I'd personally be happier with explicit conversion to EnumSet by using the constructor, even if there are no other implications as I prefer explicitness. For the same reason we didn't do implicit coercion to the backed value for backed enums.
 
@IluTov At that point operator overloading also goes away.
At least it's impossible to just have a very slick API with it
 
2:00 PM
EnumSet -> bool I can get behind. But I think we need to stay consistent and to it everywhere or nowhere. But enum -> EnumSet (which you solved through inheritance) I'd prefer to just do explicitly. Also worth noting that only sets with a single value would require using the constructor, Foo::Bar | Foo::Baz could still work.
Also worth noting that new EnumSet([Foo::Bar, Foo::Baz]) would work fine now with Nikitas RFC that allows objects in constant expressions.
 
@IluTov The disadvantage this has is new EnumSet([Foo::Bar]) != Foo::Bar
 
@bwoebi Which I think makes sense honestly as [42] != 42
 
@IluTov annoying
Are we designing the language for purity or for usability (where possible without drawbacks)? :-x
I literally cannot think of any disadvantage of Perm::Read === new EnumSet([Perm::Read]) being true, except that its unusual
But I'm afraid that many on-list will share the same concerns :-(
And I wonder how to sell that to them
 
@bwoebi It adds confusion. Strict rules are nice because you won't see code that you might suspect not to work. I don't think either approach is right or wrong, it just depends on what you prefer. E.g. Laravel does a lot of magic stuff, many people like it, many don't.
 
@IluTov It's TBH not even magic, given the semantics
 
2:12 PM
@bwoebi It's not magic, but it seems like it since you never explicitly made your enums inherit from EnumSet.
 
@IluTov I wouldn't be opposed to explicitly having a property ensuring that … enum Foo implements EnumSet?
 
@bwoebi Yeah, that would solve that problem. Although I still think keeping them separate has a lot of merits. An enum might not be used in the same way in all cases.
 
@bwoebi This passing the identical operator would be confusing as heck.
That operator being one of the bastions of sanity
 
@MarkR it would be identity because it would be actually the same object
 
No-one would ever expect that with "new" in there.
 
2:25 PM
so, EnumSet::of() would to be preferred to new EnumSet, right? (I don't care much about that)
 
@MarkR Would you feel the same about new EnumSet([Foo::Bar]) === new EnumSet([Foo::Bar])? We could hide the fact these are two separate objects with EnumSet::create([Foo::Bar]).
I think value semantics will confuse lots of people at first, even for cases that are usually no brainers in other languages, like new Vector(1, 2, 3) === new Vector(1, 2, 3)
But since in Perm::Read === new EnumSet([Perm::Read]) it does look like you're comparing values of different types that check passing does seem surprising to me.
 
@bwoebi I prefer that, because noneOf, allOf, of can be very similar then.
Also, it could return the same object if immutable, which is unexpected for new.
@IluTov I think all in might be a valid choice, hiding the fact it's an object completely. That'll also avoid a lot of the confusion. /cc @bwoebi
 
@kelunik yeah, EnumSet should probably have immutable-value semantics
 
2:42 PM
as someone who has written much more PHP than C, I would find something like EnumSet::of(Foo::Bar)->has( Foo::Bar ) much more natural than mixing object and bitmask syntax
 
@bwoebi Oh my. I have a meeting to prep for but I'll try to read it and catch up within the next few hours.
 
@IMSoP I wonder whether many find that more natural because they're used to java and php style clumsiness …
 
potayto, potarto: you call it "clumsy", I call it "explicit"
as I say, it's the mixing that makes it particular weird to me
 
@IMSoP I mean … we aren't doing new IntSet(4)->or(8) either … dunno, really but… I sort of think of enums more like value types piggy backed on objects than actual objects :-D
 
that's why I prefaced with the comment about not writing much C - I honestly have to pause every time I see bitwise ops
in terms of mixing, what if there was no constructor at all, just Foo::Bar & Foo::Baz gives a special enumset value
er, Foo::Bar | Foo::Baz I mean
I told you I was bad at bitwise ops :P
 
2:54 PM
@IMSoP This should work according to the RFC. A constructor is needed for empty sets or sets where you have just one value. Unless you make all enums EnumSets (with the possible confusion already discussed).
 
the empty set constructor could be on the enum class, which gets around the generics problem as well
assert(FilePerm::emptyEnumSet() & FilePerm::OWNER_READ === false)
the EnumSet class would then be an implementation detail, like Generator and Closure
 
@IMSoP The problem goes away if we combine the enum with the set. But I'd prefer to keep things separate, just because sometimes you accept an enum as a set doesn't necessarily mean you always do. Allowing the type system to understand both of these cases would be nice IMO.
 
I didn't say combine them, just put the factory method there
maybe you could coerce an empty array to an empty enum set, so [] | FilePerm::OWNER_READ would be valid
or just have a special constant for it, ENUM_SET_NONE or something
 
@IMSoP ::none() would be a good name I think.
@bwoebi if they're objects, do they have the same object ID if === returns true?
 
// in class Enum
public static function setOf(...static $members): EnumSet
public static function none(): EnumSet
 
3:06 PM
@kelunik I do not know how doable that is currently. Ideally, yes.
 
If setOf, emptySet might be better
 
yeah, that feels better; makes the type more evident
public static function setOf(...static $members): EnumSet
public static function emptySet(): EnumSet
public static function completeSet(): EnumSet
or short but less explicit...
public static function some(...static $members): EnumSet
public static function none(): EnumSet
public static function all(): EnumSet
 
@IMSoP Would be possible. That would require allowing static methods in constant expressions.
 
that could be as well as the bit op overloads, just instead of any constructor or static methods on EnumSet
 
Note that since EnumSets are immutable all and none could also be constants on the given enum.
But that would require: 1. Flagging the enum to add those constants or 2. adding them to all enums, which doesn't feel right.
But I guess the same goes for the methods above.
 
3:14 PM
yeah; reserved methods feel slightly less surprising than reserved constants somehow
using in constant expressions would be useful, though; which new EnumSet() also wouldn't allow right now
 
@IMSoP good point
 
@IMSoP Would with Nikitas RFC, mentioned above.
But yeah, not right now. Pretty likely to pass though I think.
 
hm, true; I wonder if static methods should be allowed if new is anyway, though, since they're a common way of writing "multiple constructors"
 
I didn't plan for that initially, but it might make sense to include static methods and free function calls
I get the feeling that EnumSet is a really big gun to solve a really small problem
What do you think about the println() proposal?
Am I the only one who really doesn't like that?
 
@NikiC no
echo $fooBar, "\n";
 
3:26 PM
yeah, that
I think it's already bad enough that we have the choice between echo and print and their syntax peculiarities, no need to add a third choice to the mix
 
as I said on list, I do occasionally find myself wishing for it, but mostly just be lazy in throwaway code
 
usually, if I just want to dump values one per line - I just use var_dump()
 
yeah, it's more for things like "code has reached here"
 
@bwoebi Yeah, the only place I regularly use echo is for .phpt tests ^^
 
@IMSoP var_dump("WTF?!?");
 
3:30 PM
no, more like echo "Begin reading data...\n"; ... echo "Done\n";
 
too verbose
 
the output is less verbose, and sometimes that's important
imagine if every line output by a ./configure script was prepended with the word "string" and the length of the line
 
@NikiC I do not disagree that the problem scope is small, but it's a feature I quite like in C#. And I think it's well applicable in PHP as well. It's sort of like saying <=> is a big gun (extra operator) to solve a small (sorting) problem. But then here and there you're thankful it exists.
 
Can someone point me to where the zvals for the INI arguments are actually passed to the function pointer?
I can't seem to figure it out >_>
@NikiC I mean, last time it got proposed the list went full shitpost mode on the author
And same as @IMSoP sometimes I wish we had it but it's mostly in throwaway scripts
 
3:45 PM
as ever, Raku takes things to a whole new level, making foo | bar return an "any junction" docs.raku.org/type/Junction
it also has both and as built-in operators
 
4:06 PM
@IMSoP I'm waiting for an RFC to propose 💩 as a new operator
 
<?💩php

^ 5.3 Backwards compatibility mode
 
ooh even better. make it an alias for the exit/die statement, but relax the rules allowing the exit argument to be specified without parenthesis. And then apps/frameworks can define('🛏', 'Critical error encountered');
and then the application code can literally ... 💩 🛏 shit the bed.
omg imagine the possibilities it could be used for
this is why we need the Unicode people to massively expand emojis
how else will I write code using little pictures to say "if shit hits the fan..." for example
 
also I can't believe there isn't a fan emoji
 
4:24 PM
@Stephen You can name all your variables and functions with emojis
 
@Dharman yes but there is no "fan" emoji.
@MarkR I would prefer:
declare(📄=💩);
or to do package-wide declares... declare(📦=💩);
@Dharman also, the point of making 💩 a language construct in that scenario, is to avoid the parens - so it could just be literally 💩 🛏; rather than 💩(🛏);
 
Yeah, but you could still have some fun. throw new 💩(FAN)
 
I think if Crell gets his way, you'll be able to write if ( $this is 💩 )
 
if ( $this is 💩 ) {
    throw new (╯°□°)╯︵┻━┻;
}
 
4:42 PM
opcache.file-cache - problems on shared hosting ・ opcache ・ #80864
 
5:12 PM
@Crell instanceof?
@MarkR how would <?= be done? :P
 
@NikiC What do you think about adding "calling overloaded pgsql functions without the connection argument" to the deprecations RFC? Additionally, we should make the connection parameters in question nullable.
 
@MateKocsis yes on the first part
As to nullable, I would prefer not to
 
Ok, I'm also happy without the second part :)
 
It's best to remove the concept of default connection entirely
 
I'm currently killing resources from pgsql. It's really tiring to remove them from 100+ functions, but very-very satisfying overall :D
 
5:30 PM
No issues with persistent connections?
 
Uh, I'm currently early in the process. Do I have to leave the le_plink resource alone? :/ I guess now I understand why all the other DB related extensions still have a resource for persistent connections...
 
@MateKocsis I've got a branch for that btw
Just didn't go round to make it a dedicated RFC
 
@Girgias Cool! I think it's suitable to include it into the 8.1 deprecations RFC, isn't it?
 
Yeah, I think so
And if people complain too much we can make it a dedicated one...
 
5:45 PM
yes! Though, I doubt that they will complain. It's simply too crazy behavior :D
 
Might need to look at it again
 
nice!
 
 
2 hours later…
7:46 PM
@NikiC do you remember that idea from mattieu about calling a boot script in php-fpm before calling fcgi_accept_request? there probably 100 things to fix still, but i a prototype is just a few lines
 
@beberlei yeah I do
Forgot to follow up on that
I saw the symfony runtime thing
Which kinda seems relevant?
 
ah thats weird, maybe that triggered it for me too. i am confused by it
hacklevel++
 
heh
 
actually the whole swoole thing made me remember
"10 times faster than php-fpm" yadda yadda
 
@beberlei I got something approaching that when I first switched to it, but only because it allowed me to remake my application to use extensive in-memory caching
 
7:54 PM
So I'm looking at intersection types, but I'm getting shift/reduce conflicts: 2 found, does that mean I need to raise the precedence of &?
@NikiC as you're probably the parser expert here
 
Check the y.output file
It will tell you where the conflict is
zend_language_parser.output maybe
 
I've not actually got around to using any of their coroutine features, I'm mainly benefitting from the C-based HTTP parser and long execution time.
 
Ah okay that's good to know
 
@Danack Fibres? are you kidding us? :-D
4
 
8:08 PM
> from Latin: fibra
 
Do you recon there'll ever be a time where php internals offers a multiple-request handler or is the expectation that it will be left to the likes of amp et al running in CLI?
 
8:39 PM
@MarkR it's hard to imagine someone wanting to do it in C, if Amphp can already process 10,000 of requests per second.
 
@Danack Would need to know what machine size to gauge how good that would be
 
8:57 PM
cleaned it up and made it a draft PR plus all the weird problems it will probably have and if this is worth pursuing github.com/php/php-src/pull/6772
 
@beberlei Can zend_exeucte_scripts be used in the context of a normal request...? I'm only seeing it in relation to CGIs
 
@MarkR it is used in fpm to execute the primary script
 
@beberlei Ty
 
see fpm_main.c slightly below where my changes are, around line 1920 in master i suppose, 1943 in my branch
AInternet of fail
 
9:17 PM
I recon I'll take another shot at autoload_classmap but it looks like it's changed a bit since I last looked. I don't remember seeing spl_perform_autoload before
 
9:34 PM
> What to do with output from boot? i would probably discard it
@beberlei redirect to error log?
 
@MarkR spl_perform_autoload is new in PHP 8, it avoids the previous "spl_autoload_call" userland inbetween stack call
 
@beberlei nit but you added an empty line semingly randomly :p
 
@beberlei y u no spl_autoload_perform() :-/
I mean not you personally
"consistent and/or hierarchical naming" is one of the top 5 things PHP is worst at, and I fear namespacing may only compound the problem :-/
 
@NikiC So, the conflict only arises with my newly introduced intersection_type_without_static, which is identical to your union one, but the intersection_type works just fine which confuses me
 
9:49 PM
@beberlei Sweet. Sounds like an ideal place to check a HashTable
 
its also a pointer you can overwrite in an extension
 
@beberlei What is this Symfony runtime thing?
 
@MateKocsis ah just an abstraction for index.php
usgi for php maybe :P
 
This should make the job a lot easier then. Composer already creates the authorative classmap, seems a waste to have to call out to a userland function to find which one to include when we could just look it up.
 
10:18 PM
@Girgias can you share your grammar?
 
Didn't really do much, so I'm probably missing a precedence addition
But I can start working on it with just return types, so I'll come back to the grammar later on
 
@Girgias I would recommend making the precedence explicit
 
Okay, will do that then, goes researching how to do that
 
Ah wait, you're already only allowing type -- so you don't allow any a&b|c mixing at all, right?
in that case precedence really shouldn't matter
 
Currently no
Which is why the shift/reduce is confusing me a bit
As clearly having a&b|c has a precedence issue
 
10:28 PM
In that case I'm not sure what the issue is, maybe some conflict with by-ref passing?
 
Oh... that would make sense
 

« first day (3802 days earlier)      last day (1152 days later) »