« first day (3861 days earlier)      last day (1070 days later) » 

12:02 AM
will do it :-D
 
12:54 AM
hooray!
I'm just really excited that my code is starting to work 😊
And now also that hopefully more people will be able to build PHP with GD
 
1:16 AM
Interactive Shell Hangs Indefinitely ・ *General Issues ・ #81033
 
1:56 AM
I think I'm on a mission to shred web-php from all the cruft
 
@DaveRandom Other GD files use zend_error(), so I think this one should be changed for consistency! But when I made a quick change, more things broke, so it would need more work - and I suppose it should get a PR of its very own
 
 
2 hours later…
4:22 AM
@Derick Figured out what the colors meant in the backtrace. The brown background indicates the call was within vendor code, otherwise the call is within the project source.
 
 
1 hour later…
5:22 AM
o/
 
 
2 hours later…
7:06 AM
@kelunik @Trowski Have y'all happened to have seen a real use case for running multiple loops at once? Ignoring the inherent complexity of managing multiple loops running is there some reason you would suggest not doing it?
 
7:51 AM
@cmb I don't think diagnostic info is particularly important there...
 
 
1 hour later…
9:04 AM
I just wrote an extension in order to close a bug report ... and answer a question ...
/me flexes muscles
 
what's the question it answers? something to do with the airspeed of an unladen swallow?
 
also their profiler leaks, but I got bored of looking at it ... also, nobody should use it, ever ...
 
@JoeWatkins wow, fair play, you certainly know how to answer a question.
and maybe no-one should use, but it really gives them something to work with.
 
9:21 AM
no I meant their profiler, the ext I wrote is a demo, not useful to load except to look at ...
(it will print a long name of every closure zend constructs, really not useful)
 
I'd still say it was useful (giving them something to work with).
 
Might be the first extension I've looked at where I could actually make sense of what it was doing. Your demo, not the profiler.
Makes me wanna learn C but I have too much on my plate right now for that
 
9:35 AM
Xdebug has been naming closures as {closure:path:lineno} for ages ...
 
mysqli_result::free emmits exception/warning ・ MySQLi related ・ #81034
file_get_contents emits not silenceable warning on http file not exists ・ Filesystem function related ・ #81035
 
9:51 AM
@Derick yeah, that seems like enough most use cases, but they wanted to replicate more closely the hhvm naming which included declaring method names ...
that's why won't fix, if we do give closures names, it will likely be closer to something like that (file:line) ...
 
10:22 AM
@JoeWatkins Just read through the partial application proposal ... it seems pretty confusing :/
 
TypeError is raised instead of implizit type casting ・ *Programming Data Structures ・ #81036
 
@JoeWatkins showoff :P
Joe showing everyone who the boss is ^^
 
@NikiC hehehe, my php muscles are warming after a few months rest ...
@NikiC which bits are confusing ? or in general the language, or what ?
 
@JoeWatkins I think a large part is the passthru of extra args
 
10:40 AM
it looks consistent ?
although the language in the rfc is not very clear, I think it should behave like that ...
as always, very open to being told otherwise ... but I based the implementation on being consistent with what happens now when you pass extra args
afk but eager to hear thoughts, back in a while
 
@JoeWatkins I'll have a look at the implementation first ... implementation often makes things clearer :D
 
11:04 AM
@CharlesSprayberry You can't run multiple loops at once, and you shouldn't. There can only be one scheduler in cooperative multitasking.
 
@kelunik Ok, that makes sense and is what I expected. Wanted to make sure my assumptions were accurate. Thanks!
 
With the fiber version that's finally solved, because we can just switch to the scheduler fiber instead of potentially recursive runs.
 
Neat. In all honesty even if it were possible the more I think about it the more it makes sense to avoid multiple loops running. My problem would be better solved with a different design.
 
having multiple loops running is like having your calendar managed by multiple secretaries, none of whom are aware of the existence of each other
 
I'm thinking more about the situation where managing multiple calendars each with their own secretaries and I don't want your secretary looking at my calendar.
 
11:17 AM
@NikiC yeah, I hope so ... I left some comments in a self review to help, hopefully ...
 
@BenMorss I'm super happy to work on this kind of thing :-D thanks for letting me help!
 
