« first day (3900 days earlier)      last day (1055 days later) » 

12:12 AM
I've been listening to to the BBC's "The Missing Cryptoqueen"... I can much recommend this
 
 
4 hours later…
4:20 AM
fileperms() return wrong access information ・ *Directory/Filesystem functions ・ #81179
 
 
4 hours later…
7:53 AM
Using preg_match,preg_match_all even for non-matching conditions will cause php ・ *Regular Expressions ・ #81180
 
8:14 AM
RFC implicit-float-int-deprecate not mentioned in UPGRADING ・ Documentation problem ・ #81181
 
 
1 hour later…
9:16 AM
@IluTov I'm sorry
 
9:50 AM
@NikiC I absolutely expected that comment, just not from you :D
 
10:19 AM
@IluTov How about a more useful out-of-memory error message, or some way of triggering a callback when memory usage is close to hitting it?
I think I saw mention of some use of ticks to do it, but as they're going away
 
This is one of the most common pitfalls for references. 3v4l.org/Nro96 What do you think about automatically unsetting referenced variables after a loop? It's a BC break but I'm not sure how often that is used intentionally.
@MarkR I think out of memory errors already trigger error handlers, right? Some error handlers allocate some memory that they release when they are triggered so there's enough memory to do proper error logging. github.com/symfony/symfony/blob/5.4/src/Symfony/Component/… Do you have something better in mind?
 
Admittedly maintaining a buffer of memory to free to do logging work was not something I considered.
Still, a warning threshold would certainly be nice before hitting the fatal though.
re: array references, it would be a solid improvement to language sanity, but what about the risk of subtle bugs further down the function if reading it and you've undef'd it? I think that would want to be paired with throwing on reading undef variables
 
10:39 AM
@MarkR We could deprecate not unsetting references after loops. But I think it would be a little annoying that the unset would become useless after switching the behavior.
 
become useless?
 
@MarkR What I meant is, we could emit a warning if you don't unset a variable after a foreach before we switch to doing that automatically. After doing it automatically the unset that you just had to add manually becomes a noop. At which point you can remove it again. That seems a bit annoying.
 
How would you detect that the user had manually unset it?
 
@MarkR Just check that the next op is an unset of the given variable. I'm not sure if there's a better way to provide a deprecation before switching the behavior.
 
11:05 AM
Nothing that comes to mind with my limited knowledge. Two alternatives for complete unsetting; 1) convert any reference to a non-reference at the end of it 2) introduce a new poisoned zval that will error out if you try to read or write to it, which would probably kill performance across the board and is a terrible idea, but would stop the referenced variable from being either read or written without a very big error.
 
Is there any way using which I can refresh browses data without Ajax.
WE can see such operations in stocks.
What are they using?
 
ajax or websockets
afk for me
 
I know Ajax can do this but I don't any users to know they URL and they can JAAAM my server.
 
What do you mean by "JAAAM"? What scenario are you trying to prevent?
 
@MarkR 1 would be problematic for performance as to do that we'd have to duplicate whatever value the reference holds, which might be a large array, just for it to probably get discarded. 2 is an interesting idea, haven't thought of that.
 
11:14 AM
There's no way I know of to transfer data between server and client without the client being able to know (or replicate) how you did it. You can use authentication, time based tokens and/or rate limits to prevent (or at least mitigate) most unwanted scenarios tho.
 
11:56 AM
By the word JAM I mean user can use that AJAx URL and try to steal the data and that eventually JAM my serve.
Yes, we can use authentication, time based tokens and/or rate limits to prevent it but I want to achieve it avoid it like tradingview.com
 
Like a ddos attack or something?
It's called a timing attack
 
@Exception What makes you think that is not working using xhr or websockets?
 
Yeah! kinda
But Currently my concern is how tradingview.com has achieved UI update without ajax
@PeeHaa yes, we can achieve it using ajax but not aware of websockets.
Trying to understand websocket youtube.com/watch?v=Q7Us_DjMbXU
 
 
2 hours later…
1:37 PM
@Exception Almost every request on tradingview website is AJAX call. What exactly you refer as non-AJAX there?
 
@Tpojka go to chart and search for BTCUSD and check AJAX call.. you will see chart is not updated with any ajax value..
 
2:06 PM
@IluTov you want to do sealing ?
 
@JoeWatkins Sealed classes? We've planned on ADTs which have similar goals but there's not enough time.
 
2:22 PM
Mornin'.
Do you think there's time to finish is?
 
@Exception When you go to /chart path and land on that page, after that there is executed AJAX call that collects data.
 
@Tpojka Yes there are AJAX calls but none of the AJAX calls updates data on Chart (if you notice)
 
@Exception I neither can see chart is being changed after that.
 
yes, chart is updating for BTCUSD . Lower your timeframe to 1min
 
