« first day (3679 days earlier)      last day (1275 days later) » 

12:00 AM
It's been a negative feedback loop, definitely.
 
12:57 AM
Has anyone here used protobuf? I'm using the C++ API and there seems to be some patterns used in it that I don't understand; wonder if these patterns are present in other languages.
Seems weird that I'm doing .add_foo() and it doesn't take any args. Not very idiomatic C++, at least.
 
 
1 hour later…
2:11 AM
@LeviMorrison utahrcv.com
 
 
1 hour later…
3:27 AM
@scorgn walks like a duck, talks like a duck, gives ducks a huge tax break and shits all over everyones lawn... probably a duck.
"modern" conservative (i.e. the likes of your Trumps, BoJo's, Tony Abbotts (do you even know that is?) etc) "leaders" (I use that term loosely) somehow have managed to work out a way to get a % of the population to vote against their own best interests, and against the best interests of society in general, based on the bogey man factor.
I'm not talking about accepting a small sacrifice for the "greater good" (i.e. I've often voted Green Party in Au, who want to ban duck hunting amongst other things; but I very much enjoy eating duck - but I can't breathe or drink duck so their environmental policies are net positive for me) but things that affect themselves and the vast majority of society negatively - case in point: how many ~$30K/yr "republicans" will cheer on a tax cut for billionaires, while gov services get defunded.
 
3:45 AM
Are deprecation messages introduced as notices or warnings?
 
4:06 AM
@Tiffany er, as E_DEPRECATED which is a thing.
Also, an animated jpeg:
/nn
 
@Danack y u do dis
 
4:24 AM
morning
 
 
2 hours later…
5:57 AM
\o
 
 
1 hour later…
7:10 AM
o/
 
ha. I wonder how long they've been sitting on this name
(completely sfw)
 
 
1 hour later…
8:21 AM
morns
 
8:47 AM
@cmb Do we provide the sqlite format of the docs for download somewhere?
I remember that it used to be available, but now I can't find it (php.net/download-docs.php only has HTML and CHM)
(Also that page needs an update to reference PHP 5 and not just PHP 4)
 
9:17 AM
moin
 
moin moin
 
Updated Date: 2020-06-08T02:38:08
Creation Date: 1995-03-30T05:00:00
 
5 years before the great prophecy even.
 
the great prophecy?
 
"Bart to the Future" is the seventeenth episode of the eleventh season of the American animated television sitcom The Simpsons. It originally aired on the Fox network in the United States on March 19, 2000. In the episode, after their picnic in the park is cut short due to a mosquito infestation, the Simpsons stop by at an Indian casino. There, Bart is prevented from entering because of his age. He manages to sneak in but is caught by the guards and sent to the casino manager's office. The Native American manager shows Bart a vision of his future as a washed-up, wannabe rock musician living with...
 
9:22 AM
ah
 
we ordered a new washing machine online, and now the place is getting confused because they're trying to view where to come on google street view
but its so out of date, where our front fence and driveway are, literally shows up as a murky pond
 
cmb
@NikiC AFAIK, there is only a sqlite database which is used for indexing stuff. Never looked into it.
 
9:59 AM
Huh, our curl_share test coverage is ... great
 
10:51 AM
 
11:43 AM
@Crell What I forgot about: Using objects as keys might be something worth investigating. My preferred approach would be a Hashable interface where you can provide your own hashing implementation that will be used as a key in the hashmap. This is something enums (and potentially records at some point) would auto-implement.
 
11:53 AM
Morning
 
Wes
12:06 PM
morning
couldn't figure out why Amp\Promise\first() would not autocomplete in phpstorm...... i was in a JS file
and by the way, i like the Promise.race() naming more :P
 
cmb
12:19 PM
@Sara, @GabrielCaruso, does externals.io/message/112219 need attention? /cc @NikiC
 
@cmb The mail doesn't explain what the actual problem is, so I have no idea
 
cmb
I could only guess; maybe wait on the link with more details (although later today doesn't seem to apply anymore)
 
@NikiC there also isn't any explanation of why the version was removed ;) Since I think it's subjective which is better it's not unreasonable of people asking to revert it. Any argument for or against this change would probably help
 
!!rfcs
 
12:33 PM
oh, the version isn't explicit.
Okay for me to ninja edit in "Next PHP 8.x." "8.1" ?
 
@Danack Sure :)
 
It still says "Under Discussion" too
 
too many things to think about before moving them
 
12:49 PM
@Sjon I mean, if that question had come up 6 months ago, sure
 
cmb
1:02 PM
Yes, it's a "bit" late. Anyway, github.com/php/php-src/pull/3769 explains the reasoning.
 
@cmb ah, that's a good reason
 
1:30 PM
@cmb FWIW this also broke WAMP but it got fixed now
 
1:42 PM
@Dharman I think the real problem in your example is that we report more results existing even though there aren't any more
 
Oh?
 
I mean, there should only be two results sets, but the loop goes into a third iteration, and that's where we fail to fetch
 
Wes
2:02 PM
@kelunik would this make sense: functions such as first() assume that all the promises are "on the same level" and return interchangeable data, but that's not always true, for example, const doNext = await Promise.race(popNextCommand, gracefullyShutDownProgram);
so i get mixed up types in doNext. what i'd like to have, is Promise.race() to return the first fulfilled promise instead
const doNext = await Promise.race(popNextCommand, gracefullyShutDownProgram);
if(doNext === popNextCommand){
doNext.then(......);
}else{
...
 
@Dharman May be related to bugs.php.net/bug.php?id=62820 / this XFAILed test: github.com/php/php-src/blob/master/ext/pdo_mysql/tests/… This seems like a similar issue in PDO MySQL
dev.mysql.com/doc/internals/en/multi-resultset.html seems relavant. Looks like there's always an empty result set at the end?
 
@NikiC should I just land the IMAP resource to object conversion in master or do you want to review it first?
 
@Crell What do you think about also introducing as to enforce that the pattern matches? $foo as [0, 1..=100, $bar];, if the pattern fails it throws an error, whereas is would return a boolean. That is something we could also add to future scope. This only makes sense outside of match though.
 
2:25 PM
@IluTov not directly related but similar:
 
Goooooooood Morning, All!
 
Wes
phpnam?
 
@IluTov Why a separate keyword? if ($foo is [0...100]) reads fine to me.
 
2:52 PM
@Crell That's different, as would enfore it though an exception
Like Hack does, $foo as Foo will throw if $foo is not Foo
 
So it's an assertion?
 
Yes
 
assert($foo is [0...100]) - Done.
 
I guess :P
 
I know x < y < z makes perfect sense from a "basic maths" point of view, but it blows my mind as a programmer... like, why am I doing a less than with a left hand boolean value
 
2:54 PM
@Crell Actually no, it would have to be an if. assertions can be removed in prod at runtime.
 
cmb
@NikiC see github.com/php/php-src/pull/4496 for an attempt to fix that for PDO_MySQL; I had to revert due to bugs.php.net/bug.php?id=78623
 
Yes, that's the point of assertions...
 
@Crell Yes, but if you bind values in a pattern you'll want to use them later on.
 
Yes. But then I don't want an assertion-style failure. "match pattern" and "please blow up" are different operations and I'd want them separate.
@IluTov To your earlier point (I'm backscrolling), a __hash() method might be interesting, yes. Though it's going to overlap with a ton of other stuff so could get complicated very fast. Eg, what happens here:


class Foo { public function __hash() { return 42; }
$arr[new Foo()] = 'beep';
$arr[42] = 'narf';
print $arr[42];
 
@Crell Hash collisions are always an issue. I'm not sure how PHP handles hash collisions right now with strings and integers. But the hash of ints is probably not just the int itself.
@Crell You might, if you know some pattern must match and you want to extract a value from it. Another use case: takesIntOrFloat($foo as int|float);
Although admittedly, this is mostly useful for static analysis.
 
3:07 PM
@Dharman Unrelated issue I noticed: github.com/php/php-src/commit/… Does that look right? ^^
@cmb Interesting
Probably PDO is not the right layer to address it
 
cmb
maybe we should ask marines/fjanisze?
 
@cmb I see
@cmb Probably row count is not the right way to distinguish this
You can also have a result set that's simply empty, right?
 
@Crell Anyway, if you don't agree we don't have to focus on this right now. We can mention it in future scope and forget about it for now :)
 
Yeah, an assertion version of pattern matching is definitely out of scope, and I'm not a fan. :-)
 
@Crell I'll just sneak it in when you don't look :P
 
cmb
3:19 PM
@NikiC yes, that was actually the reported regression. Maybe checking for column_count?
 
On the mysqlnd side, it looks like this can be distinguished based on conn->last_query_type == QUERY_UPSERT
 
I'm not sure on the object hash. Again, I can see the value but I can also see where it would cause lots of problems.
 
@NikiC coincidence or not; I just received an email from another surprised 3v4l user that expected UTC as default timezone
 
@cmb There's also this code: github.com/php/php-src/blob/…
Which seems to be handling exactly this, but only if emulation is disabled???
I'm so confused now
I suspect the emulation distinction is there because with emulation we allow multi queries (I think) so the assumption doesn't hold that the last result set is always unnecessary
 
cmb
3:41 PM
ah, yes, that looks plausible
 
4:11 PM
@cmb That leaves us with a problem though: How do we distinguish the trailing result set for a stored procedure from an upsert in a multi query?
 
cmb
4:23 PM
hmm, if libmysqlclient's mysql_next_result()/mysql_more_results() ignore that trailing result set, mysqlnd should do that as well
 
@cmb Don't think it does
Seeing the same behavior with libmysqlclient
 
cmb
I'm having a meeting right now; will have a closer look afterwards
 
5:09 PM
@cmb is there no 32bit version of 8.0.0RC4?
(on windows)
 
no, go check the download dir
it has RC3 for x86
the archive dir has the right (old) RC3s
my xdebug appveyor builds are failing because of this...
swaying RC4 but linking to RC3 downloads
 
cmb
Oh, indeed; apparently I rebuilt RC3 again. Will do RC4 builds now.
thanks for noticing!
 
CI to the rescue :-D
 
5:32 PM
@Crell These are all I could think of, is anything missing? gist.github.com/iluuu1994/096af29df86b2fe9b3da95c14595a45e
Unfortunately class types and global constants do conflict. We could disallow the usage of global constants since those are more rare nowadays. You could still achieve the same with a guard/expression pattern.
 
5:53 PM
@IluTov I hate slash delimited regexes :-D
@IluTov also that will be non-trivial with the current parser/lexer I think
 
@bwoebi Me too actually :D But most people only use slashes...
@bwoebi Note, that list is just anything remotely possible, we're trying to look for possible grammar ambiguities.
 
$foo is 0..=10; what does that mean?
$foo is 0..10 would be self explaining
but the = ?
 
@bwoebi Inclusive vs exclusive ranges (..< vs ..=)
 
@IluTov I'd avoid the literal is pattern and just use == or === for these equality checks
 
@bwoebi I've thought about that, but we'd have to wrap them in braces to avoid ambiguities between patterns which looks really ugly...
$foo is Foo { bar: ===(5) }
 
6:00 PM
@IluTov does the exclusiveness apply to the both ends of the range?
 
Yuck
 
feels weird
@IluTov concrete example where it is ambiguous without parens?
 
@bwoebi Usually just the end. It's not as relevant here because the end of the range can't be dynamic. Often it is useful to pass a count, so something like 0..<count
 
@IluTov 0..count-1 maybe then?
 
$foo is Foo { bar: ===(5 or true) } // bar must equal 5
// vs
$foo is Foo { bar: ===(5) or true } // bar must equal 5 or true
Weird example, but demonstrates the ambiguity
 
6:04 PM
that's just a question of precedence
 
@bwoebi Yeah, that's pretty much a shortcut for that. Swift Rust
 
@IluTov You forgot variable extraction from assoc arrays.
 
@Crell Nope, that's a combination of a binding and just the array pattern.
 
@IluTov hmmmmm
 
Yes, but it's not obvious that you can mix and match, both in the array and object forms.
 
6:05 PM
Maybe you're right on ..= and ..<
 
@Crell Ok, I'll add it :)
 
And I'm fine with not supporting constants. A constant could be == matched anyway.
Also a $foo is Foo { bar: 'baz', beep: $beep } example.
 
@Crell Yeah. It would be useful inside other patterns though.
@bwoebi Hm, I guess, but what if the precedence in patterns and expressions deviate? I can try it, I'll have to create a prototype anyway to make really sure we don't run into ambiguities.
(Just the parser bit)
 
@Crell I hate to ask this but … would that is check compare $foo->beep == $beep or $foo->beep === $beep? Or is it dependent on strict_types decl?
 
@bwoebi There's no check here, $beep is a variable binding.
 
6:16 PM
oh, okay
@IluTov It shouldn't need to - we currently evaluate or before we descend into === currently - same should be the case with these is expressions
so, bar: === 5 or true is bar: (=== 5) or (true)
 
@bwoebi I'll check. Alternatively we could just wrap in braces, although I guess that's not as explicit.
 
and bar: === 5 or == true then either 5 or true
 
Ok, that looks like it should work. If it does, there's no concern for $foo is Foo :)
 
@IluTov I am wondering whether we want to convert === 5 to fn($x) => $x === 5?
then you can also do bar: fn($x) => strlen($x) > 5
and we assume or to be a functional combinator between functions or literal values
similarly $foo is Foo { bar: is Bar }
i.e. T_IDENTIFIER: variable_expression | function_reference | literal_value basically
and function_reference can be one of the binary comparison ops in unary form
And then I have to think of haskell where you write (+) foo to express \x -> x + foo
And I wonder whether I'm going too far :-D
 
6:35 PM
But it's fair to ask if bar: 'baz' would be a strict or weak check. :-/
 
6:49 PM
@Crell Fair, I was just assuming === everywhere ^^ == sucks :P
@bwoebi Haha I think a little bit ^^ We're just thinking about syntax atm, we're gonna start with the type pattern (just is Foo|int|float, etc). This is the most crucial for enums probably. Although we could technically also start with the object pattern and bindings.
 
=== gets weird when you're comparing objects. :-P
 
7:05 PM
@Crell Not when we have __isIdentical xD
 
sigh.gif
 
Full circle, it all adds up :P
@Crell Actually what I just forgot, Bob suggested not allowing literals. So you'd have to do === 'baz or == 'baz' anyway.
 
@IluTov I think literal values are fine in the Foo { prop: ... } part, but not is <literal>
 
@bwoebi All of them are patterns, I wouldn't restrict them artificially.
 
@IluTov so, eih, do you want $foo is Foo { prop: Foo | Bar | Baz } or $foo is Foo { prop: is Foo | Bar | Baz }? I'm leaning towards the latter
the part after is for sure is a pattern, yes
but without an is?
 
7:17 PM
@bwoebi The former
 
There's space for a custom expression like == $foo or such
 
@bwoebi Usually, (at least for most languages) sub-elements are patterns too.
 
I am losing you here...
 
@Crell me or Ilija?
 
Yes.
 
7:22 PM
@IluTov But being able to do $foo is == 5 is quite non-sensical, if you want to have this strict pattern recursion
 
@Crell Foo { bar: <pattern> } or Foo { bar: (<expr> | T_IS <pattern>) }, in short, I guess.
 
The first seems a lot nicer to work with.
And more predictable, otherwise you have an is inside an is that doesn't behave like the top level is.
 
@bwoebi True. But almost all new language features can be used in nonsensical ways.
 
The top level is evaluates to a boolean. The inner one would have to do something else. That's ore complicated to grok.
Let's also bear in mind that there's an upper bound to how much logic you even want to pack into a pattern. At some point, "write it out long form with a couple of if statements like a grownup" is the better solution.
Where that line is, that's a squishier question.
 
@Crell Yeah, I agree. For a binding, we'd then have to use $foo is Foo { bar: is $bar }, I don't think that's great.
 
7:26 PM
What would that mean? So you're allowing for variables INSIDE a pattern, but not as the pattern itself?
 
@IluTov just saying that you're then at the same time going to hit a wall with constants and enum values though
 
@Crell It would allow both, but you'd have to prefix all patterns with is. I don't think that's ideal. I'd rather do it the other way around (patterns by default, prefix expressions with something).
 
I'd be fine with prefixing expressions as well as long as it's sane
 
@bwoebi I guess yeah... We'd need literal patterns (explicitly excluding global constants) for that to work relatively well.
 
if you can prefix the expressions , you can do prefix MY_CONSTANT
then it'd be fine too
 
7:29 PM
@bwoebi Yeah exactly.
 
... So $foo is Class or $foo is %Constant or $pattern = %Class; $foo is %$pattern? That confuses me and I just wrote it. :-)
 
the former
and one could do $foo is Foo { prop: %$var } to evaluate the var instead of binding it
 
@NikiC Thanks. If I am not wrong this was on my agenda to fix. I did notice that already but I didn't have time to submit a PR. Thanks for the good work.
 
At what point do we realize we're reimplementing regular expressions and cut our losses? :-)
Or, rather, what do other pattern matching languages do that we can steal and say close enough?
 
@Crell how is that even related? :-D
 
7:35 PM
@bwoebi At some point you end up with a compact syntax so convoluted that it becomes write-only. Like regexes, or Perl. :-)
I suppose pattern matching literally is regexes for language structures, when you think about it...
 
@Crell it all depends on the nesting level
a small regex is definitely not write-only
but yeah, once you start using extended pcre features and nest alternations, then things start to get harder to read
I suppose it will be the same with pattern matching
 
Right, and that's what I want to be mindful of.
 
don't exaggerate and it'll be fine
 
Broader question: How much dynamicness do we want to support in patterns, anyway? At what point does it become "just write a normal if statement, geez!"
 
I've updated the Fiber RFC with FAQs, examples, and more explanations. Thank you all for the feedback so far!
7
 
7:46 PM
@Trowski Is the fiber stack allocated fully or on-demand with ability to grow up to stack size?
i.e. what's the cost of fiber creation?
 
@bwoebi On-demand assuming the platform supports mmap (which is everything afaik)
 
good :-)
 