cmb
@NikiC, re interactive shell/mode: IIRC the message is fixed at compile time; if you build ext/readline separately (like distros do), you get the "wrong" message.
 
morns
 
11:32 AM
@JoeWatkins hats off to you sir. your knowledge of php internals is amazing!
 
@CharlesSprayberry the analogy ran out of legs very fast... what are you trying to hide?
 
@DaveRandom lol yea it did
Imagine an async application that has its own DI container, event emitter, logger, and other dependencies. Something else manages the loop that these async applications run on. You could potentially have n applications running. If one application does something that causes the loop to slow down or block or error out I don't necessarily want the other applications running to fail because of that.
 
that's just a fundamental limitation of co-operative multi-tasking, everyone has to co-operate :-P
 
Well, I could defer each application to its own process, yea? That would run inside its own context and wouldn't be impacted by the others
 
by "application" you mean like "web application container"?
like a virtual host on a web server?
otherwise, why are you trying to smash multiple apps into one process? :-P
 
11:44 AM
@DaveRandom hrmm.... maybe? it is more generic than that. an application is ... something that performs some business logic doing async code. maybe it is a web application container, maybe it is a background worker, maybe it is a cli application, maybe it is something else
So I have the testing framework that has its own dependencies and events that it emits. It is its own application. By itself the testing framework doesn't actually emit any output. You need a client application for that. In most cases this is going to be a CLI app but could be something else. The client interacting with the framework is its own application with its own dependencies.
I don't want your client dependencies to pollute what the framework is doing.
Ultimately I think that this is coming up because I'm trying to shoehorn symfony console into something async and it influenced my design of the framework
 
ah yes but that is a somewhat specialised scenario, that is a "meta application" if you like because it is specifically a dev/debugging tool
 
@DaveRandom Yea
 
and that does not have the aforementioned "security" concerns by its very nature
if you want "performance" isolation (as it were), you want another process with its own loop
 
Yea... that's what I'm thinking
 
but then you are just using standard IPC techniques for data exchange and the fact they are both PHP is irrelevant
 
11:48 AM
For now I'm going to keep punting this particular problem down the road until some other things are more fully established. Doesn't make sense to add this level of complexity yet. But it was rattling around in my brain on how I could do it I had to satisfy the itch.
 
the only reason to join things into one proc (that I can see) is if they need direct, trusted communication and trust each other
I may be missing something tho
 
Likely what I will do for the specific case of the testing framework is eventually get to where each test suite runs in its own worker process
 
that sounds potentially reasonable
 
Yea, and maybe even preferred
It ensures code relating to a specific test suite stays isolated from other test suites
 
my brain hurts when I think about concurrent testing, ideally you would basically run each test in a chroot jail :-P
 
11:51 AM
Yea... I want to eventually get to that point
Or something like it ;)
But one step at a time!
 
yeh, I dunno if what I said there was in any way helpful either :-P
/out on jobs, bbiab
 
@DaveRandom It was! Thank you for the input. Sometimes just having the ideas bounced around helps :P I'm still at the spitballing stage of this and prodding around at what's possible
 
@CharlesSprayberry If you want isolation, don't use cooperative scheduling :D
 
@kelunik Yea... just needed to get my thoughts fully fleshed out and out of my head :P
No good when the rubber duck starts nodding along to your half-cocked ideas. Better make sure you check yourself before you go any further.
 
12:27 PM
Morning
 
12:42 PM
o/
 
@FlávioHeleno we should probably document it better, but php run-tests.php ext/foo/tests or similar.
 
@Danack thanks!!
 
1:13 PM
o/
 
@cmb oh right
 
cmb
well, you fixed that yesterday, I think :)
 
yes
though that wasn't my primary intention...
 
1:27 PM
we can all see that your intention is clearly to degrade the experience of the swarms of people that are using ticks in non-interactive interactive shells
 
1:50 PM
I'm curious, where does pcntl_signal et al interact with process flow? I use those extensively for CLI based scripts to use graceful shutdown, but its docs say: "PCNTL now uses ticks as the signal handle callback mechanism"
So would the removal of ticks kill pcntl?
 
@MarkR no. It means that people should be checking for signals in an appropriate place, not having it occur randomly somewhere in their code. github.com/Danack/LoopingExec is a library for running stuff and checking the signals.
 
