« first day (3547 days earlier)      last day (1384 days later) » 
00:00 - 22:0022:00 - 00:00

12:04 AM
Thank you very much, it worked!
 
@Danack and then, sometime … in a production environment ... with bigger datasets, you realize everything is broken because of group_concat_max_len having a low default...
 
12:27 AM
Taking bets on how long before @@ bites us in the ass? I'll open at 3 years.
 
12:39 AM
1.5 years
 
12:52 AM
isset and empty suppress illegal offsets in their expressions
sight
 
1:08 AM
@Girgias Just for scientific research, I think you and Ilija as the two most up-and-coming Php-src devs should keep a daily diary of how much grey hair you develop, and plot it against how much of the src you've investigated.
 
Jesus christ, I do hope I don't start developing gray hair at fucking age soon 22
That would be sad :(
 
I think I started noticing grey at 28, and i'm now 34.
 
:(
 
1:41 AM
LSP BC break in 8.0.0 issues no warning in 7.x ・ *General Issues ・ #79768
 
2:13 AM
I've updated the Saner numeric string RFC to deal with numeric strings used for string offsets: https://wiki.php.net/rfc/saner-numeric-strings
Feedback is much appreciated before I ping the list once again
 
2:30 AM
It works, I and it's better than what we have now, but I admit to feeling it's just trying to put a sticking plaster on a needless special case.
At least array indexes are sorta sane
 
Also isset and empty are sane
They work on the strict numeric behaviour
Which is low key baffling but oh well
On that note, I'm off to bed
 
g'nite
 
3:04 AM
@Girgias The background section does a good job laying out some of the current weirdness. It would be nice if the problem section had a short code example for each issue, and then the proposal section would show a corresponding example of how each issue would be fixed. Ideally the BC break section could also show examples of what would break and if/how the code should be changed.
 
3:53 AM
@MarkR 6m
 
4:40 AM
PDO throws non-PDO exeptions ・ PDO Core ・ #79769
 
5:17 AM
Git mergin'.
 
Wes
5:30 AM
\o
 
5:53 AM
hello everyone! i'm having an issue as to why composer doesn't download any package.
console gets stuck like that. restarted my pc, cleared composer cache using composer clear-cache, even updated composer to the latest version using composer self-update
left like an hour ago
still no progress
 
@Earlee Try simple commands as composer to check listing of all available commands or composer self-update to update composer itself first.
 
6:15 AM
@Earlee did you try running it with -vvv ?
 
6:44 AM
Great, so now in pair programming I can tell add monkey monkey monkey something... when dictating code to a teammate :D
Monkeys everywhere in PHP :)
 
Hello friends. Anyone have a tutorial for php webSocket on a real webHost and not local? Searched alot but all tutorials are for local use. The problem is that my code works in local but when i upload and run my socket server code to my webHost, it's not working.
 
7:18 AM
@Matarata It's not working is not much helpful. What is error message?
 
@Tpojka yes, everything else worked clear cache, self-update,...
 
@Earlee Try with git scm console instead Windows power shell.
 
Since $foo = @(function() {return fopen('/foo', 'rb+');})(); is a valid syntax with atatattributes it can be $foo = @(@@JIT function() {return fopen('/foo', 'rb+');})(); as of now, right?
 
@Tpojka alright, it seems to work better. perhaps issue with powershell. weird, i only encountered this error recently
thanks again!
 
7:34 AM
Glad you've solved it. Happy coding.
 
7:53 AM
Hello beautiful people. Anyone know how to configure max upload file size for Symfony 5?
 
@KerrialBeckettNewham i believe that is a php.ini setting only
 
yes, I read the same things, but where on earth should that be if your using docker nginx image?
 
8:11 AM
@KerrialBeckettNewham beats me, i tend to avoid docker
 
yeah, it's a bloody mine field :)
 
cmb
the location(s) of the php.ini file(s) should be shown in phpinfo()
 
@KerrialBeckettNewham there can be a separate nginx setting for max upload size, I believe you should bump it up on nginx docker image and separately in php.ini on php docker image
 
@cmb Cheers! :)
@brzuchal How does one perform such dark magic?
 
You will need to build your image with a custom /etc/nginx/sites-enabled/default and /usr/local/etc/php/php.ini
at least those are the paths on the alpine images
 
