« first day (3448 days earlier)      last day (1491 days later) » 
00:00 - 20:0020:00 - 00:00

8:00 PM
Therefore there can be ReflectionUnionTypeConstraint etc.
Cause currently ReflectionType doesn't present a type, from type perspective class is a type, string, int etc. are also types
 
8:20 PM
@Derick thanks for the lead that works perfectly
Dumb question, is there a way to get the function name from a zend_fcall_info? I would have thought that Z_STR(fci.function_name) would give it to me but apparently that's a Null pointer ... Dunno why I'm trying to clean up SPL
Cause I think I also need to retrieve the closure but I think that info is lost with only zend_fcall_info and zend_fcall_info_cache
 
8:34 PM
@Girgias I'm out of the loop; what part of the SPL are you trying to clean up?
I think fci_cache.function_handler has the actual function on it, so you could get the name off there.
 
spl_autoload_register
Cause it does some whack custom checks to check that the first argument is a callable
And I wanted to let ZPP handle it
But will try that
 
If you have an fci though, don't you already know it is callable (sans some permissions errors if you change scope maybe?)
 
Also is it me who doesn't know how to use GitHub or something else, cause I can't ask someone specific to review a PR
@LeviMorrison well yeah that's what I thought but for the hashtable index I think I need the function name
if I understand that code correctly
 
@Girgias Are you modifying it to accept other things? I still haven't got around to adding spl_autoload_array
 
Nah
Just making it more sane and disabling the option to make it not throw
And why do you want spl_autoload_array?
It should already handle array callables
 
8:40 PM
Because things like composer automatically generate complete assoc arrays of class => path. So why not throw the entire array straight into the autoloader and have it do an extremely quick hashtable lookup rather than having to call a function?
 
ahhhhh
That's what you want it to do
Nah not doing that specifically
 
maybe spl_autoload_classmap would make more sense
 
Yeah
 
There's no reason to put any of it in the SPL.
It's a language integrated thing that can't be disabled; belongs elsewhere core, probably.
@MarkR Also, there is a decent chunk of the app that should just be statically loaded because it's always going to be loaded, no reason to "autoload" it. That opinion of mine has somehow been unpopular, but maybe now preloading is a thing I won't be considered a heretic.
 
I think hitting a hashtable should eliminate probably 90% of the performance hit
 
9:43 PM
happy birthday @PeeHaa \o/
4
 
@Girgias "Make PHP's float to string cast locale-independent, meaning it will always use the dot . decimal separator, in PHP 8.0." The italicized portion is unclear.
by that description, I can't tell what the RFC is supposed to do... change the decimal separator from a dot to a comma, depending on location? ...or not?
(in the code sample, it gives the implication that it will use a comma if setlocale is set to German)
 
10:00 PM
// Tempted to propose:
interface Arithmetic
{
    public function add(Arithmetic|int|float $b): Arithmetic|int|float;
    public function sub(Arithmetic|int|float $b): Arithmetic|int|float;
    public function mul(Arithmetic|int|float $b): Arithmetic|int|float;
    public function div(Arithmetic|int|float $b): Arithmetic|int|float;
    public function pow(Arithmetic|int|float $b): Arithmetic|int|float;
}
 
@Tiffany it will change to always use . regardless of locales
The examples describe the current behaviour
Could maybe clarify that
 
10:25 PM
Evening all
HAPPY BIRTHDAY @PeeHaa !!
4
 
10:36 PM
What do Room 11 think about the locale-independent cast RFC? How much should we care about the BC implications? I know it can be a serious issue, but is it that widespread to automatically process floats containing ","??? It's really hard to believe :O
 
cmb
@Girgias I think you can only request review from members.
 
I think that because setlocale is already broken, the entire thing should be considered broken, and changing it to be non-locale based is the only solution
 
cmb
Happy birthday PeeHaa from me as well!
 
