« first day (3677 days earlier)      last day (1257 days later) » 
00:00 - 23:0023:00 - 00:00

12:02 AM
Sorry, I have to share this, just the dumbfounded look on this guy's face. twitter.com/GorillaMamaWho/status/1324180525456777216
 
Wes
cannot start debug session with xdebug 3 beta blah blah
damn u phpstorm
 
OPCache wasted memory grows rapidly and no restart after max_wasted_percentage ・ opcache ・ #80341
 
Wes
profiler works, so it's phpstorm
 
12:32 AM
@Trowski Are you by chance here and can tell me how I can get the type of socket? (having an \Amp\Socket and mysql requires me to treat unix sockets differently)
I do probably have to assert that it's a ResourceSocket and then compare the metadata of raw socket resource?? boooo…
I guess for now I will just check the ConnectionConfig because that's less hacky … sort of :-(
 
1:20 AM
@Wes It's probably the change in port, it's 9003 by default now in Xdebug 3.
 
Wes
i did change the port yep, no luck
 
try xdebug_info() or the log file then - I've been using Xdebug 3 with PhpStorm for the whole last week
 
PhpStorm version related?
 
Wes
__   __   _      _
\ \ / /  | |    | |
 \ V / __| | ___| |__  _   _  __ _
  > < / _` |/ _ \ '_ \| | | |/ _` |
 / . \ (_| |  __/ |_) | |_| | (_| |
/_/ \_\__,_|\___|_.__/ \__,_|\__, |
                              __/ |
                             |___/
:D
should i look for something in particular?
this is the error i get
if i validate, i get this
 
1:42 AM
@Wes this >.< in the middle of the X is no coincidence, right? :-P
 
Wes
:D
 
 
1 hour later…
2:51 AM
$fibonacci = function (int $n) use (&$fibonacci) {
    if ($n === 0) return 0;
    if ($n === 1) return 1;
    return $fibonacci($n-1) + $fibonacci($n-2);
};

echo  $fibonacci(8);
I dislike the use (&$fibonacci) bit. Anyone have a gut reaction to why:
$fibonacci = function (int $n) {
    if ($n === 0) return 0;
    if ($n === 1) return 1;
    return $lambda(n-1) + $lambda(n-2);
}
shouldn't be a thing? i.e. like the magic binding of $this, make $lambda refer to the currently running closure, or error if it's used outside of one.
 
I feel like there's a reason that I'm missing and that this is a silly question, but I'm going to ask it anyway. Why couldn't you use $fibonacci instead of $lambda?
 
Which is far too astonishing to be good.
 
I mean without a reference, but I see now even with the correct syntax, it errors :/
 
Because $fibonacci is null as it's passed in, it's only set to be the closure after the closure is created, so it's null/unset inside the function, if it isn't passed in by reference.
 
3:07 AM
I keep getting this error when i try to preload a Cli class php 8.0 fpm buster
PHP Fatal error:  Undefined constant "STDOUT" in Unknown on line 0
 
@Danack makes sense but still :(
 
@Ghostff have you googled that error message?
 
yeah but nothing really came up. I also tried to define STDOUT even though it works on cli but still.
 
@Ghostff Send me a screenshot of the top results you get for "PHP Fatal error: Undefined constant "STDOUT""
 
3:14 AM
@Ghostff you're preloading in a web environment right?
> fpm
yeah. Just click the top link and read it.
 
I tried that already.
 
You've tried doing what this answer suggests to do? What happened, and are you 100% sure the code you modified is being used?
 
This is what the preload file looks like https://gist.github.com/Ghostff/ce7815179637e8c8b8b7d6cac6d5d0dd
After that and i run `php -i | grep 'opcache'` Then I get the `STDOUT` error
 
put the following under those lines:
$data = "got here\n";
$data .= "STDIN is: ";
$data .= var_export(STDIN, true);
$data .= "\nfin\n";
file_put_contents("debug.txt", $data);
and see if that is written.
I have a strong suspicion that the change just hasn't been applied, e.g. your PHP is using a cached version of that file, or something else weird...
:50884091 you need to use functions....put all the code in a function, then use that function on other pages.
> I generally do not like Stack Exchange (too many copy-pasters, weenies, and rep whores).
a bold attitude.
 
3:30 AM
haha thank you
oh your post was an answr to my question thank you so much!
i wan to figure out how to turn that int js now.
 
@Ghostff you could also just use 'php://stdout' instead of STDOUT, or report it as a bug if it's in a library you don't control.
 
4:30 AM
@Wes Change the port from 9000 to 9003.
@bwoebi You can probably change the type hint to ResourceSocket.
 
> hint
ಠ_ಠ
 
Sorry, type pronouncement.
Type postulation?
Type averment?
 
just 'type'? as in parameter type, return type and property type.
the reason I care about it is that in other languages the types are just hints, rather than run-time enforced.
 
@bwoebi Yes… I guess you'll have inspect the meta data. Suppose we could add a getMetadata() method to Socket just to make that less painful.
@Danack Fair enough. Old habits die hard.
For you though, I'll try to do better.
 
ta. any instant thoughts on why $lambda as a magic thing inside closures would be bad?
 
4:40 AM
Also @Wes, I see bwoebi told you 9003. No idea then, that fixed it for me.
I compiled from xdebug master, so maybe try that.
@Danack Nothing immediately springs to mind.
Sounds nice to avoid the circular reference.
 
yeah, and removes one of the blocking reasons for not being able to remove references...
 
We use references frequently in Amp to avoid circular references. It would be nice to have a solution to that before removing them entirely.
Thinking about it, another object storing state could solve that.
 
Have you looked at using WeakMap for that? Sounds similar, though it might not be the same thing.
 
Usually it's to capture an object property in a closure without a reference to $this.
 
hmm, maybe need to wait until streams are objects not resources then...though also, nn...
 
4:53 AM
@Danack Another object with those two properties shared by the original object and the closure would solve the problem too.
 
 
2 hours later…
6:39 AM
Good morning.
 
7:14 AM
morns
 
@NikiC There is a date.timezone in my php.ini - where did you find a default timezone issue on 3v4l?
 
Hello every one
can any one please help?
I have an issue regarding authorize.net cim integration
While trying to create $create_profile_response = self::$cim_request->createCustomerPaymentProfile( $profile_id, $paymentProfile ); getting null xml response from Authorize api
like this:- object(AuthorizeNetCIM_Response)#1114 (2) { ["xml"]=> NULL ["response"]=> bool(false) }
can anyone suggest whats am doing wrong?
 
7:30 AM
Hi @bondjames No much people using WP here. Have you tried with some plugin maybe (to check if response is correct that way)?
 
am getting the $profile_id & $paymentProfile perfectly.
can anyone help or suggest which room to discuss the things will be perfect will be helpful, ty :)
 
@bondjames Beside SO, there is dedicated site for WP, you can check there maybe.
 
thanks :)
 