8:22 AM
@KerrialBeckettNewham what do you mean by dark magic here? separation of php and nginx?
 
@brzuchal I was asking in a silly way, how is it done.
 
@KerrialBeckettNewham well I use nginx container with mounted /app/public only and default.conf then on docker-compose I link php service to nginx service with the "php" name or alias and that's it, document root stays the same in all my apps along with the backend used "php:9999" that's all
 
@TheodoreBrown Yes, that's exactly what I see
@Girgias What to chat about that saner numerical string thing at some point for the podcast?
 
@brzuchal man this stuff is so confusing. I'm using nginx-proxy with letsencrypt. here is the docker-compose.yml gist.github.com/Kerrialn/0673294ffce64d56215b04313f63b619
 
@KerrialBeckettNewham I've never used nginx with letsencrypt proxy but there's for sure a way to append some nginx config
I prefer to add it in Dockerfile and build a separate image of configured image
 
8:37 AM
@brzuchal I was just looking at that :)
look like I might be able to do it through the apache.conf
 
8:58 AM
@bwoebi Any idea why an "[Element 0 has been added to watchpoint]" message would appear at github.com/php/php-src/blob/… on ppc64el architecture?
 
@NikiC No - would need to debug that, but I have no such machine
 
@bwoebi yeah, me neither ^^
 
anyone got a good solid argument against blacklist-based web filtering for me? I seem to be unable to articulate myself to this customer who is absolutely unable to trust his staff, apparently
the guy has trust issues, the staff are fine afaict
 
@DaveRandom Because blacklists are racist. Duh.
 
@DaveRandom “unknown unknowns”. Huge time pressure for areal answer?
 
9:11 AM
@DaveRandom exclusively blacklisting?
 
@bwoebi Eh, maybe I can debug it after all. I created an account request with the GCC compile farm, which has powerpc machines...
 
@Danack that's my basic approach, doesn't seem to be a valid argument here for some reason
@MarkR basically the guy is trying to block porn... personally I think either he needs to watch less porn, or he needs to find some new staff who don't spend all day watching porn
because this is sure as shit based on some incident that has happened in the past, and I wouldn't mind betting it was this guy's fault when it did :-P
@NikiC cmykkk?
 
9:26 AM
@DaveRandom Option 3) Add a new policy where staff are informed that once per month they'll have a company wide "information sharing" seminar where they'll be asked to stand in front of everyone else and describe what they were working on from a "randomly selected" 30 minutes of screen capture from their work machine.
 
That's probably not legal
Not to mention, abusive
@DaveRandom Who is trusted with maintaining the black^Wexclude list?
 
well that's sort of my point to him, he has a Dryatek router and they have some sort of cloud filtering service, that is presumably as good as any other option
but whetever you do, you are reliant on a black box list curated by someone else
unless you want to curate it yourself
<aint_nobody_got_time_fo_dat.gif>
 
@Derick It's legal if you inform them of it. But that's besides the point, you don't have to do anything, the thought of having to describe ones porn browsing habits to the entire company is enough to stop most people ... or at least have them switch to their phones :P
 
@DaveRandom oh, in that case, the argument would be trying to find a technical solution for a non-technical problem.
 
well that's precisely the problem, I feel like I'm talking to a wall though
I think I'm just going to give up and do what he wants and let him realise his mistake on his own
 
9:31 AM
what's the downsides to it Dave?
 
there's only so many hours in the day
@MarkR it's not, and never will be, a solution to the problem it is being used for. It affords a sense of safety where one should not exist.
 