@MarkR No, it means our docs are outdated (surprise!)
 
@NikiC PCNTL does register a tick function tho
 
@Danack So if I'm reading this right, ticks don't matter as long as pcntl is not in async mode?
 
2:06 PM
That's one way of putting it. Another would be 'using pcntl in async mode is really bad and no-one should be doing it'.
 
@Girgias It does, but you shouldn't be using it...
 
Well that's another thing :D
I don't use PCNTL so I woudln't know :p
 
My primary usage of the ticks feature has been as quick and dirty conditional tracing tool for debugging
 
… but tbh ticks got much less useful a couple years ago since it got file-scoped for whatever reason
 
2:19 PM
@cmb Interesting, ty.
 
2:56 PM
@MarkR Perhaps surprisingly, Amp doesn't use async signals. The native loop calls pcntl_signal_dispatch.
 
@Trowski Not really surprising -- an event loop is exactly the case where using manual dispatch makes sense :)
In most (non-event-loop) applications, you just don't have that central place that is guaranteed to be regularly visited
 
My existing code uses async handlers which just set a variable to pick up later in the loop, having seen Danack's example I've switched it to dispatch on each loop (where i'd otherwise check)
 
3:13 PM
@NikiC I'm want to drop a new thread with a poll on what people understood for the namespacing in Core, standard, and SPL to see how widespread the misunderstanding is. Then we amend the RFC to be more explicit.
Sound good?
My use of "MAJOR" was an overreaction -- it's important, but not major ^_^
 
@NikiC Exactly, but the "async" on the box has led some to assume the opposite.
 
@LeviMorrison Please ascertain first that there is anyone but you who had this misunderstanding.
Did anyone in this room read the namespacing RFC as forbidding the use of namespaces inside the core/standard/spl extensions?
 
@NikiC Err... that's what the thread is for? I know for sure there were people who understood it to be that way on Reddit, but dunno about people with voting privs specifically.
 
IMHO the RFC is completely unambiguous, especially if you take the following sentence with examples into account
 
That next sentence is followed immediately by:
> (These are non-normative examples, the RFC does not propose using these specific namespaces.)
 
3:16 PM
The RFC in general (not just for ext/standard) does not specify any specific namespaces, and specific namespaces of course need to be decided on in RFC discussions -- just like any other symbol names that are being introduced
 
It wasn't "can't use namespaces ever in these exts" it was rather "these are still not well defined, but definitely do NOT namespace them as Core, standard, nor SPL."
 
Yes, that's exactly it. It says you can use namespaces, but they can't be called core, standard or SPL
 
@NikiC I understood it as not to use a blanket namespace for the components in those extensions such as Core or SPL, but not forbidding a namespace. As you suggested, str_contains could be Str\contains.
 
Random question: Would it be at all feasible/possible to enhance anonymous classes such that the class being extended or any additional interfaces could be specified by a variable rather than literal? Like $a = new class extends $parent { ... }; Could the engine even take that?
 
@Trowski Yes, that was the intention
 
3:17 PM
I remember debating it extensively in here, I read it as a "extensions get namespaced, and core / std can be to" but the last bit seemed distinctly unfleshed out, as was my concern that we'll go super fine grained and flood root with std namespaces rather than the HH approach with the HH
 
@Trowski But not really... as the string functions don't currently have str\ ?
 
But they could. Why not introduce namespaced aliases such as Str\contains or Array\push?
 
That wasn't part of the RFC, AFAIK.
 
@Derick "If we were to introduce namespaced aliases (which is not part of the RFC), then they could be called like this" :)
 
And I would fight superfluous aliases. THey don't really add anything.
@NikiC Yes, exactly how I read it.
 
3:19 PM
No, that would require another RFC.
 
@NikiC But whomever decides to propose any namespace in these exts are going to have to fight internals to permit it, because there has been no consensus at all on what these namespaces look like. Yes?
 
That was my concern with the RFC ^ When voting I took the approach that we had to at least do something to get us on the path, and Nikic was likely the only one who could get an RFC passed
 
Aliases might provide an opportunity to clean up some of the std library inconsistencies, though named params fixed the biggest complaint.
 
@LeviMorrison Not really? I mean there could be disagreements on whether RNG\ is really the best namespace specifically, but there shouldn't be a fight on the abstract concept.
 