8:19 AM
@Sjon I was just surprised that it did not use UTC by default
 
@NikiC ah, yeah I configured Europe/Amsterdam :)
 
8:35 AM
@Sjon by the way, any reason why openssl is not available on 3v4l?
 
8:48 AM
@NikiC not sure, maybe the dependency on libssl.so.1.1 caused issues. Would you like to have it added?
 
9:25 AM
@Trowski yeah, and let's use the interface…
 
9:37 AM
@cmb Any idea about bugs.php.net/bug.php?id=80333?
 
cmb
@NikiC not really; could be a TS issue, but could be some issue with other processes started from PHP. Strange is that it apparently happened with RC1 on normal CMD, but that had been resolved. I never worked with ConEmu.
 
@Sjon I've tried using it occasionally, but it's not really important...
@Sjon On an unrelated now, are you still seeing that GC assertion failure on PHP 8?
 
@NikiC I'm gonna test with rc3 today and let you know
 
10:16 AM
@NikiC seems they are fixed in rc2 so that's good. No issues with opcache enabled
 
nice
 
@Trowski github.com/trowski/fiber-rfc/blob/master/rfc.md#defer-keyword uhm, defer() is executed in the next tick… at least "scope exit" sounds much like fiber finished, which it isn't
 
Hi guys
How do I zip an entire folder with its subfolders and files?
I have this:

$source = <absolute pathname to directory/file to be zipped> . DIRECTORY_SEPARATOR;
$fileName = "myfiles.zip";
$destination = <absolute pathname to destination directory> . DIRECTORY_SEPARATOR . $fileName;

function zip_files( $source, $destination )
{
$zip = new ZipArchive();
if($zip->open($destination, ZIPARCHIVE::CREATE) === true) {
$source = realpath($source);
if(is_dir($source)) {
$iterator = new RecursiveDirectoryIterator($source);
 
 
2 hours later…
12:36 PM
morning room
 
@useragent It's unreadable in chat. Check some answers from here.
 
is_resource returns false ・ *General Issues ・ #80342
 
12:57 PM
Morning, everyone!
 
morns
 
o/
 
Wes
does typescript have recursive and variadic generics?
ie
null|bool|int|float|string|array<int|string, *recurse*>
null|bool|int|float|string|array<int|string,
    null|bool|int|float|string|array<int|string,
        null|bool|int|float|string|array<int|string, *recurse*>
    >
>
scalar|array<scalar|array<scalar|array<scalar|array<scalar>>>>
this is a 4 depth max, for example. cannot allow arbitrary depths
for variadic type variables, think of closures
interface Closure<ThrowType : Throwable, ReturnType : mixed, ...ArgType : mixed>
generics are hard
 
1:36 PM
Wait, the doc-csv mailing list is working again now? :o
 
hey guys any way to do this?

I have $address which may be null, but also could have $address->phone, is there way to make this shorter?

isset($address->phone) && $address->phone ? $address->phone : $user->phone

I guess $address->phone ?? $user->phone resolves just the isset without the truthy
 
cmb
2:09 PM
As of PHP 8.0.0, you could use $address?->phone, see wiki.php.net/rfc/nullsafe_operator.
 
2:20 PM
@Wes like type Recursive<T> = T|T[]|[Recursive<T>[]]; and variadics like const fun = (...args: Recursive<number>[]): void => { ... }?
 
Wes
oh, nice
 
uhm type Recursive<T> = T|T[]|Recursive<T>[]|[Recursive<T>[]];, see test
or.. type Recursive<T> = T|T[]|Recursive<T>[]; cough.. which is not redundant
 
@Martin. $address->phone ?? $user->phone will give you slightly different behaviour than the previous example - if $address->phone is 0, or false, or an empty string it'll return that, whereas the previous example wouldn't
 
2:36 PM
@Girgias Commit emails from SVN should be working again, as of a few hours ago. Let me know if you see any further problems.
 
@salathe Well I got the one for my commit to the English docs
Will probably check French doc tonight by updating them
 
@Stephen I know, that's what I said. I just wanted to polish the second example to work the same as the first
@cmb nice!
@cmb So that would be basically $address?->phone ?: $user->phone
 
cmb
I think so
 
@Martin. if you want it to work the same, and can't wait for 8, you could use (slightly convoluted) : ($address->phone ?? null) ?: $user->phone
personally I'd probably opt to instead have a filter somewhere earlier that ensures $address->phone is either a usable value or null, so you could just use ??
 
2:53 PM
a.k.a. have a sane data model :)
 
@PeeHaa yeah, that.
 
@PeeHaa Have a better way to model an order that can have user address overridable by address? Or what is the point?
 
I didn't read the entire convo sorry. Was just reading what Stephpen said
 
3:10 PM
@Martin. "is there way to make this shorter?" You mispelled "easier to read" a strange typo.
 
@Martin. I wasn't suggesting (and I doubt @PeeHaa was) that fetching phone from either one object if it's available, or falling back to a different object is wrong - we were referring to having stricter control over the values allowed in the property you're fetching
ie right now you're relying on it doing a truthiness check
if you know boolean false or an empty string are not valid values, your data model (whatever defines the shape of $address) should prevent those invalid values
or more specifically, it should only allow valid values
 
@cmb I saw that github.com/php/php-src/commit/… includes a changelog entry for 7.3.25. Is it safe to assume that this is also going to be in 7.4.13 (the commit was merged to PHP-7.4 already). Just checking so I can preemptively add the correct checks in our config.w32 :)
 
cmb
@alcaeus yes, will be in 7.4.13 as well (unless it gets reverted; consider to wait for 7.3.25RC1 and 7.4.13RC1 being released on Thursday).
 
attempt to connect to Unix domain socket /var/run/php-fpm.sock (*) failed ・ FPM related ・ #80343
 
3:29 PM
@cmb sounds good, thank you!
 
mysqlnd support for SASL SCRAM-SHA-1 and SCRAM-SHA-256 authentication ・ MySQL related ・ #80344
 
@Derick When did we stop using mirrors for php.net ? It was in the past 2 years, wasn't it?
 
@Sara couple months ago
 
@cmb if you're bored and want to confirm I didn't mess up, feel free to check out github.com/mongodb/mongo-php-driver/pull/1178. I'll test the logic once RCs are available and merge afterwards.
 
3:43 PM
@Sara Last year in May iirc
oh well not that far off
 
Year and a half or so, that's what I thought.
 
Dayum time flies
 
3:58 PM
@bwoebi I was trying to use terminology that most people would understand, as "next tick" likely doesn't make sense to many. "Scope exit" is wrong too, yes, since it will run when the fiber is suspended. "After the fiber suspends or finishes execution" is better I think.
@bwoebi Have you had a chance to use ext-fiber + Amp v3?
 
That should have an NSFW tag (⊙_◎)
 
it's knitting, it's not exactly pr0n
 
:p
 
4:47 PM
@Sara Jan 2019
 
@Tiffany You should be glad it he posted only a picture of his pots wearing them.
4
 
He's right you know, if you're not careful I'll put them on the handles of umbrellas in the hall. Then you'll be sorry.
 
5:03 PM
@Wes I genuinely lol'd
 
Wes
:D
 
@Tiffany Glad I saw this before clicking. =D
 
@MateKocsis Wherefore you dislike asymmetric visibility? Do you have a better alternative?
 
5:20 PM
So, whats wrong with IRC?
speaking ... anyone really done anything serious with PHP/LLVM except ircmaxell?
just curious
 
Wes
@DaveRandom the tragedy is, despite he is being ridiculed, he's still leaving the tweet, because knows a lot of people are going to fall for that too
 
@IluTov There's guaranteed to be a lot of questions around objects of different types, and when/how/if they can be identical. And if the order matters. Typing confusion is what killed the previous operator overloading RFC, IIRC.

Basically, I don't see it having any chance, unless it's clearly a precursor to enums, which we have not formally announced. And if we want to present it that way, we probably need to sort out what all the other precursors are going to be so that people can see a roadmap. I don't think we fully have that yet.
 
@Wes What's most surprising about that for me is that Georgia only has 3.7 million people. I would have guessed more.
The rest of it is, disappointingly, not surprising at all.
 
The south is pretty sparse, kinda like the west.
except Flordia. Florida isn't south, weirdly.
 
^ Missed the joke.
 
Wes
5:24 PM
@Trowski population density is not low though. it's just a small state
 
I don't keep up with politics if its something to do with the US election...
So wait, enums?
 
@Wes Yeah, I looked quick, it's a little less than half the size of the state of Georgia.
@A.B.Carroll The person in the tweet confused the country of Georgia with the state of Georgia.
 
ha
sorry
 
@A.B.Carroll Ilija and I are working on it. It's tricksy.
 
Why is it trucksy?
 
5:27 PM
Tricksy. Tricky. It's Hard(tm). Lots of little details that need to line up, and they don't want to line up.
 
I'm just curious - not sure who llija is, but I've designed them before using PHP's VM
 
Ilija == @IluTov.
 
k, what i'm doing and why i'm here... I've been designing a language for the better part of a year to work as a php backend of sorts... just curious if anyone has ever done anything similar ... I know for damn sure no one has built an engine like this one except like maybe LLVM people but it works vastly different... I'm active on IRC, but never knew these gh chats, so thought I'd drop in ...
 
See the 3rd pinned item on the right for the current RFC draft and research. That's where we are.
 
@Crell hmm. pinned items have different order for different people maybe. 2nd pinned message for me.
 
5:29 PM
basically what i'm doing here, is instead of trying to transpile like an idiot, this thing takes an input and puts it in a common IR of sorts which I'm ultimately then .. "transpiling"? compiling? whatver.. directly to PHP VM Opcode .. takes a C ext for php .. ultimately hoping to transpile compile whatever to LLVM IR and Python VM IR eventually .. i know that's a little OT because I guess technically it's not PHP but it's basically php ... it's like php with types ..
 
Hm, you're right, 2nd pinned item. I misread.
 
also, shakespearean english might not be the best language to use to resolve differences of opinion.
 
Tricksy isn't Shakespeare. It's from Gollum. :-)
 