(If it's just a click-to-enable thing)
 
If somebody else maintains it, then it will block arbitrary things that are safe. Often access to information about abuse, support for LBGT people. And sometimes only at work feel people safe to look up information about abuse, because they can't do so safely at home.
 
yes :-/
 
Still, a person has no right to have access to those things at work, the right just doesn't exist.
 
9:33 AM
basically, censorship should be avoided unless necessary because bad things happen when you let other people police your opinions
that's the crux of all of my opinions about it
and "necessary" does not include a collection of mature adults in a free country going to do their crappy job at a delivery firm
it's a violation of freedom but more importantly it's treating your staff like the enemy, which is not the way to run anything
imho
 
I'm assuming they're company owned devices on a company owned network?
 
@DaveRandom It's not trusting the staff.
 
IMO the company has every right to say what you can and cannot use their resources for, watching porn would definitely fall under something a company would have an entirely legitimate reason to block. If they're using their own devices and their own networks, they have no right to object unless doing so directly interfears with their ability to perform their jobs
 
Sure they have the right, but it's not the right thing to do.
 
Why not? The company gets to specify what it's resources are used for. That's the long and short of it.
 
9:43 AM
!!rfcs
 
Renaming T_PAYAMAKIM_YATODUKEM is currently only at 60% :(
 
is there a tl;dr why someone would vote no to that?
 
Because the real fix would be to not have token names in output at all, and just have T_DOUBLE_COLON.
 
@Derick I thought we agreed on today 1400 BST?
 
9:52 AM
It's... not in my calendar, but sure :-)
 
@TheodoreBrown That's a good idea, will try to do that
@Derick You'll send an email as usual?
 
Yes, will do that now
 
@Derick precisely this... it seems to be difficult to explain that it's not the right thing to do to someone who doesn't implicitly understand that, though :-/
I make a point, and they stare blankly back with an expression that says "...and your point is...?"
 
You've two options: refuse to do it ; do it
 
the former won't go down well with my employer, and on balance I'd rather retain my job
 
9:56 AM
Is your employer aware of the issue?
 
I'm getting sick of doing IT support tbh but does seem to be calming down a bit, hoepfully I can go back to doing my actual job soon :-P
@Derick it's just part of a general supply/fit project
 
@NikiC while I'm at it should I just integrate your Saner String to Number comparison RFC into mine? wiki.php.net/rfc/string_to_number_comparison
 
so not specifically but yes
 
Ask your boss to explain it to them?
 
@DaveRandom Just do it, but make sure you've got a paper trail where you tell them that blacklisting is only ever a partial solution and it is impossible for a blacklist to block every possible site as there's no comprehensive list of "bad" and new ones are added all the time. That way you're in the clear
 
10:13 AM
@NikiC didn't see your update on internals, so forget it
 
@Crell obviously not urgent, but small feedback; for the section "In other words, trailing optional parameters in the closure will not have their resolved defaults sent to the underlying function." maybe add an explanation of how the maths works to get:
$f(0, 2); // prints 3
$f(); // prints 2
as I'm having to think to understand that bit.
 
- ・ Unknown/Other Function ・ #79770
 
@MarkR yeh indeed, that is the only way it seems
 
10:33 AM
 
10:56 AM
so much of the email in my inbox has nikitas address that he is now classed as a "promotion" by gmail ...
8
 
lol
 
Yeah same :')
@NikiC just to be confirm, there is no distinction in type checks for userland/internal functions in PHP 8
 
@Girgias there is for null
 
Well that shouldn't concern numeric strings, but I didn't know that, what's the difference?
 
Hi. When i create a websocket on a webHost, what kind of address should i get to url variable in client.php?
for example ws://ipaddress/server.php
or ipaddress/server.php
also how should i run the code? opening php file in my webHost from browser is enough?
 
11:11 AM
@Girgias internal functions allow null in weak mode :(
 
@NikiC whyyyyyyyyyy :(
 
11:24 AM
Data type mismatch on the documentation page ・ Documentation problem ・ #79771
 
11:55 AM
@Girgias because php :)
Well, because BC really. But that's the same thing ;)
 
As always
Btw @NikiC what is your opinion on the semantic changes I'm proposing for string string offsets? The only part I'm not super sure about it changing well formed float strings from Illegal string offset to String cast occured warning
Would make it more inline with the usage of floats, but then it adds a bunch of boiler code to deal with that specific case
 
12:43 PM
@NikiC The Named Arguments RFC should probably use the new syntax in the attributes example.
 
@TheodoreBrown probably. I also realized that I haven't implemented named param support in attributes at all ^^
is there an implementation for the new syntax yet?
 
@NikiC I just created the pull request: github.com/php/php-src/pull/5796
 
1:16 PM
@TheodoreBrown Congrats @TheodoreBrown! Even though it wasn't my first choice I'm glad we've picked a syntax the majority of people (and Reddit :P) are happy with.
 
Great that this was not mentioned in the RFC
 
morns
 
> Okay, this is a really big problem. This really needed to be part of the RFC. I'm afraid we will be forced to declare this proposal void on technical grounds.
Crap, so we're back to <<>>?
Just for clarity, why is this a big problem?
 
1:31 PM
@Danack Um. Context for what you mean? I don't know what you're talking about.
 
in the partial rfc.
specifically the func num args bit.
 
@IluTov It treats namespaced names in a non-standard way
The RFC might still be salvageable if we also accept wiki.php.net/rfc/namespaced_names_as_token (or just the namespaced name part of it, the reserved keyword part is irrelevant)
 
Good morning o/
The name / namespace / whitespace thing was also present in the @: syntax proposal. Benjamin put it this way:“The “Smiley” syntax uses the shorter, more familiar “at” symbol commonly seen in docblocks. The downside is that it does not permit whitespace in attribute names to allow detecting the ending of the declaration.”
 
Wait, what's wrong with @@?
 
(quote from "RFC: Attributes v2")
 
1:37 PM
@IluTov technically, due to us using STV, we are actually #[] then.
 
@Danack Oh, I see. That's... much of the details in that RFC are aspirational from @LeviMorrison right now, until @IluTov is able to figure out how much of it is actually doable. :-)
 
@Crell It does not allow for whitespace within attribute names which is not consistent with the way PHP treats names in general.
 
... You can have spaces in identifiers? Since when?
 
@Crell not in identifiers themselves, but before and behind namespace separators
i.e. namespace \ Foo \ Bar is valid
 
:exploding head emoji:
PHP is so derp at times.
 
1:41 PM
To quote myself from the past (early April) on the problem with this and @: / @@ attributes: github.com/beberlei/php-src/pull/2#issuecomment-609466083
 
@Crell there exists wiki.php.net/rfc/namespaced_names_as_token … but it hasn't been voted on yet
@kooldev you should really have mentioned that in the RFC :-/
 
@NikiC Yeah it's inconsistent... Would've still been ok IMO if it was specifically mentioned.
 
Yeah, this would all have been fine if we had made an explicit decision about it. But it was not mentioned, and at least I wasn't aware of the issue.
 
@bwoebi It was mentioned in the RFC: Attributes v2 with the @: syntax. I only changed the syntax around in the 2 PRs mentioned in the Shorter Attributes RFC, that is why Theodore mentioned me as a co-author in the RFC.
But it doesn't really matter, it would have to be in the RFC text. I read the RFC but I did not notice that it was missing... :/
 
And to add to that I did actually think "The downside is that it does not permit whitespace in attribute names to allow detecting the ending of the declaration" would refer to whitespaces in the identifier (not around ns separator) which is why I was a little confused but disregarded that.
 
1:50 PM
@bwoebi Yeah, I was also confused about that in the original proposal. I did not make the connection to this at all.
I guess this is also why there was talk about requiring () with the @@ syntax?
Because that would also avoid ambiguity?
 
@NikiC That was basically the alternative proposal, use () to workaround lack of a closing delimeter.
 
@NikiC So what now - are we going to declare the whole RFC invalid, put it on hold until your namespaced_names_as_token RFC has been voted on, or just reject @@ and declare #[] the winner as per STV, after removal of the @@ votes?
 
@bwoebi I think we'll have to put this on hold until the namespace token RFC is decided, and then depending on the outcome there either use @@, or decide whether we go to #[] per STV or <<>> per default.
 
I agree. Seems the best course. Are you going to declare your intention to bring it up to vote soon on the ml?
 
yeah
I think I will cut it down to just the namespaced name change though
I think the reserved keyword parts are trickier and more controversial, based on the discussion
 
2:03 PM
@NikiC +1
 
@NikiC Are you going to allow keywords within the namespaced name, but not within class/func etc. names?
 
does #[] win if all preferences from @@ voters is going to their second choice?
 
@bwoebi yeah
 
@beberlei yes
@NikiC But if we do not allow for keywords, are there any concrete benefits apart from being able to support @@?
 
@bwoebi It still allows reserved keywords if they are only part of the namespace
 
2:09 PM
This question is not PHP, it's about making an API request, may I ask?
 
E.g. iter\fn :)
 
@NikiC but it won't allow namespace fn;, only namespace iter\fn; right?
 
@bwoebi But without the rest, it's more a matter of doing the BC breaking change in PHP 8, while relaxing reserved keyword restrictions can be done anytime
@bwoebi Maybe namespace semi_reserved should be allowed then? (except for the case starting with `namespace`)?
 
@NikiC I would say so, otherwise it's weirdly assymmetric
 
@aderchox If it's PHP adjacent you may get an answer, but possibly not if no one knows. Don't ask to ask, just ask.
So it sounds like the result is @@ if we can make it work, #[] otherwise?
 
2:16 PM
@Crell I think so, yes.
 
It's probably worth notifying the list about it now, just so people don't get surprised later. "Here's the problem, here's what may work, here's what we'll do if it doesn't work."
Expectation management and such.
 
@Crell I'm trying to make an API request with Postman toward Telegram so that it sends an inline keyboard to a chat (I provide the chat_id in which the Bot is allowed to send messages), but the problem is, in the Telegram Bot API, the keyboard consists of an array of buttons. I don't know how to put a structure in a request? I guessed maybe I had to change the request to a POST and add the structure as a JSON to the body of the request, but I don't know what that JSON should be like?
Here's the "sendMessage" method: core.telegram.org/bots/api#sendmessage (notice the reply_markup parameter) and this is the InlineKeyboardMarkup: core.telegram.org/bots/api#inlinekeyboardmarkup
 
@Crell Nikita already emailed the list.
 
Ah, good good.
 
@TheodoreBrown not yet … but yeah he's going to
Or did I miss some mail?
 
2:21 PM
@bwoebi He replied to the Shorter Attribute Syntax vote results email.
 
@TheodoreBrown ah got it now. You got it earlier as direct recipient :-) There's always a slight delay for the distribution from the ml.
 
Ah, makes sense.
 
2:41 PM
@brzuchal So far you're winning. I'm going to assume you meant 6 minutes rather than months :P
 
@MarkR :D
And I was about to comment on that that I it wasn't my preferred syntax either but I wouldn't know how it could lead to any issues.
 
@NikiC It sadly wants me now to vote against that namespaced_names_as_token RFCs, as that could mean not having @@ ;-)
 