2:38 PM
@Crell what do you think about enum Foo: string as string { ... }? ( see: https://cloud.void.tn/c/15?version=latest )

concept: while `enum Foo: string { }` is fancy object, `enum Foo: string as string { ... }` is fancy union type between literals.

( in hack, both are the later at runtime, hence the identical results at runtime )
 
@SaifEddinGmati Highly skeptical. We deliberately went with the more-robust version of enums to cover more use cases. Having two very similar things with very similar syntaxes that do two very different things seems... problematic.
 
well, the upside of it is that enums can stand for strings/int and be used as array keys, but i can see your point.
 
@Crell Probably not. Discussion period is two weeks, voting is two weeks. I was looking for something that was super simple/uncontroversial.
 
Just redo the engine in Rust
/s
 
@IluTov do you want to help me with the #[NamedParameterAlias] RFC? :D github.com/php/php-src/pull/6522
 
2:50 PM
@IluTov From the reddit thread, reddit.com/r/PHP/comments/o41juw/… is the only one that seems to fit the bill
 
hm. short-match just needs to go to a vote so it can lose properly. :-) There was discussion in its thread of a shorthand for while(true) and switch(true), which are probably equally trivial to implement (if not trivial to discuss).
 
also wondering about #[DisallowNamedParameters] on the function, method + class level
 
Ha, I was just reading that thread; didn't register that it was you.
 
@NikiC Didn't Tyson bring this up on the list recently?
 
@NikiC Is that something we want though?
 
2:54 PM
Would be kinda consistent with named arguments and unpacking?
 
@Girgias He did?
 
Well... I thought he did, might be imagining things...
 
@Exception As @MarkR says XHR and WS are ways for client-server communication. Check if in JS code is something like new WebSocket.
 
@Tpojka @Exception there is a third protocol called Server-Sent-Events (EventStream)
 
@IluTov What if we left out the decomposition part, but just added match? I keep running into places (mostly in legacy code) where matching on type would be helpful.
 
3:03 PM
@Crell Still not uncontroversial, given you and me don't agree on the syntax ^^
 
@beberlei I am also looking for amphp/reactPHP, if they are providing similar kinda behavior
 
@IluTov Breaking references after foreach sounds good
 
they are tools for the backend side, websocket/SSE would be the client side
 
Uncontroversial from my side :P
 
3:15 PM
@beberlei Thank you.
 
@NikiC With Marks approach (throwing when assigning/reading the reference) or simply unsetting it?
 
@beberlei Just a nitpick on the RFC but shouldn't message be in the attribute and the arg1 be the parameter name? wiki.php.net/rfc/named_parameter_alias_attribute
 
3:36 PM
@Girgias I suppose. Although it has a few drawbacks IMO: 1. It's already possible and not dramatically better than what we already have 2. : will be blocked as a unary operator if we ever need it 3. It will introduce some inconsistencies (we've talked about => being the operator where an expression follows). If we do it I suppose we should also introduce yield foo: $bar; but it looks kinda weird.
 
@IluTov If poisoning the zval is possible without a huge performance hit, you could use that mechanism to deprecate reading / writing it, rather than throwing, and implement unset behaviour in 9.0. Using it again would still facilitate using unset but "use a different variable" is probably the easiest solution
 
@MarkR Yes, absolutely. If we pick that route it's definitely the way to go.
 
I don't think i've seen such a thing anywhere, but does PHP support proxying individual values? I know we've got references but is there anything that could be like... zend_proxy which were pointers to functions to read / write a value somewhere else?
 
@NikiC @IluTov Things I would like to see in 8.x? Elimination of $a = array();so that we stop getting messages about var_export() not using shorthand, but then again you know BC :>
 
@IluTov I mean I also think this boat has kinda sailed as there already was a similar RFC for it: wiki.php.net/rfc/bare_name_array_literal
(took me a while to find this)
 
3:53 PM
@Girgias what if the bare named identifiers were for objects? $obj = { name: 'phpfi'; }; echo $obj->name; as a shorthand for $obj = new class () { public $name = 'phpfi'; };
 
Eh maybe? But are anonymous classes used that much in PHP?
 