current proposal looks okay
don't like the swifty syntax
but semantics are nice
 
Which part is Swifty? It's kind of halfway between Swift, Kotlin, and Rust. Ish.
The semantics are part of what is still being worked out. Mainly the primitive handling is still up in the air, the "this method only works in some cases" bit is still fiddly to me, and there's still a lot of questions about equality, caching, etc. Hence the PR above about making === overrideable. And we're still not settled on what match() does with enums.
 
5:35 PM
I would expect them to work in a strict equality and if the struct like variants are allowed then work like rust
I mean
 
But would Maybe::Some(42) == Maybe::Some(42)? Would it ===? And what are the knock on effects of either answer?
 
hah i see the dilemma with types now
right
 
The primitive handling is also still not fully settled.
 
I mean honestly, my implementation was WAY simple.. they were not objects, they were more akin to C enums than object references ... that is the only way I could ever personally reconcile it
my constraints are even less than yours
 
Right, the research document goes into that in more detail.
 
5:39 PM
@A.B.Carroll Well, I know someone is working on a Graal implementation for PHP
 
Booooo Graal.. :/
Beautiful VM but it's just rather encumbered with licensing
 
Basically, we could do over-engineered constants, or over-engineered objects. The latter gives us far more flexibility, power, and scalability, and still supports all/most of the use cases of the former. So that's the route we want to go.
 
