« first day (3559 days earlier)      last day (1372 days later) » 
00:00 - 22:0022:00 - 00:00

12:01 AM
/me raises eye at MS
 
what now?
 
Well they "clarified" the original announcement to no support in any capacity, to remaining involved in many ways and supporting and collaborating on security
Which is good. It just makes me think they noticed they ended up on the front page of the tech press for it :P
 
But ... not by funding the development infra structure anymore?
"Microsoft has helped fund build infrastructure for the PHP for Windows community. We decided to transition out of this effort"
 
Yeah that's odd, I mean wouldn't we just shove the binaries on the main server?
Maybe Azure is running out of disk space :o
 
It' not the hosting, it's the building of the binaries that's the main issue there.
php-web4 has plenty of space
 
12:15 AM
The building, or the getting to work so they build?
I was under the impression our ci/cd pipeline already created windows builds
 
both the CPU resources and the "man power" to keep the libraries up to date
CI/CD builds it for testing only, it's not builds we use for distribution, as that has some more complex optimisation stuff going on that from what I know takes hours.
 
Is it already done on a VM do you know?
 
No idea. @cmb will know. I'm off to bed.
 
G'nite
 
 
6 hours later…
6:35 AM
\o
 
7:00 AM
php_curl lost content-length header on 302 redirect ・ cURL related ・ #79855
 
I'll start the vote on the nullsafe operator in 2 hours. Speak now or forever hold your peace. wiki.php.net/rfc/nullsafe_operator
 
@IluTov "As this is a language change, a 2/3 majority is required." is kind of not needed/accurate.
 
7:16 AM
@Danack Unneeded, yes. Inaccurate, how? :)
 
7:31 AM
@IluTov every change needs 2/3 majority
 
@IluTov your edge cases summarize to "you cannot take a reference of a nullsafe chain" right? i.e. $foo = &$bar?->baz; does not work either
 
@beberlei Yeah okay ^^
@bwoebi Yes, I should've also added an example like that.
 
@IluTov The following elements are considered part of the chain. Assignment (=, +=, ??=, = &, etc.) Did you intentionally include ??= in the list? ($foo?->bar ??= new MyClass)->prop; - the last ->prop should not be skipped?
ah it's all fine, brain fart
 
for() terribly poor performance ・ Performance problem ・ #79856
 
@IluTov I think you should've made a single section for it with single example saying it covers all three cases which obviously are one single :-D
@IluTov btw. nice job on the RFC :-)
 
7:38 AM
@bwoebi Yeah I'll restructure that real quick, as that isn't really a change but rather rewording that should be fine, right?
@bwoebi Thanks :)
 
cmb
@MarkR for every supported PHP minor version, there is a dedicated VM which constantly produces snapshot builds, and which is also used to produce the release builds; the latter is done manually, because the snapshot builds automation is not perfect (some errors/issues may not properly caught). The 8.0 VM already stopped producing snapshots.
 
@IluTov good job on the RFC! This is going to be nice
 
@IluTov yep
 
@beberlei Thanks!
@bwoebi Hm... Triggering that error today is actually only possible by using a function.
function foo() {}
$x = &foo();
// Notice: Only variables should be assigned by reference
Which only emits a notice :/
So for consistency $foo = &$bar->baz; should also emit a notice and return by-value.
 
You could forbid it outright in compiler
And say &$...?->... does not make sense
Same for trying to return that
 
7:52 AM
@bwoebi We could. The question is which we value more, strictness or consistency.
 
@IluTov there's very little value in having this type of edge-case error be consistent. Doing the right thing now makes fixing the other one be easier also....
 
@IluTov I see no purpose in allowing bad behavior if it can be determined by mere syntax
Only if it's a runtime behavior, it should be consistent with current behaviours.
 
Ok. I'll change it. Then passing args by ref will be the only runtime error (as we don't know at compile time if the param take references).
 
Yes, please.
 
8:14 AM
@IluTov Using the nullsafe operator with references is not allowed. - You mean taking references of a nullsafe chain is not allowed.
You're currently suggesting $myRef?->bar would be forbidden :-D
 