@Derick Same here :-)
 
@NikiC It would need a new vote, you can't just eliminate a candidate from STV - some people haven't picked more than one option in their votes.
 
@Derick The ability to eliminate a candidate from STV is one of its benefits.
 
2:45 PM
@Derick well, doesn't STV have a proper handling for such invalid votes?
 
I thought that was part of the point of STV?
 
Removing candidates? No.
Ranking your choices is what STV is about.
 
Right. And if someone is eliminated you have all the information you need to recalculate.
 
Yes, but people might have voted differently for various (odd) reasons. - or at least picked a preference. Not everybody ranked two candidates
 
That's their problem IMO. It's no different than not voting.
 
2:53 PM
Agree with Mark.
 
Everyone who voted @@ for their first choice, would have their vote replaced with their second choice, then with only 2 left on the table it's simple majority wins out, or is there some element of the maths I'm missing
 
3:12 PM
I think you're missing the part where this actually makes some kind of sense and isn't insanely over-complicated
oh no sorry, that's what I'm missing
 
@Derick heh :)
 
I'm kinda surprised @@ is winning over #[], honestly. @@ is ugly, there's no precedent, and anyone hoping to drop it to a single @ is probably delusional.
 
s/is winning/has won
 
<<...>> and #[...] at least have precedent in other languages, and I don't think #[...] is ugly and will allow you to have files that are valid for 7 and 8 (albeit in 7 they are non-functional without a way to polyfill it, methinks). So why are people voting @@? I don't understand.
 