I shouldn't talk sh*t
 
@Wes not convinced it isn't a deliberate troll in the first place tbh
@A.B.Carroll you will stand alone atop a mountain of virtue, if you manage to accomplish that
 
@Crell 'wherefore'.
though it is a perfectly cromulent word.
@A.B.Carroll the ability to link replies to previous messages, makes it reasonably easy for people to have conversations with multiple hour gaps between messages, and for other people to track that conversation back through clicking the little arrow.
Also, easier to post memes here...
 
5:47 PM
@Danack I almost never use that thing because it requires too much work.
 
@Danack TIL. Sorry. used to IRC.
 
ftr that isn't (yet) something you need to apologise for
I'm sure it's only a matter of time
 
SO chat does some things slightly better than Slack, reply threads is nice
edit history is nice too
 
that needs RO privs
 
edit history does not, delete history does
 
5:54 PM
oh right
that makes more sense
 
@A.B.Carroll I was going to make some t-shirts:
 
@Tiffany yeh but I have RO privs so I can't check whether that works without them :-P
 
user image
7
 
iirc some of it is rep based as well, like the main site
or it might just be the 20-rep-to-talk rule
@Danack actually lmao
 
5:57 PM
@DaveRandom tempting to remove you just so you can see that it works, then add you back, but that's probably a bit excessive :P
 
yeh I'm good :-P
 
@Trowski depending on mysql :-) But will try to finish that soon … the docs on that are spectacularly unhelpful
 
@Tiffany yeah, don't. fyi room owners kicking each other triggers a site wide ping for mods.
 
the secure channel auth works (i.e. unix socket, tls) … but insecure not yet @Trowski
 
Who would even do such a thing?
 
5:58 PM
unless you do it for the lulz
 
@PeeHaa cough
 
@Danack so, the trick is to remove somebody as RO and then kick?
 
loopholes
 
@Danack Heyyyy there is IRCv3 ... coming along about as well as you'd expect ;)
 
@bwoebi I noticed the docs were rather lacking. Being unfamiliar with the protocol it appeared pretty hopeless for me to upgrade it without spending an enormous amount of time.
 
6:02 PM
@Trowski What I did: looking at the C impl in php-src of that auth and checking the hexdump of the communication of the oracle mysql client with mysql server
 
@bwoebi That sounds tedious, lol
Thank you for taking care of that.
 
6:13 PM
@bwoebi What's the difference between marking a function internal vs. user? I'd like this function that creates a new fiber to show up in the stack trace as [internal function] rather than [fiber function](0), but marking it internal seems to break a couple tests that throw an exception during shutdown.
I get a bad access on this line.
I also seem to break xdebug by marking it internal… so that's probably not the right way to fix that at all.
 
