« first day (4060 days earlier)      last day (1114 days later) » 

JRL
JRL
00:00
the two failing cases aren't hitting the ZEND_IS_GREATER opcodes at all it seems
this must be the optimizer
I was going to say - turning off opcache might be an idea....
JRL
JRL
well yeah, though i kinda need the opcache to not make the feature break php, lol
hmmm, who actually knows the optimizer? i could simply duplicate code paths from IS_SMALLER, but some of these I'm not sure.
From what I've read in here... Dmitry
JRL
JRL
like in dfa_pass.c, it's not entirely obvious what optimization is being performed for ZEND_IS_SMALLER if there's a... nested comparison inside a POST_INC or POST_DEC?
i'm not even sure what that code would look like... something like (0 < 1)++?
00:21
which file / line is that on JRL? Sounds suspiciously like something that might show up in a for loop
JRL
JRL
dfa_pass.c line 1445. It changes the nested opcode from ZEND_IS_SMALLER to ZEND_IS_SMALLER_OR_EQUAL. And again on line 1459 for POST_DEC.
oh hmmm
It's way over my head, but $i++ < $y would be equivalent to ++$i <= $y I'd think, but without needing to copy $i into a temp var first
JRL
JRL
ah i see
@Danack It's the unix system function for creating a file, shortened from "create" to save space.... unix.stackexchange.com/questions/10893/…
JRL
JRL
actually, i probably need to wait until i can talk to Dmitry about it tbh. For instance, !($a < $b) is optimized to ($b <= $a), but this optimization will need to be removed or changed as part of my RFC, since reversing the comparison order could now change the logic of the application if BOTH operands are objects
it can instead be done as ($a >= $b) now though, which is equivalent and will execute the same comparison method with the same arguments.
00:47
Oh great, they named the new covid variant omicron... because that totally doesn't sound like something that's going to destroy the world
It's better than "mu" because nobody can agree on how to pronounce it
The year is 2027, all modern alphabets have been exhausted, COVID will now be referred to by Unicode emojis.
JRL
JRL
running a new build should clear the opcache, right? or do i actually need to do that even after a new build?
@MarkR By 2027, I certainly hope it will be "just the flu" :-/
snooze o'clock
01:02
We shall see. I think I remember reading that this latest variant is likely due to a single immune compromised person.
01:28
lol is there an emoji for covid yet?
🦠
JRL
JRL
actually, maybe this is an issue with zend_compile? because i mean, the expressions are correct at runtime, just not compile time
How is it Saturday, it feels like it's wednesday... of next week
JRL
JRL
01:51
okay this makes no sense, lol
NAN is stored as a double, so it gets to zend_compare at compile time and splits into the type pair case for IS_LONG, IS_DOUBLE. This uses the macro ZEND_NORMALIZE_BOOL. But this is the exact code path that is used by both > and <. So the difference must be in how the comparison is actually being evaluated. As it turns out I think this takes advantage of a quirk of subtracting NAN from 0 in C?
so it appears i need to special case NAN just for the > operator because of how normalize bool works
02:23
Well this is impressive, my copy paste code job is so bad I've managed to segfault the make command.
JRL
JRL
wat
lol
exactly
JRL
JRL
i also apparently
have it set up so that stdObject > test === true
somehow
stdClass that is
02:43
for me it turns out rinit was the wrong place to instantiate a class entry facepalm
JRL
JRL
02:58
wait... i think this test is wrong
oh lovely
lol
this bug is caused by something that i hunted down to a // TODO:
i need to change the value of the ZEND_UNCOMPARABLE define it seems
though im not sure what the best value for that might be.
wasn't there mention of some kinda enum?
JRL
JRL
there was
i was really hoping to avoid that for the basic RFC though
there's always null, or is that used elsewhere?
JRL
JRL
the PR is going to be very complicated for people to review
null could be used, though then the ct functions for all comparisons will need to be updated
but that's the case for the enum as well
okay, well, looks like making an enum is truly the best way to approach this, so i now i need to look into how to create an enum in core
were there any enums already included in core?
It looks like the API is in zend_enum.h
JRL
JRL
03:13
im not sure where i should put the defs for internal enums actually
obv not in zend_enum, that's the API
probably in standard?
or core
JRL
JRL
hmmm. the comparable enum will be used in a lot of core files in the Zend folder
so I suppose in there
okay, well this is over my head, as far as the pitfalls to watchout for with creating a new .h and .c file and where they need to be run. i think it'll need to be initialized in the MINIT(core) call in zend_builtin_functions.c, but im not sure.
so i'll need some help with this whenever anyone has some time.
So I needed to change 10 lines in json_encode... and ended up having to copy the entire file, 800 lines or so.
JRL
JRL
03:29
ah no wait, if it follows the other patterns, then they would be added to zend_enum.c in the zend_register_enum_ce() function
It may be worth creating a new .h / .c pair so you can provide a single API location
JRL
JRL
my understanding is that the way enums were implemented the same API can be used in core or for user code
so it should just need the zend_enum.h
But you're thinking of adding comparison enums / APIs?
JRL
JRL
yeah
i don't see a good way to fix this uncomparable issue that is simply marked TODO in the code otherwise
anything else would be a giant hack
god, this means im going to break all the sorts too, lol
Better get ready for a twitter argument :p
JRL
JRL
03:40
twitter can suck it until twitter gets a vote, lol
i wanted to avoid this because i know that i could lose the entire feature to bikeshedding of the enum that isn't really the feature
im 5 minutes away from finding out if my days efforts learning how to write extensions were either positive, or a complete waste of time >.> I need to swap my mug of tea for vodka
JRL
JRL
errr, what? how do i set a zend_uchar to IS_UNDEF?
Z_TYPE_P(var) = IS_UNDEF or something?
oh, lol
just int 0
ZVAL_UNDEF(var)
JRL
JRL
huh, so then how am i suppose to use the enum in C later exactly. it looks like I need to have the enum ce in every context where i want to check the value.
i could have sworn that nikic said it was built to be used as an internal enum as well
04:43
Time for me to collapse into a heap. Good luck with the changes JRL
04:58
whats up
JRL
JRL
ooo, i forgot!
This was the enum that @Crell and I were working on
okay, well I'm gonna belt this out then
JRL
JRL
05:59
well this is a mess
anyone have any pointers on how to resolve header file includes? I need to include zend_enum.h in zend_operators.h, but that requires zend_enum.h to include zend_API.h which it currently doesnt. however, including it results in zend_API.h missing expected includes as well.
06:36
@Derick I'm glad the vote passed despite my "no" vote. I know, that does not make sense, but it shows how torn I am about this issue.
JRL
JRL
I know that feel @SebastianBergmann. Wanting to voice your opinion, but not quite sure if yours is the one that should be followed.
 