@bwoebi Yeah that makes more sense.
@bwoebi Nullsafe chain makes way more sense, it also makes it clear that $x = &foo($bar?->baz); is allowed.
 
minor, but is it possible to make // Error: Cannot pass parameter 1 by reference a bit more explicit and include information about the why (nullsafe op)? Not trivially right?
 
@bwoebi Probably rather trivial, but it would require another param flag (like ZEND_RETURNS_FUNCTION).
I think that's a detail that can change even after voting, right? If it's trivial enough.
 
Yes.
You could even in a minor release I guess
 
Done. wiki.php.net/rfc/nullsafe_operator So, this is a change after all, should I wait for tomorrow?
 
8:26 AM
@IluTov Yeah, would be best I think. A quick note to internals with the changes and say you intend to start the vote tomorrow. Does no harm to delay it for one day.
 
@bwoebi Cool, thanks guys! I'm glad this was changed.
 
@LeviMorrison Ass a SAVE_OPLINE() before doing the observer call
@IluTov your reference examples are missing some ?
 
@NikiC Ups, yes
Fixed, thanks!
 
@NikiC i toyed with the named parameter alias idea a little: github.com/php/php-src/commit/… need to ask martin a question about the attribute parameter api, as its not yet working, seems I have a wrong assumption in my mind as the attribute is always null.
 
Found this gem the other day wiki.php.net/rfc/nikita_popov
11
we *need* to merge Nikita's consciousness into the PHP core :)
 
8:39 AM
@beberlei This sounds like it has terribly bad performance
 
@bwoebi only if the function called with named parameter has attributes
 
@beberlei yes. I mean calling a function based on its alias
 
there is an alternative to use fbc->common.arg_names - which is used to optimize inheritance
i wanted to do it with as little code impact
@bwoebi it would be acceptable imho though, because in th ehappy path it has no performance overhead, and it would simplify the refatoring of parameter names use case
 
@beberlei I'm going to kill that part
 
@beberlei yeah probably
 
8:43 AM
ah attribute names are lower case :D got it working
 
@beberlei it would only be "unhappy" for variadics ^^
 
cleaned up working version: github.com/beberlei/php-src/commit/…
@bwoebi i think when you use named params on the call site, you (should) expect it to be slower than doing a positional call anyways
this could reduce the pressure making sure docs and stubs are in sync, and the requirement to be "done" with param renames before 8.0 release
 
9:07 AM
@bwoebi Actually, what I suggested won't work. the RETURNS_* flags are set on the return op, but I can't set an extended_value flag on an arbitrary expression... So yeah probably not so trivial.
 
So, anyone want to comment on the "Saner string to number comparisons" thread how much they want me to put that to a vote for PHP 8.0...?
 
It's not too late for 8.0? George said he'd put it up for voting on the 13th
 
@NikiC So, the sorting of an array mixing strings, numeric strings and integers will be unstable and comparison order dependent?
 
@bwoebi will it?
 
I mean, that sounds like you could do two consecutive sort() calls and get different results
 
9:20 AM
@bwoebi I don't think so, or at least I don't immediately see why that would happen
 
So, is __call the only magic method that ignores visibility or are there others? In 8.0 it seems __toString already fails
 
@pmmaga there are others as well
probably __invoke?
@bwoebi Do you have an example how that could happen?
@Derick Different RFC -- this is the comparison one ^^
 
@NikiC yeah, looks like it 3v4l.org/To5XL
 
oh
@NikiC Episode 1! phpinternals.news/1
 
@Derick yup!
 
9:35 AM
@NikiC no actually shouldn't happen - well, after a shuffle it may sort to a different order, but successive sort() calls shouldn't change it
 
9:47 AM
@Derick Needed to adjust something so will probably be tomorrow
 
9:57 AM
@NikiC again for the Non well formed notice, should ZPP throw a TypeError for that or just a warning, that's the only bit I'm debating currently
 
@Girgias TypeError I'd say
 