@Trowski well, if it has opcodes it shouldn't be internal
 
@bwoebi Ah, ok. I didn't really understand the difference between internal and user function.
It seems the only way to change that backtrace label is within zend_exceptions.c, so I'm probably out of luck for now.
 
@A.B.Carroll Sounds interesting. What's the motivation? HipHop did something similar (it transpiled PHP to C++ and then compiled that) but HHVM ended up not being significantly slower but got rid of the compilation phase (apparently the resulting binary for Facebook was too big to practically be deployed). There was also Zephir that was recently abandoned. It compiled the code to PHP C extensions.
Do you have a link?
 
@Trowski what does the stacktrace look like now?
 
@Crell Ok, so maybe we specify all RFCs we depend on, announce that the enum RFC, and then start announcing the individual RFCs so they have some context. At the moment only __isIdentical and initonly come to mind. I'll read over the RFC again and see if we can split off anything else.
 
6:28 PM
match type would be another, if we go that route.
I feel like we're not full set on the enum design, though.
 
@Crell Oh yes pattern matching. Worst case scenario, are we ok with enums and pattern matching being released in different versions?
 
As long as we have some way to cleanly branch on the type of the enum, and then extract values from it, I think that's sufficient. That's what `match type` allows.

I don't think that's a bad way to end up, at least for PHP.
 
6:44 PM
@Crell What makes me uncomfortable about match type is that we'll end up with multiple ways to do the same thing after we were to introduce general pattern matching. If we use a compatible syntax but only implement type pattern matching we wouldn't have that problem. gist.github.com/iluuu1994/6060cebdeead01a0bd515935862c2de3
Advantages of this approach: Is compatible with general pattern matching syntax, it can be mixed with expressions, downsides: It's a bit more verbose.
 
6:57 PM
@bwoebi Like this, with [fiber function] as the filename and 0 as the line num.
If the line number could be the line where the fiber was entered, that might help too.
That at least would be more helpful than 0.
 
7:48 PM
@IluTov @IluTov that's ... freaking sexy
 
What's the proposed semantics of "is"?
 
@Crell It's a pattern. We'd have to introduce the is keyword. Alternatively we could also use instanceof but given that the semantics would be different (support unions and primitive types) it might be better to use a different keyword.
 
So $foo is Bar would read as "$foo matches the pattern Bar", where the only pattern currently implemented is "instanceof"?
 
I would guess instanceof would respect type hierarchy and is would be like a instanceof ===
 
@Crell Exactly. Basically, at later points in time you could use this pattern in other contexts, like %Option::Some(is int).
 
7:53 PM
thinking_face.gif
@IluTov Where's the % coming from there?
 
Would "is A" match if the $x was a B which extends A ?
 
I would assume so.
 
@Crell Disambiguate with expressions, the % was your favorite character, remember? ^^
@A.B.Carroll For sure.
 
:-P
 
Interfaces would work too of course.
 
7:55 PM
Wouldn't that be is $foo is %Option::Some(is int)? The % can't imply "is" because it already means modulus.
 
@Crell It can, it's not used as a unary prefix operator yet.
 
Right, I mean the "is" doesn't go away.
Also, that means a match statement reads as "match that $foo is identical to, oh wait, matches pattern..."
Which may be OK, but isn't ideal.
 
@Crell Then I'm confused :)
I don't know what you mean.
 
@IluTov I think he means just the way it would read "as english" is a little backwards
 
@IluTov I mean "$foo is %Option::Some(is int)", cannot shorten to "$foo %Option::Some(is int)", so now I'm confused as to what "is" means vs "%" means. Since presumably you want to have "$foo is int" and "$foo is User" work as one would expect. (Viz, being a superset of instanceof that also handles primitives.)
 
8:02 PM
@Crell I'm solely talking about usage of patterns in match right now. I'm not atm suggesting to add is outside of match.
We could do that, but I don't think this should be part of this RFC.
The % is necessary for the parser to disambiguate between arbitrary expressions and patterns. E.g. Option::Some($a) could be a pattern or a function call.
 
match-only for now is fine, but I am 100% certain someone is going to ask for it in arbitrary if statements later, so we should plan ahead for it. (Later may be during the RFC discussion, or in 6 months, or in a year.)
And it really is a useful feature as a superset of instanceof.
I am not sure which would be the easier sell.
 