1 hour later…
JRL
JRL
07:58
well that's no good
zend_enum.h needs zend_API.h loaded first, zend_API.h needs zend_operators.h loaded first, and zend_operators.h needs zend_enum.h loaded first
so i'm going to delete/remove ZEND_UNCOMPARABLE and move it to zend_enum.h as ORDERING_UC
I'm going to run into a similar problem with ZEND_NORMALIZE_BOOL in zend_portability.h i think, but i'll deal with that later.
also, i apologize that i always provide commentary to the channel on my work, it's how i reason through problems as a programmer. i know some people find it annoying though.
08:15
morns
JRL
JRL
08:30
is there a preferred way to grab the zval from a zend_object?
09:05
Is there any specific English word that conveys "a clothing that can be used both for men and women"
09:28
@Derick Have you seen bugs.php.net/bug.php?id=81660 ?
@Derick Should it be sorted? Might be because it isn't mentioned anywhere in github.com/php/php-src/blob/master/docs/release-process.md ?
10:10
@RemiCollet Done
user13532951
10:30
I have a question, how would I filter database entries for expired dates? gist.github.com/YoKoGFX/d348b283e3bd8627161b5aeea79c76ac
user13532951
eventaries has a colum with "start" and "end" these are the dates of a course.
user13532951
This is the date format 2021-11-27 13:27:00
JRL
JRL
SQL has date functions, i would use one of those
user13532951
I already use the DATETIME for these entries in the database. But I have no idea how to get it inside PHP, because it is an array. I would probably need to foreach them but I think I could not pass them over from a laravel controller?
JRL
JRL
no, do it in the DB query
SQL has date functions
has anyone tried comparing enum cases internally? I'm kind of trial and erroring my way through it, and i have something messy that almost works here: github.com/JordanRL/php-src/blob/ordering-enum/Zend/zend_enum.h
the ORDERING_IS macro at the bottom
user13532951
11:14
Okay, here is the idea I have but it wont work with that: gist.github.com/YoKoGFX/e39df752e7ea3a0fae0afa67f6f4c4cb
user13532951
It just wont filter the courses
JRL
JRL
i dunno if you want to do it in laravel with all the magic
probably should check out the laravel subreddit for that
@PatrickAllaert i've seen it - but didn't have time.. I thought I fixed it
@PatrickAllaert Yes, it should be sorted. Like every other one always has been :-)
@Derick Wasn't sure you got notification from bugs.php.net
I get the emails
11:19
@Derick I never paid attention. Fixing it now.
JRL
JRL
11:40
so @Crell i'm not even like a third done with the ordering enum and its already touched so many things: github.com/JordanRL/php-src/pull/2/files
11:56
What's the reason for wanting to change this from a simple "int" API to one that uses zend_object ?
JRL
JRL
two main reasons
1. the way that ZEND_UNCOMPARABLE is handled is basically broken and is only working because of magic in the compiler. this makes it easier to normalize comparison results.
it becomes actually broken instead of basically broken as soon as i introduce the IS_LARGER opcode
2. providing an enum in core for users that has valid ordering cases that can be used as return values in user defined sorting functions
which will also allow us to expose uncomparable for userland
which is totally impossible now
well actually... i think that it's technically possible to implement uncomparable in userland right now by returning 1 for the > and < case of the same values, but that's undocumented and unintuitive and still wouldn't work with the IS_LARGER opcode
supposedly (i was told) enums were implemented in a way that lets us use them internally as enums (sorta) in addition to being userland enums
though that doesn't seem to be the case quite. i've had to add some helper functions to the enum feature to make that a plausible reality.
maybe im using it wrong though
 