Okay so current patch behaviour, would make more sense in my view too
Just need to detail that specific change and the arithmetic ones in the RFC and should be good to go
 
@IluTov I grow pedantic in my old age. If a vote of 13 - 12 is a majority of 1, then a majority of 2/3 (of the voters) would be a vote of 10-2. The wording should probably be more like 'the acceptance criteria is a 2/3 vote in favour'. But as people are used to the standard wording, no actual use changing it.
 
10:33 AM
@Sjon github.com/php/php-src/commit/… This fixes the count mismatches. The exception is still there, but I think it should be until dom actually implements rewinding support.
 
Okay, @NikiC @Crell @TheodoreBrown @MátéKocsis mind giving it a read again before I update the list: wiki.php.net/rfc/saner-numeric-strings
 
@NikiC awesome, thanks. Yeah I agree wrt to rewind exception as the 3v4l link already shows it was broken anyway
 
@Crell I shared your enum analysis on Twitter, I hope that's ok :)
 
10:54 AM
@NikiC Someone approved your named param PR yesterday so you can now merge it! :D :D
 
destructor no longer called when constructor exits ・ Class/Object related ・ #79857
 
@cmb Did I read right somewhere that MS generously provided server licences for it?
 
cmb
@MarkR plus the hosting on Azure
 
@cmb Are both those withdrawn for 8.0 or could someone potentially just fund a seperate vm?
 
cmb
the latter (and if need be, we could do release builds on the PECL build machine)
the PECL build machine and the machine hosting windows.php.net are community "owned"
 
11:03 AM
Does the PECL build machine have the available horses to do it? I was just browsing azure prices but the windows licencing price is extortion.
 
cmb
PECL build machine is good for the release builds (need to free some diskspace, but that's not a real problem). Snapshot builds wouldn't be possible on that machine, since building PECL packages takes super long already (full in-tree builds).
 
I didn't know MSFT was strapped for cash.
 
@cmb How long are we talking about to build? (I'm just wondering if it's worth slapping a windows home licence on my VM at home)
 
Morgen
 
cmb
@MarkR release builds may take about 4 hours (running 4 builds mostly in parallel)
 
11:08 AM
@Derick they're moving a lot of development resources ( in the sense of people) around to things like visualstudio.microsoft.com/services/visual-studio-codespaces
 
@cmb How many cores on that?
 
@Danack Surely a single box with a single MSFT license costs them pretty much next to nothing?
 
I presume so. I assume it was the people's time that was the main thing they wanted to avoid committing to for the next x years.
 
cmb
I think2 cores. Anyway, I could roll the builds on my machine as well, but due to github.com/php/php-src/pull/5798 that would show (Microsoft Windows 10 Home)
 
Fake it
 
cmb
11:11 AM
it's also a bit about the VM pricing, I think (different divisions)
 
or perhaps revert that change?
change it to "Official PHP Server" or something weird as an override
maybe that's what the BUILD_PROVIDER is already for?
 
cmb
As is, on Windows BUILD_PROVIDER can be freely chosen, while PHP_BUILD_SYSTEM is automatically determined. Anyway, PECL build machine is good for release builds, and snapshot builds would be too much for an otherwise used machine (especially for master/PHP-8.0).
 
@Girgias My main problem is that it has occurred often enough for me to have an uninitialized value (e.g. in db) being "" (which is also what NULL values in db are converted to) - which got cast to 0 upon integer operation, which was really the wanted behavior. But this only applies to the empty string. For everything else I'm fine with that RFC. Yes, it emitted a warning which then appeared in our logs, but we could take action afterwards instead of having a non-functioning env in production.
 
I'll ask my boss if they would be interested in "sponsoring" PHP for a bit. We've got a rack full of dedicated servers going spare since I moved things over to GCloud
 
cmb
Oh, that would be great!
 
11:18 AM
@MarkR IMO, sponsoring for "a bit" is not nearly as useful as "sponsoring for the long haul".
stability is also important...
 
@bwoebi But an empty string is already a TypeError for type declarations: 3v4l.org/N9IpU
 
So, price up the costs and see whether some PHP-on-Windows users want to support a crowd funder? (And to show that MSFT is stingy)
 
@Derick Well at some point next year we'll be decommissioning those servers, but right now there's a couple of hundred vcpus going free.
 
so that means that in a year, a whole new bunch of stuff needs to be set-up.
 
I see where you're coming from but I don't know how I can make that work as an exception for I suppose would just be arithmetic ops?
 
11:20 AM
(It's lovely that you're considering this, don't get me wrong there)
 
@Girgias So var_dump(123 + "123abc") and var_dump(123 & "123abc") will remain a warning, right?
 
cmb
Still, the builds are only the tip of the iceberg. Someone needs to update dependency libs, the PHP-SDK (particularly the PGO stuff), and look after php-src for necessary Windows fixes, and also about catching up missing feature parity with Linux (preloading is still not supported; Opcache having general issues; AF_UNIX etc.) Oh, and don't forget PECL.
 
Yeah, I was just thinking that.
Are you volunteering? :-)
 
@MátéKocsis Yes, only type declarations for throw a TypeError as per Nikita's comment
Is a bit inconsistent but should ease up the migration
 
@cmb I think it's kinda inevitable than Windows will become officially second class.
 
11:27 AM
Besides anything else @cmb. Do you still have a job? :)
 