@bwoebi Allocating memory for a new C stack. Basically the same as a generator for the PHP VM.
 
because the RFC sounded like it would be non-overcommitted memory
 
I'll reword that to be clearer.
 
7:53 PM
@Trowski have you heard of MAP_GROWSDOWN?
 
@bwoebi No.
 
which also gives you a guard page and thus will catch regular OOB, even if there happens to be an adjacent page mapped
natively
you do it sort of manually right now, but I think I'd go with MAP_GROWSDOWN if available
 
Some of the information I'm finding on MAP_GROWSDOWN seems to advocate against using it.
2
Q: Analyzing memory mapping of a process with pmap. [stack]

St.AntarioI'm trying to understand how stack works in Linux. I read AMD64 ABI sections about stack and process initialization and it is not clear how the stack should be mapped. Here is the relevant quote (3.4.1): Stack State This section describes the machine state that exec (BA_OS) creates for ...

12
Q: How to mmap the stack for the clone() system call on linux?

Joseph GarvinThe clone() system call on Linux takes a parameter pointing to the stack for the new created thread to use. The obvious way to do this is to simply malloc some space and pass that, but then you have to be sure you've malloc'd as much stack space as that thread will ever use (hard to predict). I ...

 
hm okay
 
Looking at fiber_stack.c (most of which I didn't write), I think I'm wrong, mmap is used only if a flag is set.
Ah, ok, but the flag is set on posix, which makes sense.
 
8:03 PM
#if _POSIX_MAPPED_FILES
32	#define ZEND_FIBER_MMAP 1
33
yes
 
@Trowski funciton
 
@Danack Huh, apparently my editor doesn't spell check.
 
8:30 PM
!!lxr fputcsv
 
Total number of search results: 6. Showing the first 5 results.
• [ /php-src/ext/standard/file.c::1796 ] PHP_FUNCTION(<b>fputcsv</b>)
• [ /php-src/ext/standard/basic_functions_arginfo.h::2568 ] ZEND_FUNCTION(<b>fputcsv</b>);
• [ /php-src/ext/standard/basic_functions_arginfo.h::3205 ] ZEND_FE(<b>fputcsv</b>, arginfo_fputcsv)
• [ /php-src/ext/spl/spl_directory.c::2382 ] PHP_METHOD(SplFileObject, <b>fputcsv</b>)
• [ /php-src/ext/spl/spl_directory_arginfo.h::322 ] ZEND_METHOD(SplFileObject, <b>fputcsv</b>);
 
(sorry, ignore me)
 
8:51 PM
@Tiffany Done! =P
 
@IluTov I don't mind if my code is a bit more verbose, but I hate when there are multiple ways to write the same thing. That's all my reasons :)
 