2 hours later…
13:34
Congrats on PHP 8.1!
One question though, is it a major or a minor release? (php.net says it's a minor one, while https://www.php.net/releases/8.1/en.php says its a major one..)
its a major minor release
Sounds dissonant ;-)
technically it's a minor release, but PHPs versioning is weird, each x.y release brings major improvements and all the bump in x means is deprecated behaviour gets removed, other than that its nothing special
Wes
Wes
\o
Yes indeed, it's business as usual.
o/
Nikita is switching PHP for Rust? Interesting move.
13:54
@Code4R7 LLVM, which is mostly C++.
I can see why he's moving on... PHP has an elephpant mascot, LLVM has a freakin' mirror force dragon like something out of YuGioh en.wikipedia.org/wiki/LLVM#/media/File:LLVM_New_Logo.png
@JoeWatkins I just applied 🎉 I entered February 1st as the start date but maybe I'll need to negotiate with my boss.
\o/
@IluTov intending to join the foundation?
@bwoebi Yeah, 40%
@Code4R7 I think the "major" here refers to the fact that it contains a lot of stuff. It's a "minor" release in terms of semantic versioning.
Although we also don't really follow semantic versioning.
@bwoebi Are you joining? I think you expressed interest but you recently changed jobs?
14:08
@IluTov have you given thought to what you might work on first? :)
i mean presumably you have as it's on the application form i think? :P but i mean that you can share with us
@MarkR I answered more broadly in the form (new features, maintenance, fixing bugs and such) but no specific features. I think my first priority is just to do maintenance and get a deeper understanding of the code base. I'd like to really understand the optimizer at some point.
As for new features, I have a list of things I started, I'll need to take a look there :)
14:26
It'll put you in a strong position to direct PHPs future.
@IluTov Don't we all have such a list :D
I applied as well, but I think there's a bunch of people way more capable of working in the core than I am..but still I'd love to ditch my day job and focus here
Next step, rewrite the entire thing in C17 or Rust? :P
14:43
@MarkR C17 is not really hard
As C11 and C17 are the same thing
@Girgias I have my own list :D
@Girgias Are you applying?
@IluTov I sent in the form yeah
I'm back at the phase of writing a feature which is "bleh RFC document writing"
@Girgias I should have written C++ ... but a week ago I think I saw mention that PHP only used the C99 spec?
@MarkR Mainly yeah, but why would you want to use C++...
Well you could delete a not insignificant chunk of manual cleanup for one
14:51
@Girgias Nice :)
@Girgias Typed data structures, mostly :D
@IluTov Neat, currently it's a new autoloading mechanism and DNF types
Imagine not having to use a macro to set a variable, or get the length of something O_O
@MarkR You know you don't need to use them? They are there to make the code more readable
Also allows changing the internal structure to some extent
Yes I'm aware of that. But I'm fairly sure in the context of C++ I was thinking in terms of operator overloading and such.
I really have trouble seeing where operator overloading would be useful within php-src
15:01
Making it even more inpenetrable ?
adding official support for extensions in rust might be cool though.
Rust certainly seems like it will be the future, especially if MS and the linux kernel get on board with rewriting sections with it, which seems likely
Though actually, being able to include PHP code in an extension is probably a higher utility.
Something other than just evaling it?
15:19
@MarkR There's still some issue with that I believe - bugs.php.net/bug.php?id=76982 but the next question would probably be "does it need to hook into autoloading, or is that code always evaled", and I have no idea.
It seems like that would be best put into the preloader if anywhere, although come to think of it the support for that isnt universal?
cmb
cmb
no preloading on Windows :(
15:43
Happy Saturday y'all o/
ey up lad.
I'm trying to extend a class defined in an extension, but I'm getting "cannot assign to readonly property" when defining the readonly property in the child. What is it that I have to do to properly allow extending internally defined classes?
Is this along the same lines as a readonly property for the json cache?
Attempting to cache the json string internally rather than calling the user method each time.
16:20
@Girgias What I meant was that C++ would be nice for typed data structures in php-src ^^
Wes
Wes
i hope niki left because he finds rust more interesting and not because php is impossible to work on (because old and because too conservative people) because that would suck
@Wes llvm btw.
and somehow Rust is possibly more of a shitshow than internals - github.com/rust-lang/team/pull/671
16:35
You know it's fun when you're directing people to Reddit to debate moderation
Although I'm kinda sad their subreddit is r/rust and not r/ust
and then those moderators close the thread for being too hot.
16:53
I must say it's nice to see positivity on the reddits about 8.1 and the dynamic properties passing.
17:03
TFW setting up bitlocker and it asking for a password upon restart, but realized it's in my password manager. Split second panic, then relief.
17:32
@IluTov Yay!
@Girgias The one thing I can actually do. :-)
@JRL I was wondering how that was coming. To my entirely untrained eye, it looks like it touches a lot but only because it's swapping magic constants for a logically meaningful value, no?
 