Go does this:
 
3:25 PM
Aye I didn't get it either... something without a closing tag was always going to cause issues, if not now, then later.
 
  Breakpoint  Breakpoint `xml:"breakpoint"`
between ` and `
@LeviMorrison Because of lots of people voting have no idea how parsers work?
 
3:46 PM
@@ has the advantage of being less effort to type?
 
True, but it's pretty marginal...
 
Hey, I still don't get a vote. Don't look at me. :-)
(I really need to go do some more docs at some point to get voting rights.)
 
How can you edit the wiki if you don't have voting rights?
I thought anyone with a php.net account could vote.
 
You can have wiki-access only.
Or could in the past, anyway.
 
@MarkR Most RFC authors don't have a vote when they just start.
 
3:58 PM
Ah OK, thanks. Personally I think people like Crell / Tiffany who spend a lot of time in here contributing to debates and discussions are deserving of a vote far more than those who haven't contributed to the ML or Src in years.
 
If they ask for voting karma the worst that can happen is ~~~personal attacks on their character~~~ getting a "no".
 
oops
 
(How do you do strikethrough lol?)
@MarkR Accidentally touch a yubikey?
 
Yup.
 
@MarkR I can vote, but I abstain from voting on a lot of stuff
Personal choice
 
4:04 PM
I have Wiki, but not VCS.
I figure I should get some actual commits to my name somewhere first to avoid the "personal attacks on their character" step.
I've had enough of that already from parts of the tech community.
 
