« first day (3683 days earlier)      last day (1247 days later) » 

12:36 AM
is it necessary to learn different programming languages to get a job
 
getAttributes segfault on dynamic properties ・ Reflection related ・ #80370
 
1:13 AM
@MaduekwePedro not necessary, no. Having an understanding of fundamentals is generally more important. Data structures, design patterns, algorithms. Though, once you have a good understanding of one, learning other languages becomes easier.
 
1:38 AM
@IluTov I haven't ported that back to GitHub yet. Not sure if we need to. I still need to writeup the top-level page, and settle on names of the top level and enums part 2 RFC. I've adapted part 2 already, but not posted it because I can't rename it once the page is created. :-/
@Danack Would a Haskell mailing list actually be willing to talk to PHP people about PHP? :-)
 
1:52 AM
@IluTov I could be convinced of cases(). The particular name isn't something I'll fight over.
 
@Danack I recently added an example that executes multiple timers simultaneously: github.com/amphp/ext-fiber/blob/master/examples/…
I agree that I need more simple code examples. Something like that should be added to the RFC.
 
2:16 AM
@Crell yes, bonus points for getting them to godwin themselves again.
well at least there is precedence...
 
@Danack Does that example make sense? For the RFC I would either define delay() in the example, or just inline the code.
 
I'll try reading it when there is a leading 'one' in the time....
 
@Danack Huh. Fascinating. Although in this case bouncing it off of Rustians might be more valuable, since it's closer to Rust or Swift than to Haskell in practice.
 
It was 12 years ago! I barely remember last week.
 
2:48 AM
ICQ number... oh wow
 
 
7 hours later…
9:35 AM
so merging my first commit into a branch, then I update the NEWS file in that branch in a second commit, then I merge the branch up to master. should I expect merge conflicts? The Git Workflow shows the merge, but not the news change inbetween. i am not 100% confident to do this :)
 
9:58 AM
8530567
ICQ number :-(
 
10:56 AM
@Crell I guess it would just be easier to raise specific concerns. Anyway, I'll post them here for now.
* Do we really need the grouped syntax? I dislike grouped syntaxes in general
* No semicolon after case ... {}
* Do we need to guard from creating dynamic properties inside the enum?
* I'm pretty strongly against implicit coercion
* values() => cases()

> Do we allow static methods on Enums, Cases, or both?
Probably both. I don't see them being useful on cases but not sure if we should artificially restrict them.

> Is the case keyword necessary?
I'd have to double check but since it's short I think it's better to keep it. It avoids possible ambiguities in the future.
We've discussed some of them before. But we can of course re-discuss them if you want :)
 
 
2 hours later…
cmb
12:31 PM
@beberlei do you have a merge conflict clause for NEWS? Then this is expected. You can amend each single merge commit with the changed NEWS file.
 
@cmb perfect!
 
@Crell Actually, one reason not to allow static methods for cases is that it would only be possible to call the method through the instance instead of directly (e.g Foo::Bar::baz(), Foo::Bar would be the instance here, not the class). It will be easier to allow this in the future than to remove it. Maybe we should look at all class features one by one and see if they make sense for enums.
 
 
3 hours later…
3:28 PM
@IluTov Good morning!

Auditing "object features" one by one is a good idea. Helps keep from forgetting anything.
Grouped syntax: My suspicion is that "I just have a list of 4 values, go away, why do I need all this extra syntax" is going to be a complaint. The grouped syntax avoids that, and is consistent with grouped syntaxes elsewhere in the language. That said, it seems simple enough to punt to a future scope the way match (true) was punted. It could be added later without breaking anything, I think. But that then increases the pressure to not require the case keyword.
Re implicit coercion: If we have enums that have primitive equivalents, we need some idea of when they can be used as that equivalent. "Never" undermines the use of the equivalent. My thinking is "at the IO boundary" (where everything becomes a string anyway) and "places the language already says 'meh, close enough'", which is mainly weak mode.
 
3:46 PM
@Crell Hey :) There are two main reasons I dislike grouped syntaxes: 1. They don't actually save a lot of characters 2. There's some ambiguity (not to the interpreter but to people) which modifiers are shared for all elements of the list and which can be repeated. E.g. public string $foo, $bar;, are both $foo and $bar strings? Or is $bar mixed? There was also a similar discussion on attributes just a few weeks ago.
That said, I can see the consistency argument. It's not something I'll fight against if people want it.
 
I can move that to future scope for now and see what people say. It's not on the critical functionality path and seems easy enough to add later without breaking anything.
 
@Crell Something we haven't talked about yet. Attributes on cases will just be added to the sub-classes. Does that make sense?
 
You mean like
enum Suit {
#[Foo]
case Hearts;
}
Yeah, I don't see any reason not to allow that. Although that begs the question of whether TARGET_ENUM needs to be a thing, or if it should just piggy-back off of classes.
 
@Crell Yes exactly.
 
4:14 PM
morns
 
4:27 PM
@IluTov I'm going to try and toss together a reflection section. That includes attributes, which for now I'll say "they're the same as classes." We can revisit later if needed. Cool?
I also updated it with an explicit list of excluded object functionality, and some more future-scope for static methods and grouped syntax.
 
@Crell Sure!
 
Hm, what does Suit::class or Suit::Hearts::class do? Seems like they'd do what you'd expect on a class. Are we OK with that?
 
@Crell People might expect just Suit but I think it's better to return the actual sub-class right away. So I think this should be fine.
Although I haven't actually put a whole lot of thought in it.
 
Sigfault on function call ・ Scripting Engine problem ・ #80371
 
4:47 PM
I only just remembered that bit.
I mean, if you're in a Foo\Bar namespace, then I'd expect Suit::class gives Foo\Bar\Suit. It's Suit::Hearts::class that might surprise people as giving Foo\Bar\Hearts.
 
@Crell If you're in the Foo\Bar namespace it'd give Foo\Bar\Suit::Hearts. I think that's ok.
And honestly, I don't think most people will even think of trying Suit::Hearts::class ^^
 
Quite possibly; but we still need to make sure it does something useful (for some definition of useful).
 
5:04 PM
@IluTov given other languages, I believe C/C++, when variables are grouped in one line, they're all the same type, I think that can be considered "consistent"
There is slight ambiguity, I admit, but putting same-types on one line alleviates boilerplate if there are a lot of variables of the same type.
 
@Tiffany C adds to the confusion, the type is shared, but not the pointers. For example, in int* a, b; a is int* while b is just int.
To make them both pointers you'd have to do int *a, *b;, always thought this behavior is terrible.
 
Pointers are annoying (being facetious)
They're powerful but confusing.
 
Morning
@Tiffany Learning C?
 
Do enums have any need to use references?
@Trowski C was technically the first language I "learned" if you count a ten year old reading a For Dummies book. I haven't written much C code though.
I can read C syntax well enough, but making sense of php-src is completely different
 
@Tiffany True, but they could've also just kept it consistent, int* a, b meaning int* for both variables. If you want different types, use different groupings.
 
5:20 PM
@Tiffany That's largely because so many things are wrapped in macros.
@Tiffany Small test: If I declare zval param[1], what is param?
 
@Tiffany I don't see where references would be useful, since they're singletons. Do you?
@Tiffany PHP isn't written in C. It's written in a proprietary macro language written in C.
 
@Tiffany yeah, it's always like designing space shuttle after studying high school physics.
:P
 
@Crell That's a good way to put it :-)
 
@Trowski zval, which I think is a char of one bit? Or an array with one index. I'd have to google to be sure if it's a char or an array.
 
...oh missread that.
 
5:29 PM
@Tiffany It's allocated a single zval on the stack, and param is a pointer to that memory.
@Tiffany zval is a struct, which wasn't really relevant to the question. A char is 8-bits.
 
@Crell I don't think references would be useful but there may have been an instance I haven't thought of. But by not having reference functionality available, that helps with ambiguity with grouped variables of the same type, I think.
 
cmb
I think the standard doesn't even mandate that a char is 8 bits (although for php-src targets it is supposed to)
 
@cmb Good point. A char is always 1 byte, but a byte isn't necessarily 8 bits.
 
Since when...?
 
Though I have never worked on a platform where it wasn't…
 
5:34 PM
@_@
 
cmb
Since "always". Some special LISP machines used 9 bit (1 bit to distinguish between stack and heap allocated values).
 
I recall a mention when I was in college of platforms where a byte was 16 bits. Again, never used one though.
 
@Tiffany I don't follow. How are references related to whether or not enum Suit { case Hearts, Stars, Moons, Clovers; } is a problematic syntax?
 
@Crell references are analogous to pointers in my head. @IluTov mentioned the C syntax for grouping pointers on one line is ambiguous
 
Ah. I think that's tangential.
 
5:42 PM
if references aren't used in enums, then the potential ambiguity of grouping variables of the same type on one line is lessened
 
I think we're talking about different things.
 
...
> 2. There's some ambiguity (not to the interpreter but to people) which modifiers are shared for all elements of the list and which can be repeated. E.g. public string $foo, $bar;, are both $foo and $bar strings? Or is $bar mixed?
 
Right, that's the modifiers. There's no modifiers in this case.
 
Ayup all o/
 
I see...I think...
 
5:50 PM
@Crell There's still some, e.g. case Foo, Bar { ... } do the braces apply to both cases or just Bar? It's clear to the interpreter (whichever behavior we choose) but to people it might not be. Again, this is just my point of view why I'd rather have zero grouping in the language. But it's a part I can just continue to ignore ^^
 