1 hour later…
18:44
twitter.com/ChrisRackauckas/status/1464595939948208132 + High-performance symbolic-numerics via multiple dispatch - someone can translate into english? Preferably single syllable words....
ohnoes the thing that won't take effect for about 3 years is causing havock 1092 days before it actually has any meaningful effect.
Hi. It's been years since I chatted here. Just a quick question do we have any way to get an expression tree of the function (at the php level) of \Closure?
I think you can use Niki's AST extension to do that, but not on an object, but rather on the source code file that ends up creating it.
@Derick Checked that also but that's rather static code analysis which I would not do for an interpreted language. The idea obviously is to use closures for building sql queries dynamically with nicer API than having bunch of strings all over the DAL.
18:54
Oct 23 at 10:59, by Joe Watkins
(by the time PHP is executing the AST is gone)
That hurts but then makes sense. Thanks for clarifying.
@Leri what you're asking has popped up a couple of times, so is probably worth having a discussion on internals about.
I don't understand that part of the engine, but memory is cheap, and it's not obvious that throwing it away is the correct thing to do.
@Danack Yes, the idea obviously is to have AST available, AST will be beneficial for lots of stuff starting for improved ORMs finishing by better caching. Once it is converted to OP codes I guess that parser results are thrown away as of now at least in the past (I have not touched php since version 5.3) that was the case as far as I recall.
Juliette: Dynamic properties are still supported when a class is given the #[AllowDynamicProperties] attribute, though this attribute is expected to only be supported for a limited time (until ~PHP 9.0) as the intention is to eventually remove support for dynamic properties completely from PHP (with the exception of the above two situations).

