« first day (3785 days earlier)      last day (1146 days later) » 

 
3 hours later…
6:55 AM
mysqli_fetch_fields is missing the "s" in French ・ Translation problem ・ #80797
 
 
2 hours later…
8:35 AM
@PeeHaa Starting an early stream if you're around. =)
 
9:29 AM
@FranciscoNúñez What's an "ansi color" ?
@LeviMorrison ptrace handles signals well, if you code well for it. Oh... Nikita said so a few mins later.
 
 
1 hour later…
10:59 AM
Hello everyone. I've recently answered a question where a user had misused some constants as parameters in the NumberFormatter class, the question can be found here: https://stackoverflow.com/questions/66280517/php-numberformatter-format-shows-strange-output/

But I'm curious to find out exactly why this strange behaviour occurs and if it is maybe worthy of a bug report. My web searches yielded no similar results or bug reports. So I was wondering if any of you folks who are more afflicted with PHP than myself could shed some light on this. Thank you in advance.
 
cmb
11:23 AM
@El_Vanja the $stlye parameter maps to one of the UNumberFormatStyle values, and 8 is UNUM_NUMBERING_SYSTEM, which for whatever reason, gives that result.
 
11:37 AM
The tl;dr is of course: No vendor namespace.
 
GMG_site ・ *General Issues ・ #80798
 
11:55 AM
@cmb This reveals one piece of the puzzle, but I'm still hoping for a bit more insight. Thanks for the info, though!
 
12:18 PM
Wrong behavior for function array_column ・ Class/Object related ・ #80799
 
12:38 PM
While I'm ok with extensions using ExtensionName\XXX ... I do think that it's needlessly restrictive to limit them to a single level, that seems rather arbitrary and doesn't reflect how namespaces are used in practice (your own PHP parser for example uses 3 or 4 layers of child NS).
 
1:13 PM
@MarkR Ah, there was no intention to limit to a single level
 
@NikiC Perhaps just confusion on the intent of "All symbols defined in the extension should be part of the top-level namespace." then?
probably just needs a "or its descendants" to make it obvious.
 
@MarkR Yeah, adjusted that line
 
cool ty.
 
2:05 PM
> Using FFI\FFI would be preferred.
may I disagree?
It's just plain redundant, would make sense if we had global namespace imports, as in use FFI\*; - but we don't
 
2:22 PM
A small price to pay for salvation
 
@Sara Ya rly.
 
@NikiC """This is a somewhat lose guideline""" loose, two Os. Unless you think your own guideline is doomed to fail/lose.
Also, I was expecting a php\ namespace in this, it's far less controversial than you'd promised. :(
 
@Sara English...
 
@NikiC I know, it's a dumb language. :)
 
2:34 PM
@Sara my DMs are open if you want the gossip. I'd rather not discuss in detail here.
 
@Sara I assumed the absence of a php namespace would be the controversial part ^^
 
@Crell Would't ask you to. :)
 
@NikiC Living in the past? ^^
 
@NikiC I mean, your note about not including vendor in the namespace pretty much IS addressing the "php\" in the room.
 
@IluTov That year doesn't count :P
 
2:38 PM
@Sara the php-src vendor namespace is zero-length
 
@bwoebi Maybe I just put that in so people can have a heated discussion on that point, and I may then graciously agree to compromise?
 
@NikiC haha, probably not dumb to create a controversy around something relatively harmless :-P
 
Php\Array > \Array :-)
although IMHO for things like arrays, if scalar methods ever appear in core they'll immediately become preferred vs the array_xx functions for all code targetting newer versions
 
@NikiC One of the big pushbacks in the past was "we aren't using namespaces now, so if anything uses namespaces, even new stuff, that's confusing and we shouldn't do it, so we should never use namespaces ever, because we didn't start with them." - What's your approach to handling that feedback? "Only new symbols" still results in some extensions being namespaced and some not.
 
2:54 PM
@Crell I don't see an issue with some extensions being namespaced, as long as a single extension doesn't have a weird mix of names
 
@NikiC "I don't see an issue" is what Mark and I said and it still lost. :-) How does a given extension transition to namespaces, then?
 
@Crell For procedural extensions, by adding a namespaced OO API :)
 
And for OOPy ones?
And without a PHP\ or similar prefix, is there any concern about bumping into user-land? It's been operating on the assumption that anything other than \ and \PHP was "safe" for over a decade now.
 
@Crell I consider migration out of scope, but for OOPy ones I'd be open to adding namespaced class aliases. The number of classes is fairly low.
 
coughSPLcough
SPL + ICU is like.... 80% of all of our "builtin" classes.
 
3:00 PM
And for SPL in particular, the solution is of course to create a new library and burn SPL with fire
 
🔥🔥SPL🔥🔥
 