@cmb the thing is
I can't even ask anybody
Dunno if some of my browser extensions are messing with GitHub
 
or you are banned :P
 
cmb
10:41 PM
Oh, then just post a comment requesting review manually :)
 
May well be the case
Seems reasonable
 
cmb
@MátéKocsis when I brought this up on internals@, there've been serious objections by some people. I wouldn't take the BC break to light-heartedly. I wouldn't actually like introducing an INI setting for this, but maybe combined with other stuff (if there's any that would fit in that "category"), that might be okay-ish.
 
Btw @cmb I feel I went down the rabbit hole with spl_autoload_register and I think I need to backtrack, cause I don't think I can replace the ZPP call which checks a zval by a callable/zend_function check :|
Also am I the only one thinking the naming of the autoload function is whack
 
cmb
I mean, better have that RFC pass with some ugly compromises, than having it declined.
 
@cmb I see! Probably people just fed up with this topic by now, so there are not many people who argue against the change. I'll re-read the earlier topics then.
 
10:47 PM
Okay that was a bad way of phrasing that
 
cmb
@MátéKocsis arguments have been along the line, that it's a subtle BC break, which requires full code audits.
 
@cmb I agree! An ini setting is ok for me if it moves the initiative forward. Although I'm a bit concerned that introducing an ini setting will complicate library code even more
 
Remove setlocale on the grounds it's horribly broken?
Can't complain about the locale being wrong if there's no locale
 
cmb
@Girgias callables seem to be terrible mess (userland as well as ZE). Just leave spl_autoload_register() as is, if in doubt (and yes, the name is unfortunate).
@MarkR I don't think this has even a slight chance to pass. :|
 
Does anyone know where the spl autoloader is called? I can't seem to locate the single class loader location
 
10:51 PM
@cmb yeah, gonna backtrack and just make the error check nicer
 
cmb
@MátéKocsis I'm not talking about an INI setting which actually changes the results, but rather one that raises a warning/notice (can still be an issue, though).
 
If that INI is added it would likely be there for 5 or 6 years though. That's the major downside.
So instead of cleaning up the code, it would make it worse?
 
I mean I'd rather have that
Then still depending on locales
 
@cmb Ah sorry. That would definitely help people with the migration
 
@MátéKocsis @cmb If you want to add the ini setting, I'd suggest doing that as an extra voting option
 
10:54 PM
Secondary vote?
 
Good idea! Democracy at its finest ^^
 
@NikiC I suppose just fixing the type declaration and commiting directly is okay for the JIT issue?
 
@Girgias yes
 
@NikiC do you have an idea how much the ini setting would hurt performance?
 
@MátéKocsis Not terribly ... I think?
 
10:57 PM
You would presumably only be doing the changed-check if it was set, so it would just be checking a single bool whenever it was done in a non-locale-based setup?
Maybe on the setLocale do a check to see if it would be different, and set a global flag
 
@MátéKocsis Might be somewhat ugly on the implementation though, as you'd have to retain a distinction between a "locale-insensitive print" and a "locale-insensitive print that used to be locale sensitive". aka another set of internal printf modifiers
 
@NikiC it would be worth then. I can't think of any bigger WTF thing in this language than this casting... :D Or maybe I just haven't seen enough
 
true + true = 2 is pretty high up there.
 
no, that's ok :'D
 
cmb
To clarify what I have in mind: if the INI setting is enabled, on each (at least for ZTS; still a race-condition, though) float to string conversion do a check whether it would yield a different result (locale-aware vs. locale-independent) and raise a warning. That check could use either localeconv() or actually do both conversions.
But nobody is supposed to have that INI setting enabled in production, so the performance impact appears to be minor.
 
11:04 PM
@cmb can I push directly to php.net about the COM change or do you want to wait for weltling to comment on?
 
it's like enabling debug build :D
 
cmb
@Girgias yep, I'd give Anatol a few days to comment (I guess that test has been written by Matt, though)
 
Okay :)
 
cmb
@MátéKocsis I actually thought about suggesting to enable this for debug builds only, but I guess very few users actually run debug builds.
 
What would be the function to get the previous result, number_format?
 
11:07 PM
printf(%f) ...
That's the easiest drop in replacement
 
@cmb yeah, I was also thinking about this some minutes ago, but I also came to the same conclusion
When I first faced this issue some years ago, I didn't have a clue how to solve it properly... so just strreplaced the "," to "." XD
 
@Girgias That's the shortest replacement even for casting?
 
@MarkR casting in what sense?
 
From what I think I read, (string)(0.1234) would come out as 0,1234? Or am I way off mark?
 
So that's the current behaviour
The point is to change that
But I think we need to make that more explicit in the RFC @MátéKocsis that the examples show the current behaviour :/
 
11:11 PM
But if people wanted to keep that behaviour, they would need to either wrap in sprintf('%f', $val) or number_format with the params set... is there any way that could be made... shorter?
 
But *printf("%f") would still be easiest
I don't think it could TBH
 
@Girgias Oh yes... It's not evident if you just have a short look at it
 
cmb
well, you can introduce function f2s() or so
 
Even something as simple as: $x = "abc" . locale($val)
 
cmb
^ leave that to userland :)
 
11:14 PM
uuuuhhhhhhhhh I mean if we introduce a function then at that point it'll be in for the end of time
 
until the end-game of PHP :D
 
Man, who's the final boss?
 
Sure, but the user is being explicit, so who cares? You can clean it up in all the other locations
Nikic added fdiv for example when he changed floating point division
 
but that function makes sense
 
cmb
^ that :)
 
11:16 PM
this one wouldn't :)
 
Why would it not make sense...? it would be number_format but using the settings from the locale. Having it inbuilt would mean automated tools could place it
 
Well the floating one makes way more sense because otherwise there is no way to get IEEE 754 behaviour
That was the reason why I voted against that change specifically (although we weren't many)
 
cmb
IMO, the point is that setlocale() has so much issues, that it's better to avoid at all.
 
@MátéKocsis do you have a function which does the argument for type errors? (Cause I'm not up to speed on those ones)
 
11:36 PM
@Girgias zend_argument_value_error / zend_argument_type_error
 
Cheers
 
zend_include_or_eval is that the closest we've got to a universal "include this file" function?
 
@MarkR Ah, I tried to refactor this.
Sec.
 
I remember you mentioning it, did it make it into master?
 
No.
I just ran out of time -- it is the right direction, I think.
IIRC I needed to add the ability to add stream options, and can't remember if I needed to expose INCLUDE vs REQUIRE.
The idea was that it is always silent, and it tells you whether it succeeded or not, so it shouldn't need to know include vs require because that's really the difference, right?
 
11:46 PM
Ta i'll take a look
 
I hate it when we don't have APIs that match things you would do in userland. Seriously, no straightforward way to do include or require? WTF?
They are single-arg, you know? Just give it the path, and something to handle include vs require...
 
There seems to be at least half a different ways that files get included.
 
Would be great if you could revive it for PHP 8.
 
The opcode at least seems to point to zend_include_or_eval
 
IIRC it's not quiet.
If the include fails, it gives a warning. That's fine, but I'd want something that doesn't emit anything too.
Case in point: attempting to include files in autoloaders. If they don't exist, that's totally fine.
Honestly, I don't understand why include warns.
It literally means that you don't care if it fails -- if you cared then you'd use require.
Forces you to use the error suppression operator, or to prefix it with file_exists which is extra work and an I/O call at that...
 
11:55 PM
Do you know of any part of PHP's notice / warning system that isn't completely rubbish...?
 
You know what, I'll email internals. Or did I already? Can't remember.
 
00:00 - 20:0020:00 - 00:00

« first day (3448 days earlier)      last day (1491 days later) »