@MateKocsis why do you hate that?
 
9:15 PM
with Opcache, is there a possibility of array cache using file_put_content and var_export being faster than in-memory like apcu?
 
@Ghostff probably. But certainly writing a file of PHP to a cache and then loading it through opcache is a valid data caching technique.
and requires one less extension..
 
If you're writing cache data to disk, use a RAM disk for it. That way it's still using memory and doesn't need to hit physical storage.
 
@Ghostff Yes, that is the fastest way to cache immutable data
 
@NikiC I came to the conclusion that this is the right behaviour. Thanks to that MySQL doc page you shared now I understand that the Stored Procedure itself generates an empty result. So in fact there are 3 results. However, the problem is that from PHP point of view such behaviour is very unexpected. It is just one more weird quirk of using mysqli.
 
9:58 PM
@Trowski I don't have time to get into a long discussion again right now, so feel free to ignore this feedback if it's not clear, but I find it slightly hard to follow what order things happen in
when you call Fiber::suspend($callback, $scheduler) is $callback(new Continuation) called first, and then $scheduler->run(), or is one of them only called later? are they called on the same green thread?
in the examples, it feels like the call could just be Fiber::suspend(callable $callback, string $schedulerId) with $callback responsible for invoking $scheduler->run(), and the ID determining if this is a new scheduler or an existing one, but I suspect I'm missing some nuance
 