Well I see a lot of code like: `$obj = (object) ['name' => 'phpfi'
 
brrrr
 
or even the json_decode(json_encode(...)); variant which is even worse lol
 
But why would you write this code????
 
3:57 PM
If someone wanted to rip off TS and be able to create a dynamic class by doing: foo(): { $x: int, $y: string} that would be nice... or i guess for PHP foo(): { int $x, string $y}
 
... Isn't that just a tuple ?
 
That is the right question, I think it is because writing: $obj = new stdClass(); $obj->name = 'phpfi'; is a lot of boilerplate vs a cast even
 
@Kalle As of 8.0 that's entirely unnecessary now.
 
@Girgias A tuple uses numeric keys iirc, but I could be wrong on that.
 
@Girgias I've only ever used them for writing tests. They're super useful there and eliminate the need for mocking frameworks, but the fact that you can't specify the parent class dynamically makes them of little use otherwise.
 
4:01 PM
@MarkR I mean yeah, but they are also immutable, although we don't have this in PHP, which is why I suppose objects are used for everything and anything
Huh, well good to know
 
Honestly, I never really understood the point of tuples. The cases where I want numeric keys instead of string keys are... minimal to non-existent. And a named tuple is either an associative array or an object, depending on your flavor.
@NunoMaduro What's the word on Auto-capture closures? Are we going to be able to have a new vote on that or not?
 
@Girgias They don't have to be in TS although you can use foo(): { readonly x: number, y: string }. I imagine it would be identical to creating an anonymous class with the name mangled from the keys and then return { x: 123, y: "Hello World" } would inspect the keys and return the same ce
 
@Crell I've only used tuples in Python, so eh but in essence any function is a named reference which takes a tuple of arguments sooo
 
Yeah, I've seen them used as an integral part of the language design, in which case their use in user-space code is more of a "well, I guess it's there."
But I hate writing user space code with them.
 
I hate writing Python tbh
Having an error with a call stack 10 levels deep because you passed in the wrong type just tilts me to no end
And numpy's design is so whack and unintuitive
 
4:14 PM
@Crell I haven't used them in C#, but what I've read seemed nice. In terms of an array: no type-safety. The alternative is creating a class, but creating a whole new class and figuring out what methods it needs is harder for me than using a preexisting construct
 
Tuples don't have methods anyway.
 
Exactly :P I would need to think about private/public, which getters I need, and their logic
SO mobile chat double message bug from editing a message too soon
 
PHP 8 solves much of that. :-)
 
True :(
I was working on a side project at work, related to a ticket, that gave me an opportunity to see how far I've come with class design, and I'm a bit farther than I thought :D but it's not complete, XMLReader's file pointer behavior is still unfamiliar to me
I had planned to use an array as an object storage mechanism, ended up writing a new class to store the objects in... strong chance it wasn't necessary, but it was nice to try
A tuple would've worked in a pinch though
 
Oh actually @IluTov a Comparable interface maybe, I think you could copy a bit on how ArrayAccess is implemented with the standard object handler
 
4:32 PM
That's not exactly uncontroversial. :-)
 
4:43 PM
What is controversial in it?
It's not implemented by default
 
@Girgias Same reason as the operator overloading RFC I suppose.
 
I don't like operator overloading, but comparing objects seems rather benin, oh well
I might tackle that for next year
with a whole other bonkers RFC for normalizing offsets...
 
is there a function that validates a zend_string is an identifier as per language outside of the parser?
 
5:02 PM
A comparison RFC was floated before; I don't recall if it got to a vote.
Like operator overloading, there are... interesting... questions to consider around types and inheritance and order.
Basically a comparison interface is operator overloading for <=>.
(To be clear, I want object comparisons. But it's not a trivial uncontroversial task.)
 
Right, that.
Once again, we're bitten by the widely divergent philosophies that PHP developers have, which leads to the language having a "jack of all trades, king of none" mentality.
 
 
1 hour later…
6:40 PM
@IluTov just checking you saw the closure self-references wiki.php.net/rfc/closure_self_reference idea.
 
@Danack Sorry, yeah I saw that one as well.
 
cool.
 
 
1 hour later…
7:53 PM
@NikiC Since you're the author of arrow functions, what do you think about omitting () for empty arrow functions? I'd also like it if we could use unnamed params with $0/1/2/.... I wish we would've used braces for a better visual cue (e.g. { $0 * 2 }) but I guess that one's out the window now. I'm bringing it up because I'm thinking about optimal syntax for scalar methods.
I see typing used a lot for closures and even arrow functions. It makes sense right now because we don't have typing on the callee side but I think that would be preferable. IDE support would make types in the closure declaration much less necessary. That's why I think $0/1/2/... would be great.
 
@IluTov uh not much?
I'm not sure I see the relation to typing
People typing closures are just following some style guide that makes little sense in context
I don't think we need arrow functions to be any shorter than they are. $0 style syntax is super ambiguous by itself
And disambiguating it with {} introduces yet another way to write things, and is going to run into parser level ambiguity issues
Not to mention potential interactions with a future block expression syntax
 
@NikiC I often do typing just to get auto-completion. E.g. fn (User $user) => $user->getUsername(). If we had callable types that would be less necessary and then fn => $0->getUsername() would probably become more useful.
 
@IluTov Ah, I was more thinking return types there. Arg types can make sense for completion
 
@NikiC Yeah I'm not suggesting that at this point. That ship has sailed.
 
fn => $0->getUsername() is just terrible
 
8:00 PM
@NikiC Swift has $0 :) docs.swift.org/swift-book/LanguageGuide/Closures.html#ID100 I guess I'm just used to it.
$0 would be ambiguous in nested arrow functions, but who does that? And yes sadly we already allow these variables with ${0}.
 
 
2 hours later…
10:04 PM
Could not create a MySQLi connection ・ MySQLi related ・ #81182
 
> Expected result:
> I would like to see if the ext-20-mysqli.ini needs to be modified in the ports/pkg for FBSD or if this is an issue that may pertain to other OS systems out there.
 

« first day (3900 days earlier)      last day (1055 days later) »