@Sara I was mainly thinking DOM and Intl in terms of alias. SPL simply can't be salvaged
 
@NikiC What does SplQueue become? I would say Spl\Queue based on this:
> Instead these extensions should be considered as a collection of different components, and should be namespaced according to these.
 
@LeviMorrison 🔥\Queue
 
But you specifically said this:
> Because these extensions combine a lot of unrelated or only tangentially related functionality, symbols should not be namespaced under the Core, Standard or Spl namespaces.
So... I don't know.
 
3:01 PM
$queue = new 🔥\Queue;
 
@LeviMorrison Collections\Queue, DataStructures\Queue, whatever
 
I'd argue Spl is better than any of those suggestions. It's shorter and historical.
Overall the RFC looks pretty pragmatic.
 
Historically bad.
 
The trouble with no-vendor namespacing is that the DS ext and the SPL ext might want to fight about what a DataStructure\Queue is
 
@Sara Which is why I didn't suggest ds\Queue :D
 
3:03 PM
Basically, I'd split SPL into "core" pieces, and move them out of ext/spl, and "library" ones, and put these as Spl\Thing like all other extensions.
 
But isn't "ds\" a vendor namespace at that point>?
 
Can't say I'm particularly fond of the idea of putting a bunch of things like Password\hash into the root. I think we've got a great opportunity to make a decent hierarchical arrangement e.g. Security\Passwords\ Security\Hashing Security\Crypto etc
 
@Sara Depends on how you define the term. It's the extension/package name
 
@MarkR Yeah, we're not going to agree as voters on that. See prior art.
 
I understand the term "vendor namespace" to mean an additional prefix before the package name.
 
3:04 PM
@LeviMorrison Oh, getting people to agree on it is unlikely. It's still what I think would be in the long term best interests of the language.
 
@MarkR That would make more sense to me with a monolithic standard library. I wouldn't like the idea of having Security\Password always available, while Security\Crypto is only there if you have OpenSSL -- or worse, half of Security\Crypto depends on libcrypto and the other on libsodium.
@Sara Well ... PSR-4 calls any top-level namespace a vendor namespace :)
Do with that as you wish ...
 
7 mins ago, by Levi Morrison
Basically, I'd split SPL into "core" pieces, and move them out of ext/spl, and "library" ones, and put these as Spl\Thing like all other extensions.
What do you think about that ^, @NikiC?
 
If we're burning spl to the ground can we pretty please alias spl_autoload_register to something else and dump it in 9.0 :)
3
 
@MarkR I would support this.
 
3:17 PM
Not sure where things like SplFileInfo and such would end up under this.
 
Don't look now but Sara is over there pouring petrol on it.
 
/me hides the match()
 
@NikiC I previously had the insane thought of … $someVar->afunc($arg) will call $typeOfSomeVar\afunc($someVar, $arg) as fallback …
So, $someString->contains("foo") would call string\contains($someString, "foo")
 
GetOut.gif
 
3:35 PM
@bwoebi Perfectly sane thought :)
 
Unified function call syntax :)
 
o_o
donotwant
 
UFCS is actually one way to have "extension methods", which could give a way to write method calls on primitive types.
namespace Functional {
    function map(iterable $self, callable $f) {/*...*/}
}
namespace {
    use function Functional\map;

    $doubled = [1, 2, 3]->map(fn ($x) => $x * 2);
}
 
@LeviMorrison At least it would alleviate the problem of "the engine is always right"
@NikiC I think it breaks down with inheritance, at least implemented that way
 
@bwoebi I assumed you had only primitive types in mind there
 
3:47 PM
I didn't :-D But yeah, for primitive types it would be sufficient
 
imap_open() fails when the flags parameter includes CL_EXPUNGE ・ IMAP related ・ #80800
 
Probably shouldn't work generally with union types, actually.
 
How could we even do extension methods without precompilation?
 
You'd have to use everything you want to consider into scope, methinks.
 
4:06 PM
hello, I have just discovered the chat room !!
if anyone has any idea how to solve this mystery. thank you in advance .
https://stackoverflow.com/questions/66321602/custom-trim-my-post-title-item-combine-two-if
 
4:23 PM
@MarkR You don't want to alias it, you want a new function, as the second argument of that function is currently ineffective and dumb
@Jeeves Oh FFS, that's my fault again ain't it...
 
@Girgias only people changing things break things :-)
 
;_;
Still can't build IMAP tho on Fedora >_>
So now I need to look into fixing that issue I'm having
 
4:43 PM
@NikiC By starting reading before or after splat ellipsis? :D
Also, good day.
 
5:01 PM
@NikiC I shall partake in this heated discussion as the maintainer of CSV where I just moved all my functions to static methods of a CSV class :p
 
5:20 PM
@Girgias Eew
 