@Trowski People have been suggesting to clean up the API for decades. It has no benefit, and adds more confusion.
 
3:21 PM
@NikiC I could see someone thinking that, but with the example of Str\ and Password\ in the next sentence that seems like a pretty solid endorsement of "namespacing stuff in those logically instead of structurally". That's how I took it, anyway.
 
@NikiC It can be RNG, Random, PHP\Random, and many more options. None of them are "sanctioned" and therefore must make it passed internals.
 
I thought PHP\ was explicitly ruled out?
 
It doesn't say that it must be $component\$things where $things is NOT a sub-namespace.
 
@LeviMorrison My personal view here is that you should consider ext/standard a collection of different extensions, that we bundle into one to avoid the extension boilerplate for each tiny bit of functinoality
@LeviMorrison PHP\Random is explicitly forbidden, but both RNG and Random are viable choices -- but just that, it's a naming choice.
 
@NikiC Where is it forbidden?
The RFC says:
> The PHP namespace would only be eligible for bundled functionality directly tied to PHP, such as built-in attributes, altough the exact dividing line is unclear.
Let me put some emphasis:
> [although] the exact dividing line is unclear.
 
3:24 PM
I think Levi, you should go back and read that RFC
> ThePHP Namespace Policy RFC sought to address this by introducing two vendor namespaces for extensions: PHP and Ext. The latter may be used by all extensions, whether they be bundled or 3rd-party. The PHP namespace would only be eligible for bundled functionality directly tied to PHP, such as built-in attributes, altough the exact dividing line is unclear. Most symbols would be part of the Ext vendor namespace.
 
I already quoted that.
 
That was PHP namespace policy from Crell and Myself
 
This is the full quote. This paragraph is talking about what a different RFC proposed
I'm not sure how you could possibly misunderstood this so badly, given how forbidding a vendor namespace was pretty much the whole fucking point of this RFC
 
@NikiC Sure, but where is PHP as a namespace forbidden?
I just looked through every string of "PHP" on the RFC.
 
> Extensions should not use a vendor namespace.
 
3:26 PM
Yeah, but Core, standard, and SPL aren't considered extensions, or are, but it's murky because they are part of the language, not disable-able.
 
IMO doing things like Str\length makes sense long term, but if scalar objects is ever brought to core, the substr(), str_replace etc will become endangered species in all new code.
 
I can see how you think it says that, but I don't think it's specific enough. I think these types of documents should be really specific if you meant it to mean that.
@NikiC See, thats definitely not how I saw it. It was rather that aside from core, standard, and SPL, there's a definite pattern of $extname as a namespace, so use that for extensions.
 
I believe the two outstanding problems with that are how to define what those functions are, and not being able to change the initial variable?
 
@Derick People like organization and consistency. :) Lumping everything into the root namespace appears cobbled together. The only reason to introduce new names for built-ins IMO would be to introduce new versions of functions that eliminate some legacy behaviors, while maintaining the old version for BC.
 
It makes little to no impact to the things in those 3 places, rather everywhere else. Still very important and moves us forward.
> Conversely, if a bundled extension is removed from PHP, the question arises whether it should be moved out of the PHP namespace. Extensions are typically unbundled from PHP if they are unmaintained. Retaining them under the PHP namespace may create the mistaken impression that the PHP project still maintains such extensions. Of course, changing the vendor prefix on unbundling would once again disrupt any remaining users.
I think the ambiguity is what "extension" is specifically referring to.
I don't think Core, standard, and SPL are "extensions" -- they are the core language, not an extension of it.
And the wording in the RFC supports that they aren't extensions in that sense.
> PHP has three extensions that together form the core of the standard library.
If we consider Core, standard, and SPL as extensions, as in ext/$thing, then a lot of my concerns with ambiguity also disappear.
 
3:35 PM
Well to likely 99% users, core and standard aren't part of an extension. But being that they are, we could just replace PHP\String with Std\String which would be perfectly legitimate under this RFC, and have succeeded in spending 5 years debating nothing that the base library should be Std rather than Php
Well, I catch myself and say that the RFC does say they should not be, which is what I was arguing with Levi about prior to voting
That seems like it has yet to be settled though, as no-one has yet passed an RFC that gives indication as to what constitutes a component
 