I don't feel comfortable voting on an RFC in which my knowledge of internals is pretty low.
I voted in the shorter attribute syntax RFC because it seemed less about the technical implementation and more about "what do we want," so I felt comfortable with that one
 
@MarkR great, I knew it. What did I won?
 
@brzuchal You get to be the person to kick off the great overly-dramatic facepalm
 
There should be a formalized rule where if an RFC author has at least one or two RFCs pass (and possibly provide the implementation? I dunno), they can have voting rights, in my opinion
 
Let's just add amendment RFC for @@ and #[] with the ambiguity of @@ and glorifying #[] ;)
 
4:10 PM
 
The voting rfc (wiki.php.net/rfc/voting) states that one path to voting is "regular participant of internals discussions" as chosen by people with VCS accounts, which is probably 80% of the people who chat in here. So you may wish to consider applying all the same Larry.
 
Yeah, what the RFC says and what will get you attacked on the list are two unrelated things. :-)
I figure if I add one or two more doc PRs I can apply under that and hopefully avoid anyone's wrath.
 
aye, that's the easy way, in my opinion
@Crell a trick (courtesy of @DaveRandom)
 
I'm easily bribed with whisky.
4
 
4:22 PM
I don't buy alcohol. :-)
 
Amazon UK vouchers work too.
 
@Tiffany Nice cheat. :-)
I've been thinking I should write a page on preloading, since last I checked it was still very under-documented.
 
/me waits for someone to recommend renaming master.php.net, also that server really, realllllly needs its SSL credentials updating.
 
5:23 PM
@MarkR oh no, please don't mention that to anyone
I don't think our infrastructure can survive that rename :P
It's the last bit of duct tape holding things together
 
5:37 PM
 
@Tiffany Check out the server signature :P "Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8e-fips-rhel5 PHP/5.4.11-dev"
Which according to php.net/ChangeLog-5.php#5.4.11 was released on 2013 xD ... dunno if those headers are accurate or not
 
probably are still accurate...
 
6:22 PM
Leading by example :P
 
 
2 hours later…
8:07 PM
Do RFCs have to describe all edge cases? The first match RFC was too complex, I want to avoid that in the future without leaving out details that would make people feel cheated on.
Concrete example: takes_ref($foo?->bar) This could throw an error "Cannot pass parameter 1 by reference" or pass null and throw no error (similarly to how using ?-> in the lhs of an assignment skips the assignment).
Since passing by reference is relatively rare and using ?-> is probably going to be very rare I wasn't sure if this was worth describing.
 
ThW
If I happen to hit one of the edge cases I would really like to know what happens. On the other hand short understandable RFC are nice. So maybe something like describing the general behaviour and then a section for known edge cases.
known vs all
 
@IluTov If you know of it, you should put it in. It wasn't even 12 hours ago since the last passed RFC was put on the fast track train to voidyland because something known that caused an edge case wasn't properly described.
 
8:23 PM
@IluTov it's better to error, than to silently do a weird thing.
Also, if it errors to begin with, it would be easy to 'relax' it to the other thing. But people would complain about a BC break trying to change it the other way round.
 