well. It would seem I am now looking for work. I'm a fair 5/7 PHP developper, hit me up
 
@FélixGagnon-Grenier sudden change of circumstances or just couldn't stand their bracket placement any more?
 
@Ghostff i have a doctrine metadata driver that works exactly this way, its the fastest way. You must be careful that you only have a finite number of those files though, or tinker with opcache.max_accelerated_files setting.
 
@FélixGagnon-Grenier 5/7?
 
@Danack very much quite sudden
@Tiffany well, I apparently can't meme tho
 
10:13 PM
It'd be, "I'd rate my skills as 5/7"
unless you mean, that you are a fair PHP 5 or PHP 7 developer.
 
:P
ah yes, the former punches much better
 
to everyone who spends too much time on fark
or is it reddit?
 
morns/evenings
 
5/7 is a perfect score, you can't get better than that
 
cmb
10:18 PM
@Dharman Are you suggesting to keep it as is? If so, we should document the behavior (and close related bug tickets).
 
@cmb Yes, that would be my recommendation. Otherwise, we would need to implement some logic to ignore the empty result, which would be a total hack and probably very wrong. (imagine INSERT after SELECT in SP). SP CALL should return an empty result, the problem is that PHP can't differentiate between them, but that is already the problem with INSERT/UPDATE queries inside of SP anyway.
As for the documentation, I am not sure where it would fit within mysqli manual. We could add a paragraph about it in Quick Start guide, but this behaviour is not mysqli specific IMHO. The error message is unclear but that is because it is a very generic message. SP are very difficult to use in themselves. We are trying to address a single might-be problem, but what about all other situations. If someone tries to execute SP with PHP in such a way, they are only shooting themselves in the foot.
Right now, if I do CALL p() in phpMyAdmin it reports "Commands out of sync; you can't run this command now" so yeah, this is a problem... but is it PHP's problem?
I am new to all to contributing to PHP so this are only my observations but I am sure you can come up with the best resolution.
 
10:37 PM
@IluTov So do we include binding in the initial pattern matching RFC or no?
 
@NikiC Should we add a note on wiki.php.net/rfc/token_as_object about github.com/php/php-src/commit/b1019f46? Or even change the whole RFC with the new method name?
@Sara Are you okay with me releasing an RC5 next week? It's related to: github.com/php/php-src/pull/6377#issuecomment-725574878
@cmb Apart from github.com/php/doc-en/pull/170, is there something else that we need for PHP-8.0's documentation? I remember that we have a PR someone automating the renaming/mapping of the new functions' arguments names
 
@GabrielCaruso THat's not what was voted on though
Changing history would be confusing
 
RFC's are often referred to after the fact, so having at least a note of "Implemented, but with this late change" would be sensible
 
@PeeHaa So a note at least, it's important for history indeed. Btw, it's related to this: externals.io/message/112189
 
10:53 PM
@IluTov Also, I'm questioning if the syntax shouldn't be:

match is ($var) {
pattern1 => ,
pattern2 => ,
}

So as to avoid having type `is` over and over.
Or maybe match ($var) is { ... };
 
@GabrielCaruso no - please don't do that. Just add note in the code. RFCs need to be readable as is, without looking at the history.
@IMSoP sounds good. maybe in the implementation section?
 