cmb
yes :)
 
Good
 
Good to hear :D
 
machines are secondary :)
 
It's easier to replace machines :P
Unless they are printers. Fuck those guys
 
11:29 AM
brrrr printers
 
@cmb What project is next for you then?
 
@Girgias Sounds ok! Although I don't remember if Nikita said anything about the arithmetic case. But anyway, I'll surely vote yes about this
 
Reminds me when I worked at Suez and the printers decided to stop the batch print at 560 pages, so much wasted paper so that IT could fix it D:
 
cmb
@Derick PHP 7 on Windows
 
"Legacy code"
:-)
 
11:31 AM
Hi there, I was wondering about something: with static analysers becoming more and more popular, do you think an option to disable runtime type checks would be an interesting area to explore? I'm not even sure if it would actually make that much a difference performance wise, but that sounds like something that could be benchmarked
 
@cmb So you're not allowed to improve/fix stuff for PHP 8?
 
cmb
I'm also maintaining PHP 5.6.40 :)
 
@MátéKocsis I hope so, I don't want anyone to go through this insanity once again
 
I'm sorry
 
@BrentRoose No. A million no.
 
cmb
11:31 AM
@MátéKocsis nope (not during working hours)
 
@MarkR sure, but why?
 
@cmb That's a bit sad :(
 
@cmb Do you have spare time, and want to use that for PHP 8 on Windows?
 
@BrentRoose Python and JS has massive issues because they don't have enough run time checks, static analysis is great but it doesn't replace a proper engine run-time check
 
(Feel free to say no, I'm not trying to guilt you into doing anything) —- would just like to know where it stands
 
11:33 AM
@BrentRoose Because static analysers are only part of the equation, being entirely based on what they're told things will be like, thus any situation in which things aren't what they're told they'll be like would bring about potentially countless unintended interactions.
 
When I implode a sorted array it's being non-sorted. Why?
 
You are doing it wrong
Try to repro it on 3v4l
 
@X4748-IR It's expected, imploding will make it a string.
 
cmb
@Derick already doing that
 
Is it enough time?
 
11:37 AM
You mean I can't use implode function?
 
11:49 AM
@Girgias yeah, for functions, but this never happened to be a problem for me. The primary case is really with integer operations and comparisons.
There is sort of that distinction between "does mostly what was intended" and "this is often enough really bad to continue here"
and for my use cases the "" -> 0 implicit conversion is really shifted to "does mostly what was intended"
At least for me that's quite a deal breaker :-/
 
12:06 PM
Down with implicit conversions! \o/
 
@BrentRoose Not in the engine, but I am quite interested in anyone doing that in userland, using something like rector to do it.
 
@Danack that would be a way to test the performance easily without engine changes
 
@beberlei and for things like symfony, that effectively have a compile step as part of their deployment process it could be seamless to their end-users.
 
@Danack symfony is tricky tough, some features use Reflection to inject arguments into controllers bsaed on the declared type, that would require these to stay
 
@bwoebi Comparisons aren't affected. The thing is that 10 + "string" doesn't make any sense, sure maybe the empty string case is valid, but that seems to showcase an issue in PHP's DB drivers that it can't handle native NULLs instead of being a case of usefulness
If its not from a DB and you are doing arithmetic with it it should IMHO be 0 as a default value
 
12:21 PM
My problem is solved! I had forgotten something.
 
Good Morning!
 
Bore da!
 
12:37 PM
@Girgias I know they aren't. Just saying that changing behavior of either is a no-go for me for "". And yes, while that's certainly annoying with PHPs DB drivers, we shall not break very common situations like these arbitrarily.
Fully agree on 10 + "string" - but I'd really love to see "" special cased here :x
(which other people probably won't like either… but yea)
 
@bwoebi that's the main issue, not sure most people would agree about this :-/
 
12:54 PM
@Girgias "Unify the various numeric string modes into a single concept: Numeric characters only with both leading and trailing white-spaces allowed. And throw TypeErrors when non-numeric strings are used in a numeric context." - That's a sentence fragment.
 
@Girgias Overall looks good. I think there should be some guidance about the second vote, though. Why is it being held? Is one approach simpler to implement than the other? Does one perform better than the other?
 
"One exception to this are type declarations as they only accept proper numeric strings, thus some E_NOTICE will result in a TypeError, see below for an example. " - Comma splice. "See below" should begin a new sentence.
 
@LeviMorrison I downloaded some "guide" from DatadogHQ and now a person contacted me apologizing for not replying to my demo request earlier due to vacation and that we can do it immediately. I didn't request any demo :D
Unrelated, Far Cry 6 looks amaze.
 
@Girgias Overall improved, but without the tables there's still no at-a-glance way to see the before/after impact, or to verify that there's no additional weirdness in the overall end result. Those would be my only pushback on content.
 
1:21 PM
@DejanMarjanović Yeah it does! But I wanted to see him throw it.
 
@StatikStasis I made Cuba Libre after watching that :D
 
1:42 PM
@Ocramius have you just discovered Regular Ordinary Swedish Meal Time?
(in Swenglish)
 
@Tiffany aaaaaages ago. Just happened to get a lot of "<DAY> with Mr. Fox" suggestions by YT lately
MAYONNAISE! Is good for you.
 
IntlDateTimeFormatter spec does not match PHP ・ Date/time related ・ #79858
 
@Ocramius have you seen the newer-ish episodes (from a few years ago now), where they use axes to chop ingredients? :D
 
Most certainly, but it's probably been deleted by Felix Colgrave's stuff
or Cyriak
 
:(
Noooooo
MR. FOX!!!!!!!
 
1:55 PM
too bad they just stopped
 
Yeah :( they ran out of kitchens
 
@Crell The problem with a table is that it becomes massive and I don't think it's that helpful, I'm also pretty sure I've covered everything now, as before I didn't put bitwise stuff in the table as I didn't think about it so it still has the issue of forgetting stuff
@TheodoreBrown Mostly adding some boilerplate code in core
 
It's more about convincing others that the end result has no weirdness in it, not convincing yourself. :-)
 
@Tiffany Plenty of those in IKEA :D
 
@Crell So how should these sentence read?
 
1:59 PM
For the first: "Unify the various numeric string modes into a single concept: Numeric characters only with both leading and trailing white-spaces allowed. Any other type of string is non-numeric and will throw TypeErrors when used in a numeric context."
For the second, just change the last comma to a period.
 
Okay :)
 
2:32 PM
@DejanMarjanović at one point, they were using friends' kitchens, and they ran out of places they could do it at, because their friends didn't want them destroying their kitchens (though they cleaned up after themselves, but they did make quite a mess)
 
My kitchen looks like that every 2nd day :D Yeah... well... similar but without actual destroying: youtu.be/YO7AdLsUSec?t=59
 
@Girgias Okay. I think there needs to be some kind of guidance in the RFC about upsides/downsides of the alternative or people won't know how to vote on it.
As I learned from my last RFC, people tend not to read the implementation before voting. :(
 
@TheodoreBrown Well mostly it's going to be that $str["14.5"] would throw a "Illegal offset" TypeError but $str[14.5] would still work
 
user image
7
another week of marketing campaigns ...
 
2:47 PM
@JoeWatkins what is he promoting this time?
 
@NikiC Would you be willing to do an analysis on top packagist repositories looking for assert usage?
 
some crappy language
 
@JoeWatkins PHP or some shit?
 
_Nikita Popov with PHP following up_
Hey Joe {{ lastName }},
 
@Girgias Personally I think it's fine for the string to produce a different error than the float, especially if it keeps the implementation simpler and more consistent.
 
2:50 PM
@DejanMarjanović Hey {{ firstName }} {{ lastName }}
 
@TheodoreBrown Yeah that's what I think too, question is do others think that, I'm just cleaning up the commits and I will link to the commit so that people can see what is changed
 
@LeviMorrison To determine what?
 
@NikiC How much it's even present.
Can't see what their ini settings are.
 
Array with null is true ・ *General Issues ・ #79859
Misoptimization under preloading ・ opcache ・ #79860
 
@LeviMorrison Well, here's a grep, if it's useful for anything: gist.github.com/nikic/8311ee63c72573d514217456bf2df552
 
3:08 PM
Thanks.
 
3:21 PM
@Girgias I tweaked the wording in the paragraph about the secondary vote to hopefully make it clearer and document our position. Let me know if it looks okay.
 
@TheodoreBrown Will do
 
@cmb Is it normal for CTRL+C to not work on Windows 10 to end the execution of PHP CLI's built-in webserver?
 
@SebastianBergmann no, but it may be nothing to do with PHP. The signal traps cascade throughout processes attached to a console, it's possible that something else you have done in that console (or a program you invoked within PHP) has done something that's changed the signal handler routines
 
Will this work if $data is multidimnsional array or do I have to use it recursive.
array_map("utf8_encode", $data )
 
iirc there was a userland function added recently to register a userland callback but idk if it works in the CLI server, probably not
 
3:29 PM
@DaveRandom Ok, thanks. I'm at a client where the developers have Windows 10 on their laptops and open a remote connection to another Windows 10 machine and from there to another Windows 10 machine where, finally!, PHP is run. So somewhere along the way CTRL+C gets lost. Thanks!
 
@SebastianBergmann when you say "remote connection" do you mean like remote desktop? if so there's a reasonable chance the ctrl+c event is being intercepted by some clipboard magic and doesn't even make it as far as the console
 
@luffy its not recursive by dfeault
 
it's also worth noting that in most case ctrl+break will perform the same action as ctrl+c @SebastianBergmann
so that might be a worekaround
 
@beberlei Will this do the trick or should I better use array_walk_recursive
public static function arrayMapRecursive($callback, $array)
{
$func = function ($item) use (&$func, &$callback) {
return is_array($item) ? array_map($func, $item) : call_user_func($callback, $item);
};

return array_map($func, $array);
}
 
@luffy That's not actually recursive; it won't handle array of array of array of array.
 
3:40 PM
@Crell I had a feeling about that. How about doing it this way:
public function utf8_converter($array)
    {
        array_walk_recursive($array, function(&$item, $key){
            if(!mb_detect_encoding($item, 'utf-8', true)){
                $item = utf8_encode($item);
            }
        });

        return $array;
    }
 
Detecting encoding of a string is not possible in a safe way.
and utf8_encode is a stupid function, that doesn't randomly convert everything to utf8
it only does iso8859-1 to utf8
 
sigh
Another victim of utf8_stupid
 
BUT at least you can json_decode(json_encode($str, JSON_THROW_ON_ERROR), true, 1, JSON_THROW_ON_ERROR) and decide to reject it upfront :D
 
@Derick what is a better option than utf8_encode
 
@luffy requiring strings to be in the correct encoding upfront
 
3:45 PM
The better option is knowing for sure what your original encoding is. You Can Never Guess It.
 
Hello all
 
@Derick It is an api we get errors like the format is not in utf8
@Ocramius ok thanks
 
We don't like spam in here
 
@Derick Besides utf8_encode wil the script work for nested arrays?
 
Did you test it?
 
3:57 PM
I am about to do that, but my question is more is there a better way than array_walk_recursive. I though doing it with arrya_map but I will have to built scipt doing it recursively
 
@TheodoreBrown Forgot to say it, but yeah it sounds better, thanks for that :)
 
4:44 PM
@luffy For the generic case:

function arrayMapRecursive($fcallback, $arr) {
$fn = fn($item) => return is_array($item) ? arrayMapRecursive($callback, $item) : $callback($item);
return array_map($fn, $arr);
}
 
what did you just puke out? ;-)
 
Is there not a ZPP macro/arg type for callable? can't seem to find it
 
5:02 PM
I don't think so, no
 
5:14 PM
f and Z_PARAM_FUNC?
Is there a function to turn an fci+fcc pair into a Closure? Not seeing anything in zend_closures.h but it could be elsewhere if it exists.
 
@LeviMorrison see Closure::fromCallback implementation maybe?
 
Good idea.
It just parses it as a zval and manually verifies it. Bummer.
 
6:09 PM
Oh wait, correction, the first return isn't needed in that code sample.
 
6:50 PM
jellow
 
Wes
@MarkR why is @@ bad?
 
@Wes IMO by nature of it having only an opening tag, and no closing tag, directly before items which are themselves inline, it's asking for trouble.
I also think it looks f'ugly, but that's besides the point.
 
@LeviMorrison you can fetch the original zval from fci.function_name (don't know if you know that)
 
Wes
but #[Attr] also has a very generic closing tag, which is basically the same as not having one
 
@Girgias It's the original zval, not an extracted name or null or something?
Seems weirdly named.
 
7:00 PM
@LeviMorrison It is the original zval, but yeah the name is weird
I spent a bunch of time playing with callables/fci/fcc
 
I did not know this. Thanks!
 
:D
 
7:20 PM
I'm sorry if this is a really dumb question but I can't wrap my head around result operand in VM. Given that PHP doesn't use a tree-walking interpreter but a proper bytecode VM, how do OPcodes share result/point to the same result var?
let's say we have "echo 2 + 2;" (no optimizations), first we do ADD op so for the sake of simplicity, op.result = op.op1 + op.op2
but how does ECHO instruction's op1 operand point to the prior instruction's result operand?
(I hope it makes sense what I'm asking, tell me if clarification is needed)
 
@NikiC There is a LOAD_OPLINE_EX() right after it; should I move the observer stuff to right after that macro? There is a SAVE_OPLINE() macro at the start of the handler already.
 
Wes
@moliata if i recall correctly, it uses temporary variables or something like that. not sure about the proper naming, so it's like
ADD ~234234 2, 2
ECHO ~234234
where 234234 is the id of a temporary variable
 
7:36 PM
bug found in php 5.3, 5.4. 7.0, 7.1, 7.2 ・ Unknown/Other Function ・ #79861
 
Wes
is that what you are asking?
 
@Wes yup, asking for exactly that, thanks!
 
@LeviMorrison yeah, after load_opline_ex probably
 
@Wes I suppose after e. g. ADD instruction, the result operand is pushed onto the stack frame and then that value is popped from the stack frame into ECHO instruction's op.op1?
 
@moliata PHP uses a register machine, not a stack machine
 
Wes
7:44 PM
keep in mind i know nothing. if i had to guess, tho, that id is generated at parsing time
it's probably just incremental. nothing fancy, right?
 
@NikiC Just finished rebuilding and testing; seems to work. Thanks!
 
Wes
yeah it must be like that, obviously. but that's not what you were asking. so nvm
 
@NikiC based on your php 7 vm blog post, CVs/TMPVARs are stored in a stack frame
...and as I understand ADD instructions puts the result into a TMPVAR
which should be then pushed to the stack frame? I'm really confused here
 
@moliata Stack = call stack
only calls push / pop the stack
 
Oh, but where are TMPVARs stored then?
 
7:57 PM
The tmpvars are all pushed in a block when a call is made and popped when a call is over. They are still on the call stack, but not pushed/popped individually like a stack machine does.
 
8:09 PM
@LeviMorrison ahhh, now makes much more sense
 
 
1 hour later…
9:10 PM
1 hour later...
 
1 minute later...
 
36 seconds later...
 
An arbitrary number of osculations of a pendulum later...
 
1 @PeeHaa's mom later...
I'm starting to think we might have pushed USB too far, we've now reached a point where the power rating of my PSU (720W) has been exceeded by the total power output of mys USB chargers/hubs etc (now 810W)
...and yet I still do not own a thing which can provide USB3 transfer speeds and fast charge power at the same time
 
9:30 PM
Favourite track of the moment youtube.com/watch?v=yzLT6_TQmq8
/cc @StatikStasis ^
 
eugh now I remember why im a software engineer and not a network engineer, 10 minutes and 4 attempts to terminate a single network cable
 
uh, hi o/
:-P
you ever want any assistance with that shit shout me, I do a 568/A termination in my sleep
B costs extra
swapping green and orange round is expensive yo
 
9:46 PM
foreach ([1, 2, 3] as $foo->bar) {
    var_dump($foo->bar);
}
Never knew that worked xD
 
... that works? wtf is it meant to be
 
@MarkR It just assigns the value to the given property 🤷‍♂️
 
the rhs of a foreach is just an assignment on the wrong side
(I think, since PHP7)
 
So now I gotta think about this too -.-
foreach ([1, 2, 3] as $foo?->bar) {}
 
that's how vector foreach variables work as well, in theory anything that's valid as the lhs of an assignment is valid as the rhs of foreach
 
9:49 PM
what the hell is that supposed to do??
 
@IluTov the same thing that $foo?->bar = [1, 2, 3][0]; would do
i.e. an error
foreach is just syntactic sugar for a loop with an assignment at the top
 
@DaveRandom It usually skips the assignment...
 
the behaviour of the variable is identical to a normal assignment
 
Which would be super weird in this case
 
@IluTov right, it's an illogical instruction, it should be an error
well, it should be consistent with the non-sugary version
 
9:51 PM
@DaveRandom Cool, more edge cases :D
 
idk if it is
while (<expr> = each($thing))
that's what foreach is, basically
so anything that's valid as <expr> should be valid as a foreach var
and the behaviour should be the same
 
@IluTov Oh, whew. I thought it was a way around engine kicking creating objects from nulls up to exceptions.
 
ftr I don't think $foo?->bar; = $baz makes sense in any context, you can't assign to a possibly-non-existent container
 
@IluTov You're making me wonder if assignment to nullsafe shouldn't be forbidden outright...
 
null propagation is a read-only behavior
 
9:54 PM
@DaveRandom Yeah that does make sense. I have no idea how this would behave with the current implementation to be honest...
 
imho
@NikiC yes
it's a logically ambiguous operation
 
And given that you already made the reference case an error...
 
@NikiC Great... xD
 
the behaviour of $foo?->bar = $baz; is fairly obvious I suppose, but the behaviour of the implied $foo?['bar'] = $baz; is less so (again imho)
but more generally "only assign this result if the container exists" is a horrible thing to want
especially when the existence of the container is determined by the operation, so you can't short circuit
 
@IluTov Other random thought: How would you feel about separating simple/primitive enums from ADT enums, syntactically? (I don't have anything specific in mind, I'm just musing in my head if that would result in less mental complexity for users.)
 
9:58 PM
@DaveRandom I don't understand that statement.
 
Oh, you're already discussing something else, never mind. :-)
 
@Crell I think of ADTs as supersets of enums, making them separate would be pointless IMO.
 
00:00 - 22:0022:00 - 00:00

« first day (3559 days earlier)      last day (1372 days later) »