@Danack Not necessarily. If you want an error you wouldn't have used ?->. Erroring here also requires looking for ?-> in every function argument...
@Danack Yeah that's true.
 
> If you want an error you wouldn't have used ?->.
 
@Danack Yep, we're skipping assignments when using ?-> in the lhs for the same reason.
The reasoning is, if you want an error, don't use ?->.
 
except that people will write it by mistake....not realising that there would be a weird thing happening.
@IluTov pretty sure that one is fine. Not doing an assignment is different from doing a subtly weird thing.
 
@IluTov RFCs should have all the edge cases :)
 
8:34 PM
@Danack Ah dude you're making me question everything again. Indecisiveness is the most frustrating part about writing RFCs :/
 
For me:
$foo?->bar = 5;
// is equivalent to
if ($foo != null) {
     $foo->bar = 5;
}
And that's fine.
But I can't write what takes_ref($foo?->bar); would be equivalent to, that isn't either a mistake, or just really really weird.
maybe like:
if ($foo != null) {
    takes_ref($foo->bar);
}
else {
   takes_ref(null);
}
 
@Danack Well, the main argument is that using ?-> would have absolutely no point as you'll just error a little bit later. But you'll always error.
 
@IluTov that's the point of a RFC. Nobody shall be able to say at the end "I did not know that, otherwise this should definitely have been discussed"
 
@Danack Yeah, what you're suggesting would be takes_ref($foo !== null ? $foo->bar : null) which would always fail if $foo is null.
Which is definitely a viable solution. The ?-> just serves no purpose here.
 
@IluTov yes. calling a function that takes a parameter by reference, but instead passing no parameter, is a mistake. It just means that null short circuiting can't be used for functions take parameter by reference.
pretty sure both people that affects won't mind too much.
 
8:40 PM
My example was actually wrong as $foo->bar couldn't be passed by ref if it's used in a sub-expression, yours is right.
 
Nov 8 '15 at 16:57, by Danack
Maybe. I guess ternary statements are their own punishment anyway.
 
Thanks for the feedback guys, I will add the details to the RFC.
(Although once again, I'm unsure what those details are :P)
 
preg_match(..., $optionalResult?->matches)
I can't say I care strongly about the behavior here, but I do care strongly about not introducing any unnecessary complexity in argument passing, especially for such a piece of crap as references.
For that matter, what happens with $x =& $y->z?
 
@NikiC Apparently it's not as simple as emitting a SEND_VAL instead of SEND_REF as I thought, it could possibly require an additional check in the VM.
Because I found out in a test that the "Can't send by ref" value isn't printed for SEND_VAL atm when using the result of ?-> for whatever reason.
 
If $x =& $y->z should be allowed IFF f($y->z) by-ref is allowed.
 
8:49 PM
Man, no short circuiting would've been dead simple :P
(With no I mean still short circuiting method args but not chained calls)
 
I wonder if that's why the previous rfc proposed that....
 
@Danack The previous RFC was crippled because it didn't even short circuit method args which is very unexpected.
 
@IluTov Yeah, what you want is closer to SEND_VAR_NO_REF, but also not quite. To use that you'd have to make sure the value is already a reference in the non-circuiting case.
 
So null?->foo(bar()) would call bar()
@Danack For reference: wiki.php.net/rfc/nullsafe_operator#introduction1 The last RFC suggested option 1. Option 2 and 3 are both viable.
 
ThW
@IluTov I would not expect that.
 
8:58 PM
@ThW Exactly. That shouldn't happen.
We could also technically introduce option 2 first and 3 later if we think it's necessary (without BC breaks).
 
ThW
The result is already null, so I would not expect that any other call to happen
 
@ThW wiki.php.net/rfc/nullsafe_operator#other_languages Some languages do short-circuiting, some don't. I think both approaches are valid. Short-circuiting is preferable IMO. Unfortunately, it is undoubtedly more complicated (for the language implementation and for the user).
 
Wes
\o
 
ThW
@IluTov I used the syntax in Groovy - feels like a code smell most of the time.
 
ThW
9:19 PM
Happy to have the possibility but don't want to use it.
 
00:00 - 22:0022:00 - 00:00

« first day (3547 days earlier)      last day (1384 days later) »