@Crell Sure. I wrote a prototype a while ago (github.com/php/php-src/compare/master...iluuu1994:is-expression). I originally planned to propose it for 8.0 but with my other RFCs I just didn't have the time.
 
Oh my. ;-)

So... in a sense then, "is" means "matches type" and % would define a patterned type to match against?

And then "is" also becomes a modifier in match() to override the === check?
 
8:20 PM
@Crell Because a leading is would be unambiguous we could drop the % there, but we could also keep it for consistency. But other types will require some prefix, could also be something other than %.
 
if ($foo is Bar|int) // seems unambiguous?
 
Yes, patterns are essentially complex comparisons, instead of matching to a constant value at runtime, you're matching the "shape" or "pattern".
@Crell That is unambiguous yes (if is is a keyword).
 
I feel like is would sell better if we do include the if-version, not just the match version.
And link it in to enums.
 
@Crell But then the enum rfc grows again.
Or would you create just an rfc for is (in match and expressions)
 
I mean link it in so that we can explain it in the larger context, not that it becomes part of one giant all-at-once RFC.
 
8:25 PM
@Crell Ok, yeah we can definitely do that.
 
So there would be:
* Basic `is` (only type patterns)
* `__isIdentical()`(which could pass or not, I think enums will work either way)
* `initonly` or similar
* Short functions
* Enums
* Advanced `is` (patterns)
Each as separate RFCs, but all linked to from the Enum RFC so people can see the broader context.
 
@Crell How are short functions related?
 
Only tangentially, but enums methods are cases where I expect them to be very readily usable. Most enum bodies should be super simple, or just a match().
Again, not a prerequisite, but they would complement each other.
So, since you already have code... want me to try and draw up RFCs for is (basic and advanced)?
(Since I don't know how else I can help.)
 
8:40 PM
@Crell That would be great, I could hack together a prototype for is in match then :) The only other crucial piece I think would be initonly, although I could probably hack that into the VM just like with __isIdentical in case that doesn't get excepted.
*accepted ^^
 
I'm still skeptical about initonly. If it can be done in a way to supports cloning and with-er methods, I'm in. If not, I'm opposed.
 
@Crell Either way, it would make enums a little bit less special which will reduce resistance :)
 
@IluTov Sure, and if we can do it in a way that doesn't hurt with-er methods, I'm down. But I don't think that's a good tradeoff if it makes with-er methods worse in exchange.
3v4l.org/LJkPt - Like, if we could internalize that somehow and make modClone an init method, that would be sufficient.
 
9:02 PM
@Crell I was just thinking about that, the problem I see with this solution is that we can't differentiate between properties are you're allowed to change and properties that you aren't. 3v4l.org/41nm5 Do we really want all initonly properties to be "modifiable" (albeit indirectly by cloning the object) by the user?
This could only be solved by different visibility modifiers for getting and setting, in combination with initonly (the property shouldn't be modifiable form inside the class either after initialization).
 
That's the asymmetric visibility thing I've been talking about, that Nicolas Greigas suggested originally and Mate said he didn't like. :-)
IMO, during the constructor, deserialization, and cloning, all bets are off. Those all should be counted as "init" scope.
 
@Crell Yeah I know, I was missing the right terminology :)
@Crell Yes, but cloning can happen outside or inside the object (unlike initialization which always happens inside).
 
get:public set:private Foo $foo; -- That would not be quite the same as initonly, but if it's only modifiable within the class then it's close enough in the 90% case.
Yes, which is why modClone as I have it above would only work if private. I haven't fully thought through how to make it only work inside the class. (I had an idea the other day, and then fell asleep and forgot it.)
In my ideal world, with-er methods become single-line, too.
public function withX(int $x): static => $this with {x: $x}; // Or something like, that.
 
@Crell Honestly, I don't like that syntax either. I'd rather just have C# style accessors.
 
I'd like accessors too, but that doesn't help for with-er methods.
 
9:14 PM
@Crell But they make the asymmetric visibility redundant, you'd just do public $foo { get; private set; }
 