cmb
@IMSoP I second this. Anybody looking this up via the RFC (e.g. documentors) will inevitably stumble upon the renamed method otherwise.
 
11:09 PM
@Crell Not unless we have other patterns where bindings actually become useful (like the object pattern).
 
That's what I'm thinking of. Include the object pattern so we can show binding.
 
@Crell But then you can't mix them...
 
When would you want to mix them?
 
@Crell I can see various scenarios, for example:
match ($x) {
	1 => ...,
	2 => ...,
	is <= 5 => ...,
	is <= 10 => ...,
};
I'm great with examples :P You get the point.
 
:-P
Hm. OK, fair...
 
11:14 PM
Although... 1 and 2 as literal patterns would have the exact same effect...
 
Thought: It may be easier to wrap your head around if % is used to indicate "extract". That is, a variable is interpreted as a variable, but %$foo means "don't look for a $foo variable, pull the foo property out into a $foo variable".
True.
 
@GabrielCaruso I don't think that warrants an RC5
 
@NikiC Even if it doesn't delay GA?
 
cmb
@GabrielCaruso yes, that's github.com/php/php-src/pull/6367. And we also need to look at github.com/php/web-php/pull/350.
 
@IluTov Are there cases where you'd have an identity match that would not be the same as pattern match?
 