@NikiC I think we should close these 3 places to new "components" that are not tied directly to PHP. I don't think we should add random number generators to it, for example. They should be in ext/$something if included in the base PHP distribution at all.
 
Better prepare for a lot of bikeshedding, RNG for example might come under Crypto, or Math, or its own RNG.
 
@MarkR Unless it's ext/rng, and then as per the RFC it's totally fine.
ext/random -> Random, ext/crypto -> Crypto; these are all fine as per the RFC.
This part is very clear, I think.
 
But then it's going to be separate from all the other random and crypto stuff at which point we have made things more complicated
 
The only parts I think that are not clear are the ones relating to core, standard, and SPL.
@MarkR It still has to pass a vote, but that is a possible outcome, sure.
 
3:44 PM
If RNG\ is acceptable for ext/rng, then RNG\ is acceptable as a component in ext/standard
 
@NikiC That part is the part I don't think it's clear on.
 
ext/standard is a matter of implementation organization
We don't want to have a hundred extensions (that can all be individually disabled and enabled!) that each ship five functions
 
Why not?
 
It would be a pain in the ass
 
To be clear, I'm not referring to what we already have -- I'm referring to new additions.
 
3:46 PM
Because it causes implementation overhead, and because it causes configuration overhead.
 
@MarkR It's not a PITA in Rust, which doesn't have hundreds but does have dozens of bundled top-level namespaces.
 
@LeviMorrison Again, this has nothing to do with namespaces -- as I said, it's totally fine to have an RNG\ namespace in standard. It's a question of implementation
Rust does not allow you to disable random namespaces, apart from the core/alloc/std dichotomy
Adding a new namespace in Rust is as simple as adding a new file, it does not require adding a whole bunch of extension boilerplate
It does not require distros to separately package that extension
It does not require users to explicitly enabled that extension
It does not require PHP to load that extension at runtime
 
Those that care: @MadaraUchiha is safe.
 
@Tiffany Context?
 
Stuff that happened is happening in Israel/Palestine
 
3:51 PM
I'm having a really hard time understanding how you can find an RNG\ namespace in ext/rng acceptable, but find it not acceptable if the implementation of it happens to live in a different place.
 
@NikiC What's the point of having ext/$anything then if we can just put it in the core?
You don't want any more extensions?
 
@Tiffany yay
 
@LeviMorrison Not at all! There are a number of reasons why something should be in a separate extension.
The biggest one is that the extension requires an additional dependency. Those pretty much by definition need to be a separate extension, otherwise we make it a required dependency
Now, I should mention that we do have some optional deps in ext/standard, or at least one, which is libargon2. And that one is a major PITA and I would not repeat that mistake
 
A quick browse of the standard stubs file suggests these as possible top level namespace:

Buffer, Stream, Array, Math, Iterator, Encoding, IPs, Sleep, Calling, INI, Uploads, Hashing, DNS, Cookies, Conversion, Strings, CSV, Dir, Process, Filesystem, Disk, Sockets, Passwords, Random, Types/Casting, HTTP.
 
Random numbers probably should have a dependency -- I don't trust random developers writing correct RNG stuff...
 