3v4l.org/Ss4XB that wasn't an immediate "ah ha" to me either
 
Well, I punted it to future scope for now anyway so we're good. :-)
 
How goes that enum challenge Crell, any closer to having something that can be coded?
 
6:06 PM
Pretty close. I'm working on the reflection section now. @IluTov says he can start for-reals implementation of the current step 1. What his timeline is for that, I have NFI. :-)
(Plus related pages I'm still populating.)
 
@Crell We'll see how quickly I progress, I have no clue to be honest. I think the question mark to me atm is making enums work in constant expressions. Other than that it seems relatively straight forward. I'll see if I can find some old implementations for pointers.
 
enums in constant expressions?
 
Can someone please answer me
0
Q: node doesn't start when I use exec() to run it

mr noobI am trying to create a website in which I can run a node app with php. it is not supposed to end and is meant to be run forever on the server even if the user leaves the php page. But when I run the code, there is no output and the node.js service (a discord bot) doesn't run. TestNode is the fol...

 
6:22 PM
@IluTov Hm. Having written the reflection section, I kind of feel like we do need to separate out enums for attribute purposes, rather than just reusing the object target. If they reflect separately they should attribute separately. Logical?
 
@Crell Suit::Hearts is a constant fetch, but now it stores an object which wasn't previously possible.
You should also be able to store it in other constants, like a constant config array for example.
 
Oh, you mean disambiguating SomeClass::AConst from SomeEnum::ACase
 
@Crell I'm not 100% sure how this will work yet but we just need to make it possible to store some objects in constant expressions which was not previously possible.
 
class Hand {
  private const DEFAULT_SUIT = Suit::Clubs;
}
That's what you're talking about?
 
Yes. Or a tiny bit more complex:
enum Env {
	case Prod;
	case Dev;
}
const CONFIG = [
	'env' => Env::Prod,
];
 
6:32 PM
Got it. Maybe that only works in a primitive-equivalent case?
OK, done for now. Gotta go do other stuff. Let me know if you have other questions, want to talk something through, or have a part of the implementation or tests that I might be competent to help with. :-)
 
@Crell Cool, thank you! Have fun doing whatever you're gonna do :)
 
 
1 hour later…
8:16 PM
Poor thing.
Also, 'eve.
 
8:56 PM
@Tiffany "The North Face" nylon hiking pants.
 
@Sara obv a very different proposition mens/womens (as discussed yesterday) but I concur with your choice of brand /cc @Tiffany
north face make some absolutely great stuff
"mountain warehouse" (in the UK anyway) is basically all north face stuff without the brand name so 2/3 the price
#protip
 
Allow ZipArchive to open archive from string or at least data URL ・ Zip Related ・ #80372
 
9:12 PM
@Tiffany recommended in terms of quality:price ratio at least
 
9:28 PM
@Tiffany Mine have five pockets. Two regular front pockets, one back pocket, and two thigh pockets. They're also convertible (you can unzip the lower legs and make them shorts). Whichever ones those are.
I just hit "buy again" every so often.
 
9:42 PM
Thanks
 
10:24 PM
I have a project that has about 500 commits but I need to remove the first 5 or squash them. I am not very experiecend with GIT. Is there a way to remove that history
 
@Dharman so, you basically want a rebase of all your git history?
 
yes
but when I do rebase -i root I get like a thousand conflicts
 
does a simple rebase -i work for you then?
 
how to avoid all these conflicts?
 
@Dharman Squashing them should cause no conflicts. Removing them will cause conflicts if the code from those commits was changed in later commits. You can achieve this with interactive rebase. This is one of the most useful things you can learn in Git. git-scm.com/book/en/v2/Git-Tools-Rewriting-History
In short, do git rebase -i --root, an editor will open, change the word "pick" to "fixup" (or "squash" if you would like to keep the commit message) in front of the commits you want to merge into the previous one, then save and close. Then you have to force-push to the remote server.
 
11:08 PM
No, this didn't work. I got like 50 merge conflicts that I had to fix and at the end the whole git got messed up
I don't want to change the other commit, I just want to fix the initial few
 
@Dharman That's what this would do, if done correctly ^^
You can always do git rebase --abort if you mess up
and try again
 
Then I must be doing somethign really wrong
 
or git reset --hard origin/...
 
I created a test branch so I just abandoned the branch now
 
And btw, you can't just change the initial ones. That's not how git works. Git commits are immutable. Instead, rebase creates a new set of commits based on the commits you want to keep. So if you're changing the first commit pretty much every commit is going to have a different hash.
 

« first day (3683 days earlier)      last day (1247 days later) »