11:19 PM
@Crell I don't understand the question.
 
$foo is 1; $foo === 1; // Those mean the same thing.
 
@Crell Oh ok. I don't think so, to me they should mean the same thing.
 
Right. In which case making the whole match() operate in pattern match mode should be fine.
 
@Crell I don't know, I kinda like the explicit is. Makes it more obvious right away that you're dealing with a pattern and you also won't encounter cases where you'll have to refactor your whole match because you can't mix them both. In reality, I'm guessing both patterns and arbitrary expressions will be much less likely than just constant values.
It's late, I need sleep ^^ See you tomorrow
 
Are you OK with me including object matching for bind?
(Then I'll let you sleep.)
 
11:31 PM
@Crell It's a little harder to pull off. In my prototype one issue I had was that variables were bound before the pattern was fully matched. Which means if something after a variable binding fails the binding could've potentially overwritten a variable it shouldn't have. Type patterns seem more straight forward to me at the moment. But I can definitely spend some time trying to make it work.
 
I'm mainly thinking about it being "not enough" without it.
 
var_dump(match ($x) {
	is Option::Some => $x->value,
});
if ($x is Option::Some) {
	var_dump($x->value);
}
// vs
var_dump(match ($x) {
	is Option::Some { $value } => $value,
});
if ($x is Option::Some { $value }) {
	var_dump($value);
}
Difference doesn't seem to big to me.
But yeah, I can try to make it work.
 
I'll write the RFC with it for now, and we can pull back if needed.
 
Ok, works for me (y) Byebye then ^^
 

« first day (3679 days earlier)      last day (1275 days later) »