What?
Also extending the reflection might be another way of doing that, however, I am not sure how function tables work in the latest releases
19:01
@Leri One completely random thought, the observation api (which is newer than 5.3) could have something added and exposed that receives AST_GENERATED events and code to be written that grabs the results you want to keep....
That's on github.com/squizlabs/PHP_CodeSniffer/issues/3489 btw. I don't believe internals has expressed any intent to remove them after going down the #[AllowDynamicProperties] route, only that the RFC says it will make it easier to evaluate the option should it come?
somewhat serendipitously I just wrote elsewhere - lets just steal literal strings from JS.
@MarkR That's actually a perfect thing. Imagine in the middle of nowhere you have random member accessed, you cannot find it anywhere in the class definition then you find the implementation inside "__get" function which has few hundred lines of pure spaghetti code. :)
@Danack I always thought it was intended for debuggers however, you might be onto something really interesting. Let me look into that. Thanks
Perhaps an attribute to keep the AST of a class/function/method available for reflecting on? So you only opt-in to the memory needs of doing so.
@Crell Attribute would not be good for the API in my opinion. I think the most obvious way to use that would be in data access layers as follows: $articles = $ormContext->ofType(Article::class)->select(fn(Article $article) => $artcile->title, fn(Article $article) => $artcile->shortDescription)->where(fn(Article $article) => $article->disabled = false)->skip(20)->take(10);
19:15
Ooo, so moving Doctrine's DQL approach into PHP code directly, in essence.
If I had access to AST of Closures, I could convert it to the SQL for example: select title, shortDescription from Articles where disabled = 0 limit...
@Crell I have very strong feelings that we should avoid reaching for attributes as a solution first. We're going to end up with too many in a few years time, anyway, but they are an easy out for thinking through a well-designed API. This can also be pronounced as "makes it more likely to slip bad ideas in core without thinking them through fully".
@Crell Exactly, however, it could be just one use. Actually, C# is a good example how versatile ExpressionTrees/ASTs can be
@Danack I do totally agree. My main language is C# which actually wants you to use attributes, however, I try to avoid them whenever it's possible because code easily becomes unreadable, unmaintainable and much harder to debug.
@Leri I dig it. I wonder if it would allow for something like LINQ...
More of an open question / comment, but with the foundation, can internals please give consideration to moving handling of the docker images into the official release pipeline? Docker is the de-facto tool of choice for most new development and 8.1 isn't available on the "docker official" images.
19:29
@Danack Fair. I just want to avoid the memory overhead of keeping the whole AST around; in part because I'm pretty sure that would never pass if Dmitry has anything to say about it. :-)
@Crell Absolutely, if you can read which members are accessed via the arrow function and if it's appropriate why not. Obviously, php does not have generics so similar functionality of LINQ would be more runtime errors than syntax errors though
I can accept runtime errors if they're still enforcing good behavior, and allowing more robust syntax.
Compile time is better, but runtime is acceptable.
@Leri insert example of java object with 20 attributes here
lol
At least the 3x10^8 votes we had on attributes provided an easy BC compatible upgrade path for the property deprecation.
19:32
@Crell Yes, I totally agree. I was actually rewriting/upgrading my old php framework and figured out we don't yet have AST that's why raised this topic anyways.
@Crell yeah....that's the key point and why I'm going to appear to overreact when people suggest it. It's a form of "why don't we just do X" question, which puts the onus onto other people for finding a reason to say no, when it's much better for there to be a good reason for doing something a particular way. aka don't rely on Dmitry to notice.
@MarkR Getting there was messy, but the end destination is pretty nice. :-)
@Danack Correct me if I am wrong but technically we could cache AST for closures similarly we can cache OP codes. That would mean minimal overhead. Or we could introduce ClosureExpression extends Closure class which will have all the exposed methods we need to get closure expression tree. This way we don't drag the entire AST but we have reasonable way to see what members are getting accessed
Also, the question is whether this is something intended for runtime use or user-compile-time use.
How could compile time work without native support?
19:43
I'm not sure; just spitballing at the moment.
It would need some kind of native support, but I don't know what exactly.
function where(ClosureExpression $expr) { if ($expr->getNodeCount() !== 1 && $expr->getNodeType() !== ClosureExpressionNodeType::MemberAccess) { throw new \Exception("Only member accessing closures are allowed"); } return $expr->getNode(0)->getReturnedMember()->getName(); }
This is just very raw example how I imagine ClosureExpression. This just an idea so the usage would be more clear.
@cmb Uh oh. I just merged a passing PR, and Circle CI sent me an email that a workflow failed. What did I screw up?
@MarkR i replied....
@Leri I'd correct you if I had any understanding of how that part of the engine worked. But I don't.
@Danack Thank you. We can do without the FUD.
JRL
JRL
20:19
@IluTov I was digging pretty deep into the optimizer last night as part of the IS_LARGER opcode, and definitely feel like there be dragons there.
@FlávioHeleno I feel the same way considering that I only started working on stuff four months ago and haven't even brought anything I've worked on to a vote. But at the same time, I look around and try to keep in mind that most of the things that I use most in PHP were brought forward by just a few people. The whole group contributes to making it the best it can be, but one person can really do a lot here by driving towards the goal they want.
@JRL definitely! I started studying the core past December, but had to leave it for a while and now I want to get back to it. I'm still coding simple extensions here and there, but I want to try and tackle some actual work asap :)
JRL
JRL
@Crell Yes, exactly, though I haven't gotten to the two most disruptive parts yet: setting up all the sorts to understand the enum, and making them accept the dual input of either int or enum.
@FlávioHeleno I have two features I'm currently finishing that you could take a look at even if you don't want to contribute to them. :) though everyone comes in with features in mind, I think.
@JRL it would be awesome!
JRL
JRL
the one i'm working on right now is switching all the sorting/comparisons in the Zend engine and bundled extensions to using an ordering enum instead of -1, 0, 1.
what's the idea behind changing the literal by an enum?
making code more readable?
JRL
JRL
20:38
@FlávioHeleno Two main ones: 1. The fourth comparison value (uncomparable) is poorly implemented and supported currently, and enums provide a more stable way of handling them. 2. Using enums allows the internal implementation and userland implementations of things like sorts and comparisons to be identical in featureset and capability. (Using 'uncomparable' in userland right now is essentially not possible.)
Hmm did github die?
@MarkR yep :(
getting 500/unicorn
@JRL got it!
20:39
@MarkR Free at last, free at least, thank god I'm free at last.
@Danack Come to the dark side... use gitlab, we have cake.
JRL
JRL
it also does make it more readable though, yes
if you'd like to work on it too, once github comes back up, it's JordanRL/php-src:ordering-enum
it's like 1/3 finished right now and won't build because i'm currently ripping everything out
cool, I'm gonna take a look, thanks for sharing :)
JRL
JRL
oh @Crell I was thinking late last night that backing the enum might actually be good... IF we can use NAN as the backing for Uncomparable
JRL
JRL
20:53
is anyone working on type aliases currently?
@JRL not that I'm aware of. are you thinking of any particular kind? e.g. callable type definitions or something else?
Huh, github seems to be seriously down -- including git
JRL
JRL
@Danack I have two pretty significant features on my plate right now that i both want to get to a vote for 8.2, but it's in the back of my mind as the third feature i'd like to work on. In my mind, it would essentially be a named literal that caches the typedef AST or something.
Girgias has work in progress (real life permitting) of a function autoloader, which would probably make some RFCs related to type stuff easier to pass.
> a named literal that caches the typedef AST or something.
uh, I have no idea what that means.....
JRL
JRL
something like typealias MyTypeName = (A&B) | null | int; fn (MyTypeName $var) {...}
my initial though would be that all aliases are global scope, that there's no such thing as scoped type aliases
i would hate runnign across the same custom type name meaning differen tthing sin different scopes
21:09
@NikiC I just did a push, so perhaps it's working again
@JRL you mean they can't be declared within a namespace?
@JRL The first part of that is just defining types. I don't understand where anything related to AST or caching comes in.
JRL
JRL
they can, they just aren't part of the namespace. again, initial thoughts i haven't actually sat down to to look at implementing it yet.
namespace JRL {
    typealias MyTypeName = (A&B) | null | int;
}
namespace {
   var_dump(type_exists('JRL\MyTypeName')); //true
}
types belong as part of the namespace system imo.
Unless someone has a strong reason for them to them not.
that would be *really* bad.

namespace Http {
type Input = string|RequestBody|StreamInterface;
}

namespace Cli {
type Input = string;
}

IMO, these shouldn't clash, they should respect the namespace system, just like functions, constants, classes .. etc.
JRL
JRL
21:15
@Danack I was envisioning that because they don't have scope, it's all handled statically. like i said, i haven't actually sat down to think about it too much yet as i'm focusing on the two features im working on, but since it would be all compiletime in my mind, i would be looking at ways i can take advantage of caching and of storing the typedef as AST in the caching if i could do that. it wasn't a concrete plan of implementation. :)
and fair point about namespaces, i just want them to be statically analyzable, meaning no dynamic expressions in the types
i don't think they should depend on the execution state or context is really all i'm saying on that point that i'm pretty sure about
@JRL you mean stuff like type Input = PHP_SAPI === 'cli ? string : string|RequestBody?
JRL
JRL
@SaifEddinGmati yes exactly
tho, even that can be statically analyzed, but more complex expression can be painful to analyze
in that case, the static analyzer should consider Input to be string|string|RequestBody ( union of all branches ), and reduced to string|RequestBody.
but i can see how it would be annoying to deal with when you know your application only runs on CLI
@JRL I'm not sure anyone would expect them to be dynamic. PHP doesn't allow any dynamic stuff in class Foo extends Bar implements Quux.
JRL
JRL
@Danack yeah, perhaps, but it's the one concrete thought I've had on the implementation since you asked :)
i could imagine people wanting to do logical math operations on it. something like type Input = string|RequestInterface; type WebInput = Input - string; that's something i want to avoid.
21:29
@JRL well, didn't think about that, but now i want it :)
JRL
JRL
that expression can be statically analyzed, but i just want to avoid expressions entirely if possible.
it would certainly be useful in certain circumstances
actually, only - would be meaningful, does + mean union or intersection? what does * mean? what about /? or **.
JRL
JRL
with DNF, - would remove an or block i would think
unless we have literal types.

