-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you bring this to PHP RFC? #20
Comments
I think there are a lot of PHP devs that would love to see this in the core... |
yeah of course, for developers who want to use strongly typed PHP scalars, this will help tremendously. Please do consider bringing it to PHP RFC. |
I won't have the time to propose this for inclusion in PHP 7. Adding this to core would require quite a lot of work and feature freeze is not far away. By the way, I already added support for syntax like |
I see, thats a pity, I really hope to see this on PHP 7.0, but guess it wont be there at least till 7.1... Still, you can start an RFC to prepare for the future, even if it will not be going to voting phase anytime soon, right? And its very good news, I very love the syntax like "mystring"->length() and [2, 5, 4, 6]->sort(). It will be very useful, cant wait for the new Scalar object for PHP 7! |
Shame, I'd have also loved to have seen this in PHP7. As I mentioned in one of the other issues, this is a perfect opportunity to fix the inconsistent function naming and parameter orders... $str->replace(), $array->combine() etc. |
@nikic what about modifying |
@alanwillms Nope, the current VM implementation doesn't allow this. With enough effort it might be possible, but would probably have negative performance impact for all other method calls (which is pretty much a no-go). |
@nikic not modifying Now that PHP 7.0 is frozen and won't have any new features, will you open a RFC targeting 7.1? |
+1, this looks really great and I am looking forward to see this in PHP 7! |
👍 for this in php core |
Yep, +1. |
+1 |
1 similar comment
+1 |
Also will be good to split to two RFC. One about engine level ability. And one about user space registration. |
+1 |
@nikic "once this extension is ported to PHP 7" Any progress on this? |
+1 |
10 similar comments
👍 |
+1 |
+1 |
👍 |
+1 |
+1 |
👍 |
+1 |
+1 |
👍 |
@nikic are there any chances to bring this to RFC into the core of PHP? This feature is awesome and there are plenty of people looking forward for this. |
+1 |
+1 |
Just a reminder everyone that you can add a reaction to comments rather than cluttering the comments with +1. |
+1 |
3 similar comments
+1 |
+1 |
+1 |
please stop replying "+1", to vote just add reaction to the original comment. |
Will this be possible in PHP 7.2? |
no, there hasn't even been an RFC for this, so it can not possibly be scheduled to be in a future release. |
What can we do to bring this closer to an RFC? |
+1 |
1 similar comment
+1 |
Hope for PHP 8.x or 9.x |
PHP core developers are discussing about tagging the next release after 7.3 as 8.0. Maybe now is the time. |
An entire year has passed already...do you know any news on this? Thanks! |
So interesting but handlers should be applied in a specific scope. |
It doesn't seam to be planned for v8! |
Definitively I think C#'s Extension Method is our goal. |
So it hasn't gone to an RFC for... four years now? What's stopping it? |
@mpyw yup this one has the potential to allow any types to be extended instead of just primitive types, though unlike C# which is compiled, in PHP you will have to manually include the files that contain extension methods. Anyway, I think, its about time to bring this to PHP RFC. It will be a neat feature for PHP 8, a good chance to introduce OO API for scalar types, as well as fixing the messy function names that cannot be touched due to backward compatibility issue. |
"fixing the messy function names that cannot be touched due to backward compatibility issue". Great point. |
+1000 |
What is the limitation, why the scalar value can not be passed as a variable by reference? |
@mvorisek Consider something like Supporting something like |
@nikic As On the other side something like So this should be possible with methods that modified the original scalar object:
What do you think? |
@nikic Also what do you think about a registration only for some namespace prefix(es)? This would widen the possibility of using the scalar objects in larger projects/packages a lot. |
Hi! Just found this repo and it looks amazing. Any chance it gets on a RFC now? Maybe for PHP 9? |
@brunoggdev See @nikic's last comment from 2019. I doubt much has changed in that regard. |
I took a look at it and I very like what is being implemented. In my own framework I use classes for Int, Float, String and Array, but sometimes it can be a bit tedious(like having to write new String("abc") than just "abc"). This library will fix a lot of issues in my codebase, and make coding 10x more enjoyable. Also if its implemented at the PHP core, there's a chance to suggest a way to make even more elegant syntax work, such as "abc"->toUpper() which does not happen yet. So, will you consider moving this to RFC and possibly have PHP internals implement it in PHP 7?
The text was updated successfully, but these errors were encountered: