PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Jul 5, 2023 21:36
Got it! Thanks.
Jul 5, 2023 20:56
@IluTov Thanks for the heads up! I just answered on the mailing list, and I do understand that participating on discussions is "key" to granting someone RFC voting rights. I will keep that in mind moving forward and make an effort to participate in discussions.
May 1, 2023 10:44
Good morning! Although I'm fairly confident, I'd like to confirm something withyou. PHP's __destruct function is immediately and always triggered when there are no more references to an object? For instance, if I were to create a new object of class B like this: new B();, would the __destruct function of class B be called right ( and always) after this line?
Feb 21, 2023 11:34
morning
Oct 18, 2022 12:54
I see. Thank you, Derick!
Oct 18, 2022 12:46
Hi friends - do you think there are any plans in the future regarding allowing contravariance on class properties? gist.github.com/nunomaduro/416713f83f5fa5cc0ee2921a9ccc6939
Jun 4, 2021 21:38
@IluTov I also use Sublime Text all the time. Just change to PHPStorm for refactoring + clean up.
Jun 4, 2021 21:35
@IluTov @Danack ahah, I know. All good. :)
Jun 4, 2021 21:35
@IluTov Indeed. You can use Laravel's features - such as queues, cache, etc - and opt-out from any type of magic. In addition, static anaylsis will work as expected thanks to this package: github.com/nunomaduro/larastan.
Jun 4, 2021 21:18
@IluTov There is a few reasons. The most compelling one is: it would be a huge BC break at this point.
Jun 4, 2021 21:10
Including generics with PHPStan, etc.
Jun 4, 2021 21:09
Yet, in my own packages, I use fully typed PHP: github.com/pestphp/pest/blob/master/src/Actions/….
Jun 4, 2021 21:08
@Tiffany I don't use types when building apps with Laravel / Laravel Zero.
Jun 4, 2021 21:08
@ti
Jun 4, 2021 21:04
lol
Jun 4, 2021 21:01
Ahah, I know. Geek here.
Jun 4, 2021 21:00
I've just created this: github.com/nunomaduro/php-interminal.
Jun 1, 2021 20:34
No problem Joe.
Jun 1, 2021 20:18
Great!
Jun 1, 2021 20:15
@Crell Looks good - maybe replace Nuno/he by *we. As we use *we everywhere on the rfc lol.
Jun 1, 2021 18:46
@Crell lol
Jun 1, 2021 18:39
This.
Jun 1, 2021 18:39
Short functions != Arrow functions.
Jun 1, 2021 18:36
@cmb The fn keyword indicates a function that will auto-capture variables, by value.
Jun 1, 2021 18:36
@cmb The => symbol always means “evaluates to the expression on the right,” in all circumstances. (Named functions, anonymous functions, arrays, and match().)
Jun 1, 2021 18:36
@cmb On the RFC we talk about that.
Jun 1, 2021 18:29
@Crell That's good know (always learning with you). Feel free to pull the vote, and add a note about why we are pulling the vote. Thank you!
Jun 1, 2021 18:24
@Crell Not sure if "pull the vote" will do any good. For historical reasons, it may be important to have a v2 where the concerns raised on the v1 are totally addressed.
Jun 1, 2021 18:19
@IMSoP I mean more about having a patch that everyone in the PHP Internals agree in terms of "efficient", "behaviour", etc.
Jun 1, 2021 18:13
*to investigate ways of making the patch more efficient :)
Jun 1, 2021 18:13
@Crell I think I would like to invest some of my personal time to investigate the patch. It may take a while tho.
Jun 1, 2021 18:02
@Danack @Crell I am ok with closing, or making a v2 of that RFC with the necessary adjustments on the patch.
Jun 1, 2021 08:39
Well, it’s loud and clear that in order to this RFC have some sort of consensus here, the patch needs to ideally contain all the required changes upfront. That was not clear for me at first.
Jun 1, 2021 08:32
morning 👋🏻
Jun 1, 2021 00:44
Thank you for explaining, Crell.
Jun 1, 2021 00:39
You'll have way more experience than me in RFC processes - still learning here to be honest. Maybe in RFC needs to always be followed by a complete - and fully ready - pull request.
Jun 1, 2021 00:36
@Danack The improvements - suggested by Nikita - are indeed not yet in the patch provided by the RFC. Not sure if that should be "blocking" on moving the RFC into votes, as those improvements have no functional impact on user code.
May 31, 2021 23:18
Apparently Crell already have sent those emails, but they seem "stuck".
May 31, 2021 23:16
@bwoebi Currently asking @Crell if he have already sent an email(s) concerning both rfcs ( short functions, and multi-stmt closure).
May 31, 2021 22:44
( Are we even allowed to do that after sending it to votes? )
May 31, 2021 22:44
It's not being ignored Joe. We are aware that those improvements - to the capture logic - are necessary before the feature land in PHP. Maybe we can update the section at the end of the RFC to be more clear about this.
May 31, 2021 22:33
@JoeWatkins In theory yes. And ideally, these optimizations would be introduced at the same time as this feature. And equally ported to PHP 7.4 => "Auto-capturing single-statement closures". I guess we can thinking about that once we decide if we want or not have this feature.
May 31, 2021 22:25
@Crell You are a fantastic technical writer.
May 31, 2021 22:25
@JoeWatkins At the end of the RFC, we've talked about that: "Additionally, it is quite possible that the auto-capture logic could be improved to be smarter about what variables to capture and which not to. Such an optimization can be done at any time as it has no functional impact on user code."
Apr 30, 2021 09:30
morning
Apr 29, 2021 18:19
The foo function won’t refer to the bar property, but to an variable bar in the outer scope here.
Apr 29, 2021 18:19
That’s correct. { bar: 1, foo: () => this.bar }
Apr 29, 2021 18:10
Going to end the day here, see you all tomorrow. 👍🏻
Apr 29, 2021 18:10
@JoeWatkins Thank you Joe!