3:55 PM
(Talking non-vendored deps here, you can pull in someone else's impl of an RNG just fine)
 
Isn't that what causes some of the pain, though?
 
Will [ClassName::class, 'method'] create an "interned" zval that will be referenced, or will it create a new array from scratch each time?
 
@LeviMorrison Depends, but pulling in single-file implementations of algos is generally not a problem. That's basically how all of ext/hash works
Anyway, the next big reason for a separate extension is that the functionality is supposed to be optional. Like, most people don't need ext/soap, we don't need to saddle everyone with that
 
I would prefer that we organizationally make ext/random or ext/rng and make it always-on, rather than throwing everything in ext/standard.
 
@LeviMorrison That's a question of implementation overhead. I don't think that makes sense for tiny extensions, like I would expect the rng implementation to be.
 
3:58 PM
Close ext/standard to "new" components. Not sure how to exactly define that, but things like array_combine aren't new components, they are additions to an existing thing.
@NikiC With the overhead being config.m4 and such or..?
 
Though really, why do you care? What does it matter to you whether something is in ext/standard or it is in an always-enabled extension?
I do agree that doing that sometimes makes sense for code organization reasons, but I don't see why that would need to be a blanket rule
 
Name a component that you'd be happy to see in ext/standard instead of ext/$component, that isn't directly tied to the PHP language (AST, CFG, Opcache, etc).
 
@LeviMorrison Most of what it contains right now?
Like, if we just look at existing functionality, I think it would be pretty pointless to split out ext/math from ext/standard.
 
I think "what we have already" is biased, because we're used to having it. I'm talking new additions.
 
@LeviMorrison Well, then the rng example we've been talking about ^^
 
4:05 PM
You really think that should go in standard and not ext/rng?
Why?
 
I'd be happy to have the code inside the ext/standard directory -- and from the perspective of the user, it would make no difference
@LeviMorrison Why not?
 
It's going to have a dozen or more things in it when all is said and done, if it's well done anyway.
 
Are we confusing ourselves with extensions vs components which aren't extensions but will be treated like extensions because we didn't like PHP\ ?
 
@LeviMorrison It already has
@MarkR No
 
So it's not "tiny" and I want it organizationally in its own space.
 
4:07 PM
@MarkR I think we've arrived at the point where we're mostly on the same page, but Levi would prefer all functionality that I would call a "component" in ext/standard to instead get a separate always-required extension.
 
Also, I think it really should have dependencies... like possibly libsodium.
 
@JoeWatkins I don't have an answer for Alexandru's question on partials and changing ReflectionFunction, since I'd rather do what he suggests anyway. :-) What should we respond there?
 
puts on gloves
grabs spray paint can
 
Honestly same for Nicolas' comment about it. Unsurprisingly, Partial is where we're getting the pushback. :-)
 
@LeviMorrison you really don't need a dependency to implement xorshift ;) And this is the kind of rng we're talking here
 
4:09 PM
Alright where's that bikeshed at? I think It's way better if we paint it blue.
 
@NikiC It also proposed an implementation of the interface based on random bytes, as in /dev/urandom or whatever. That kind of thing does require a library to be portable.
 
I think the argument is something like:
Levi: Namespaces are a good excuse to split ext/standard up into separate pieces, which I want to do anyway.
Nikita: I don't see any point in splitting ext/standard up in the first place, that's orthogonal.

At least that's what I've gotten by only sort of paying attention...
 
@LeviMorrison We happen to already have that implemented for random_bytes. But anyway, I think this is besides the point. I'm okay with ext/rng being a separate extension if there's cause for it to be. I object to that being the general policy.
 
I agree with you on that, except I think there are few, if any, new components that should be added that should go in ext/standard. And if so, why allow ext/standard to claim any namespace it wants?
I can't even think of a single one.
 
@Crell I would summarize my view as "A component in ext/standard and an always-required ext/component extension are isomorphic from the end-user perspective. We should treat the choice between those two exclusively as a question of internal code organization"
 
4:13 PM
@Crell No, I don't want to split what we already have up -- I just don't want new "components" being added to it.
 
If php-src were written in a language that supported namespaces you can all but guarantee it would end up in Extensions\Standard\RNG :-)
 
@MarkR Ah ... do underscores count? :P
 
@Crell ...
> Would it make sense to extend Closure this way?
No
> Isn't the new Partial class an implementation artefact that should be
removed?
No
 
(maybe yes)
 
Reflection mess is not my doing, I'm just dealing with what we have, Partial and Closure and should remain distinct ... the problem is that the methods specifically for Closure were added to ReflectionFunctionAbstract, where they should have been added to a class extending it ...
 
4:24 PM
Theoretically it could be unified with closure or something. I haven't scrutinized the impl -- I've focused on the behavior.
 
Am I correct that the reason it's separate now is to allow for the more robust __invoke method, and to allow the introspection needed to flatten repeated partialing?
 
I'm not sure what there is to gain, so haven't spent much time thinking about unifying them ...
if it weren't for userland wanting a partial to pass the typehint for Closure, they would share no implementation details at all ...
reflection looks odd, whatever you do, because of things that came before it that I don't think we can fix soon/at all ...
 
