« first day (4237 days earlier)      last day (695 days later) » 

6:58 AM
@bwoebi Caus eI wanted it to be a part of abstract class contract
The reason is that in my mind an abstract could be declared without value
When I combine it with readonly and with enum type
Each class extending the abstract are required to declare the value of abstract property
In this case these values would be enumerations
I could see the abstract property that is readonly and being type of my enum on abstract class level
Sure I can just define it in all classes but then it's not a part of abstract class contract, which means I still need the method - a getter with enum return type to be visible on abstract type level
 
 
3 hours later…
10:02 AM
@brzuchal in an abstract class specifically... you can just declare the property as public on the abstract class without value. The classes would have to set the values is their constructor probably. There's no reason abstract classes should enforce the time where a value is written. I specifically recommend a constructor arg on the abstract class then.
 
@bwoebi Indeed, haven't tried that before 3v4l.org/ZGgNc
Thanks
There is no other way to define the default value here anyway 3v4l.org/Bki3m so the ctor promoted property has to be included here
 
cmb
11:05 AM
@RemiCollet, thoughts on github.com/php/php-src/pull/8530?
 
 
1 hour later…
12:20 PM
Morning o/
 
o/
 
12:46 PM
@cmb thanks for the notice. Having to think a bit more about this change
(comments added)
 
cmb
ta (very valid concerns)
 
 
1 hour later…
1:55 PM
@brzuchal I was rather thinking 3v4l.org/h24Pq
 
 
2 hours later…
3:46 PM
is building an enum from the value the intended way of comparing strings to string backed enums? 3v4l.org/EUUrA#v8.1.6
 
yes
 
If it is realyl from the outside world, I would use ::tryFrom, and check for NULL, in case the outside world gave you something wrong
 
hmmyeah that's the case, will do
 
4:19 PM
@user10411581 You should have the rep now
 
4:41 PM
Is it sth that is up to the libary provider if it;s CDN link has an SRI in it?
 
@bwoebi anyway there is no possibility to force property value declaration, one can skip declaration of property or skip parent ctor (shrug)
So if it could actually be abstract it could force it's value declaration on non-abstract (dunno the word here, concrete?) extending class level
You wrote I should not force it's definition but then I can end up with uninitialized state
Maybe I'm wrong but I still see a benefit of abstract property here, it forces value declaration on concrete class, maybe it's just one use case when combining with readonly
 
4:57 PM
@Derick yep, thanks
 
5:51 PM
@brzuchal that's sort of the difference in semantics of readonly. It's writeonce. If we had a flag "enforce writing during ctor", then your issue would implicitly vanish. It's not related to abstractness.
 
6:34 PM
there are some important security headers that must be set...as I understand there are two ways to do it: either through thr header function or .htaccess apache file...am I correct?
 
@bwoebi nice, but yeah :(. That's why the pre-processor executor is needed :/
 
6:53 PM
@ircmaxell in the end it does not matter much, just need to shift some processing around
 
 
2 hours later…
user17161735
8:42 PM
if i have a callable function that is validator of scenario ... and i implement call_user_func_array() to call the funtion how can i differentiate if the false return is equivalent to an error or the validation (function) returns false?
 
8:55 PM
You could just not use call_user_func_array() and just do $callable(...$args)
 
user17161735
@Girgias i cant
 
What do you mean "you can't"
 
user17161735
becouse the method was wrapped in a class
 
@ArcanisGK507 What?
 
@ArcanisGK507 $objet->$method(...$args)
 
 
1 hour later…
10:22 PM
@Girgias Are you going to get DNF done for 8.2, do you think?
 
When writing CLI scripts is there a good / sane way to redirect to STDERR? For example var_dump, print_r etc. Something in the line of { print_r($foo) } >>STDERR;
 
Most of those have an option to get the value as a string rather than printing it, and then you can fwrite() to STDERR.
 
10:59 PM
OK, thanks. Hoped there was some redirection option. I tried to fclose(STDOUT); $STDOUT = fopen('php://stderr', 'w'); and that "works", but not able to reset STDOUT after the fact.
^-- that is not very sane either though, :P
 
11:58 PM
@JoeWatkins That post you referenced on Twitter got the guy fired
 

« first day (4237 days earlier)      last day (695 days later) »