@Crell Not like I'm having much ideas but csv_func_name was a bit ugly too so esh
 
 
2 hours later…
7:01 PM
@LeviMorrison Trying to get my head around this UFCS idea; are you saying the call would be despatched based on its type signature somehow? If so, I agree with Crell: you'd need to pre-compile, not just use (which is a source transform, not an include). If not, it doesn't matter what type is in the signature, because 'hello'->map('foo'); can just fail with the same error as map('hello', 'foo');
function reverse(string|array $input) {
    if ( is_array($input) { return array_reverse($input); }
    if ( is_string($input) { return strrev($input); }
}
[1,2,3]->reverse(); // [3,2,1]
'hello'->reverse(); // 'olleh'
 
7:22 PM
@IMSoP We have the use list at compile time -- no reason it couldn't be saved in a way that it gets looked at during runtime when there isn't an exact match.
 
oh, I see, because $foo->reverse() might actually be a real method, but we don't know until runtime what $foo is
maybe it could have its own syntax: extension function map for iterable;
extension function \array_reverse as reverse for array;
 
7:38 PM
Part of my point above was that with Unified Function Call Syntax, you can just write a function and it can be called as a method, and vice-versa.
That's a lot of boilerplate for what could just be a normal function definition :)
 
well, the only extra boilerplate is the "for type" part; it just feels more natural to have that explicit rather than looked up from the function signature
the other alternative is just run the function and see if it fails, so (new class)->reverse(); would throw "function reverse expects parameter 1 to be ..." rather than "undefined method reverse"
explicit types would also allow the extension function to have higher priority than a real method, so you could do:
 
Extension methods should never take priority over ones that exist natively. That's just wrong.
 
function foo_but_with_args_swapped(SomeClass $self, $a, $b) { return $self->foo($b, $a); }
extension function foo_but_with_args_swapped as foo for SomeClass;
(new SomeClass)->foo(42, 'hello');
maybe
hm, another use case though: defining extension functions with the same name for different types
that wouldn't work with plain use, because you can't have two functions in scope with the same name
but extension function \array_reverse as reverse for array; extension function \strrev as reverse for string; would
syntax could be shorter: extend array with \array_reverse as reverse; extend string with \strrev as reverse;
otherwise, you'd end up with [1,2,3]->array_reverse(); which would be fugly
 
7:54 PM
Anyone here familiar with SharePoint 2013
 
/me disappears for dinner
 
haha
 
eugh, no /me support? what kind of chat app is this? :P
 
8:06 PM
@IMSoP That part is true.
> that wouldn't work with plain use, because you can't have two functions in scope with the same name
 
Wrong "translation" in German doc: As of PHP 8.0.0, passing optional arguments ・ *Languages/Translation ・ #80801
 
8:27 PM
@IMSoP A 20 year old one. :-)
 
8:45 PM
@Crell yeh, tbf @IMSoP this chat is waaaaaay too modern for that
/me runs away
 
 
1 hour later…
9:53 PM
What's the current way to tell PHPStorm that for code like:
/**
     * @template T of Foo
     * @param class-string<T> $class
     * @return T
     */
    public function make(string $class)
    {
        return $this->injector->make($class);
    }
that the return type of make will be whatever class string is passed in? Currently it seems to think it returns 'mixed'.
 
@Danack None at this point, PHPStorms type system is severely lacking in comparison to other static analysis tools.
@Danack I'm not sure if you can solve this particular use case with the meta file. jetbrains.com/help/phpstorm/…
Or you can use Psalms language server.
 
10:17 PM
:51672282 .phpstorm.meta

		override(
			make(0),
			map(
				[
					'' => '@'
				]
			)
		);
 
Anybody mind reviewing PR #6723?
 
@MarkR thanks. that page is quite tricky to parse.....
 
zend_jit_fetch_indirect_var assert failure with tracing JIT ・ JIT ・ #80802
 
10:33 PM
When will bugs.php.net be back online?
 
@Dharman Maybe we've decided to solve bugs the easy way.
 
PHP is now bug free, is it?
 
@Dharman Bug free, but filled with features.
 
"All issue have been resolved."
 
@scorgn I have tested it today. Works pretty well. I like it. Much better than the built-in intellisense I have or the current plugin I was using.
 
11:24 PM
@Dharman I really like some of the suggestions and sometimes it makes things a lot easier, but it's a little bit frustrating sometimes because it's always suggesting something and its suggestions are based on AI not on reality. So, while it should just autocomplete something with an existing function or property, it will autocomplete with a non-existing one often.
 
11:54 PM
@MarkR Is there a way we could include that with Auryn so that happens automatically when someone uses it?
 
@Trowski github.com/amphp/auryn/blob/master/.phpstorm.meta.php - I should have looked there....though that probably needs updating to the new syntax apparently.
 

« first day (3785 days earlier)      last day (1146 days later) »