type T = 1|2;
type T2 = T**2; // 1**2|2**2
JRL
JRL
+ would add an or block
21:32
actually, i can see it now, let's agree not to have expressions lol
JRL
JRL
* would & with all or blocks
right, lol
/ would remove an & from all or blocks it appears in
@JRL Btw I started with an implementation for typealiases at some point, I'd link it but since Github is down I can't ^^
JRL
JRL
nifty :)
i don't think i'd be able to finish the orderign enum, operator overloads, and type aliases in time for 8.2
The general strategy was to create a class and mark it with a flag, store the given type in it and then replace it when encountered at runtime. There were some limitations with class_alias but I don't remember the details.
@JRL What's ordering enums?
JRL
JRL
oh @IluTov, you did enumerations, right? was there a way/preferred method of using and checking them internally? like if i wanted to define an enum and then use it in php-src in addition to it being available in userland.
I'm trying to replace comparisons in php-src with an enum based on your work
instead of -1, 0, 1
to resolve the issue of ZEND_UNCOMPARABLE being sort of broken once I introduce an opcode for IS_LARGER
21:40
@JRL There's an API to create internal enums now. I'm not sure if stub support was added already (@bwoebi worked on that one). Check the zend_enum.h file. I don't have php-src cloned on my new machine and Github is down, so I have no way to check atm.
JRL
JRL
ah, yeah. creating it was really easy, but checking and using the values internally has been... less easy.
I added two helper functions to zend_enum.h so far to check equality of cases for two zend_object pointers that are both enum cases
one to check by name, one to check by value
@JRL What do you mean by checking? Whether one value is the same as the other? You can just do an identity check.
You shouldn't have to check by name or value.
JRL
JRL
@IluTov well that's... logical
21:58
@JRL I don't think so. Only ints and strings are allowed, and NaN is, I think, technically a float.
JRL
JRL
@Crell it is a float yes but it can still be checked as NAN using zend_isnan()
@JRL But enums only allow their backing value to be int or string. I'm pretty sure enum Foo { case Beep = NaN; } is syntactically invalid in all cases.
JRL
JRL
22:24
@Crell ah too bad
22:55
GitHub is back!
23:07
Would strftime('%w') ever produce different results than date("w")?
What is the alternative to Pthreads:kill in the new version?
@SaifEddinGmati not complete: githubstatus.com
@NabiK.A.Z. it works on my machine :p
@SaifEddinGmati Yes, the site opens, but according to gitstatus, some services are down.
23:32
status page usually takes a bit to update, now it's all green
what type of green?
23:56
@IluTov Oh
A vial of purest greeeen... because baldrick is running devops
@IluTov That seem pretty... bad IMHO, let me get the new autoloading system in place so that we can have something dedicated to types instead of piggy backing more on top of classes
Also acceptable, but was thinking of youtube.com/…

« first day (4060 days earlier)      last day (1114 days later) »