Based on the feedback, it seems the main pain points are:
1) Can we optimize it as much as possible.
2) Callables can no longer be treated consistently, which is going to be a PITA for code doing functional introspection. (Which... I'll probably be writing a fair bit of, as will Nicolas.)
 
2) ... you're talking about reflection ... look at the abstract, that this is strange is not my doing ... ReflectionFunctionAbstract::getClosure* is wrong, there should be a ReflectionClosure with getClosure*, and then we could add ReflectionPartial and ReflectionFunction, ReflectionMethod, ReflectionClosure and ReflectionPartial would all implement a common interface, and [2] ... but we have to deal with the world the way it is ... you have to write your own factory in other words ...
[2] obviously extend ReflectionFunctionAbstract ...
when it comes to 1, you're really only talking about optimizing away (?) case, doesn't seem worth the complexity, it's not the primary motivation for the feature, it's a side effect/benefit, optimizing for side effects is not a thing that makes sense
 
Accurate response to Alex?

Unfortunately no, according to Joe. The reflection API is a mess right now, and because of the way closure support was added it's not that simple. Cleaning up that part of the Reflection API would be a whole other ball of wax separate from this RFC. I'm sad about it, too. :-(
 
4:46 PM
I mean, that appears to be my response, I really don't see a better way to do it ...
 
@FlávioHeleno if you are submitting a PR, or want help, if you haven't already done it, the changes in my branch make the build work.
 
what we srictly have is another special type of callable, like closure is a special type of callable, but the two aren't really related, my arm was twisted to shoe horn in extends Closure and I'm not really sure why ... something about forward compatibility with callable types, but there's no reason we can't make it compatible in the same way as closure without having to extend closure ...
 
@cmb I've noticed that the other gd files retain functions that PHP doesn't use - like gd*Ex(). I was going to remove those from gd_avif.c, but I could also follow the current standard and keep them.
 
and now we have methods that make no sense, and reflection that makes no sense ... there doesn't seem to be an outright win ...
 
@JoeWatkins You make me sad. :-( But OK. I'm also going to expand on the Partial class a bit more, per request. What reason should I give for it being separate from Closure?
 
4:51 PM
just clarify for me, what is the reason for wanting something that is not a closure, to be a closure ?
 
I don't see a reason to have it extend Closure at all really.
Isn't that why we have callable?
Or rather, we have callable, so let's use it?
 
I'm glad I'm not being crazy ...
 
callable can't be used in all places
 
you want this convenience, treating them all the same way, but they aren't the same, and it's never going to be convenient
 
cmb
@BenMorss I suggest to keep unused functions; that makes it easier to compare with external libgd.
 
4:54 PM
this is likely the argument that made someone merge strange things into the wrong place in reflection, because it's somehow "easier", but it's also clearly wrong and we can see that today ...
 
The naive reason: Because at a user-facing level, this looks like a shorthand for writing your own short-closure. The result is nearly the same.

The more nuanced reason: It's not that it needs to be a Closure, it's that as-is working with callables in reflection is a bloody mess, unless you fold them all into a closure, which is a neat trick that wasn't intended for that specifically but works. But now that doesn't work for this case so it makes meta-programming around callables uglier. Making Partial a case of Closure isn't necessarily the solution to that, however.
 
@cmb 👍🏼
 
Property types for example.
 
@cmb I also noticed the large comments above individual functions had been removed. I can do this too, though I feel some guilt about removing comments
 
cmb
@BenMorss example, please
 
4:56 PM
@MarkR Why is that exactly?
 
> The more nuanced reason: It's not that it needs to be a Closure, it's that as-is working with callables in reflection is a bloody mess,
I'll stop you there ... that's not really our problem to solve, but we should be careful not to compound the problem ...
 
@Trowski Because of scope access I believe - 3v4l.org/LQ9ZW
 
@MarkR You can Closure::fromCallable($callable) the rest of them, yes?
 
3v4l.org/li79g This works.
 
4:58 PM
we're forcing these two unrelated types of callables to essentially implement a common interface, that one of them can't fulfill, because it's not really a Closure ... in order to solve a problem we didn't create, and can't really solve ...
 
@BenMorss I've submitted a PR with the fix (github.com/php/php-src/pull/6975)
 
I mean… it doesn't work, but no different than assigning a property that's callable in one context and not in another.
 

« first day (3861 days earlier)      last day (1070 days later) »