I suppose there's 2 ways to approach it:
1) Making a clone of an object makes it "yours" so modifying its values is OK, because you licked it, it's yours now.
2) Clones are identical as far as the outside is concerned. Modifying a clone is an internal-only operation, because what properties there even are is not part of the technical API.
@IluTov Er, yes, I proposed asymmetric visibility as a stepping stone toward accessor methods in March. :-) But they still don't help with with-er methods.
The trick is accessors and property promotion... don't combine nicely, syntactically.
 
@Crell But then we end up with two features with large overlap again :)
 
Uh. You don't remember my post from March, do you. :-) I literally proposed using the exact same syntax as the most recent accessor proposal, precisely to make it forward-compatible. The only caveat is that it ends up being clunky inside constructor promotion.
 
@Crell Haha oh ok, that sounds great then ^^
I'm done for today, good night everybody :)
 
9:24 PM
@Danack regarding the STDOUT, yes it was a cache issue. Thanks!
 
@Ghostff thought it might be. If you see an answer that matches your exact problem, and it doesn't work, that probably means you're missing some info, and need to dig into why it didn't work.
 
gotcha
 
By the way, I don't mean to shill.. I don't know this person or get anything out of this except sharing knowledge but since there seems to be a lot of language development chatter around here, ... There is a guy on YouTube, Lex Fridman, who does interviews with a lot of heavy hitters in the IT world like bjarne stroustrup, noam chomsky, chris lattner (one of the creators of LLVM)... youtube.com/c/lexfridman/videos
Love his stuff and wish I'd known of it sooner, so just thought I'd share. Only podcast that deals with more than surface level IT stuff I'm aware of
 
9:46 PM
root@bobtop:~# mysql --protocol=TCP -h127.0.0.1 --port 1234 -u test -ptest --ssl-mode=DISABLED
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
@Trowski apparently even the native mysql client from oracle does not support that certificate auth over non-unix or non-tls channels described in dev.mysql.com/doc/dev/mysql-server/latest/…
So I guess we will also simply not support that in amp/mysql?
At least I have no real idea how it's implemented and cannot find anything real related to that
 
@A.B.Carroll not a shill if it's useful, but sometimes what you link can be missed in the chat flow :S
Both yours and Bob's avatars are so similar. x.x
 
PHPIZE configuration has outdated PHP_RELEASE_VERSION ・ *Compile Issues ・ #80345
 
cmb
10:01 PM
@alcaeus that's fine from your side; there's still a bug in phpize on Windows, but that isn't really an issue in this case.
 
@bwoebi Does it work when connecting from PHP?
I remember dealing with the different protocol for the secure and the non-secure case, so pretty sure the server side supports that at least
Or at least, it used to work
 
good point, I'll try
@NikiC yeah, seems to work
 
Wes
10:27 PM
there should be a derogatory term for code that is for the most part LOGGER CALLS
 
@Wes compile time type system, runtime type system, post execution eyeball evaluated type system...
 
Wes
lol
not what i had in mind
 
10:44 PM
@Wes log flume?
 
Wes
lol :D
 
what I particularly love is when there's a logger call with a comment immediately above with the exact content of the log message
 
Why does mysql love zero bytes after passwords
 \openssl_public_encrypt("$pass\0" ^ \str_repeat($scramble, \ceil(\strlen($pass) / \strlen($scramble))), $auth, $key, OPENSSL_PKCS1_OAEP_PADDING);
this goddamn \0 after $pass
 
@IluTov Pretty sure @MateKocsis is working on it again he's just trying to figure out the cloning bit (which is what got the initial RFC shot down)
 
Aug 5 at 8:34, by Danack
tl:dr - I think cloning needs to put the new object into a state where the properties can be written to until the end of the __clone call.
I still think that...
 
10:51 PM
@bwoebi lol, so is the \0 actually part of the password?
@Wes Fix your xdebug issue? I remembered I also had to add xdebug.mode=debug to my php.ini.
 
for mysql, apparently yes
 
@bwoebi That's just fantastic :-P
 
Wes
@Trowski oh. will try again tomorrow
that might be it though
 
and now: need v3 :-D
@NikiC I just have to laugh when I compare the complexity (and LoC) of the C impl with the PHP impl
 
@bwoebi Awesome, thank you! I will make a v3 compat branch tonight.
 
10:57 PM
user image
3
 
@Trowski nice
 
00:00 - 23:0023:00 - 00:00

« first day (3677 days earlier)      last day (1257 days later) »