Re: [PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-19 Thread Ilija Tovilo
On Sun, May 19, 2024 at 1:15 PM Ilija Tovilo wrote: > > Hi Peter > > On Sun, May 19, 2024 at 10:30 AM Peter Stalman wrote: > > > > echo " {A::$static_property} \n"; // doesn't work (unless $static_property > > is a variable) > > echo " {$a::$static_property} \n"; // works > > > > echo " {A::stat

Re: [PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-19 Thread Ilija Tovilo
Hi Peter On Sun, May 19, 2024 at 10:30 AM Peter Stalman wrote: > > echo " {A::$static_property} \n"; // doesn't work (unless $static_property is > a variable) > echo " {$a::$static_property} \n"; // works > > echo " {A::static_method()} \n"; // doesn't work (just text) > echo " {$a::static_metho

Re: [PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-19 Thread Robert Landers
On Sun, May 19, 2024 at 10:33 AM Peter Stalman wrote: > > Hi Internals, > > Obviously we can't use constants or functions directly in strings using > variable parsing, I assume because it lacks the easily detectable $. > > However, we _can_ use methods because the object variable has the $, which

Re: [PHP-DEV] [Discussion] "Internal" attribute and warning

2024-05-19 Thread Robert Landers
On Sun, May 19, 2024 at 10:52 AM Andreas Heigl wrote: > > Hey Robert. > > Am 19.05.24 um 09:38 schrieb Robert Landers: > > On Sat, May 18, 2024 at 9:11 PM Andreas Heigl wrote: > >> > >> > >> > >> Am 18.05.24 um 19:46 schrieb Robert Landers: > >>> On Sat, May 18, 2024 at 7:38 PM Andreas Heigl wro

Re: [PHP-DEV] [Discussion] "Internal" attribute and warning

2024-05-19 Thread Andreas Heigl
Hey Robert. Am 19.05.24 um 09:38 schrieb Robert Landers: On Sat, May 18, 2024 at 9:11 PM Andreas Heigl wrote: Am 18.05.24 um 19:46 schrieb Robert Landers: On Sat, May 18, 2024 at 7:38 PM Andreas Heigl wrote: Hey all. Am 18.05.24 um 16:00 schrieb Robert Landers: [snip] I guess that de

[PHP-DEV] [Discussion] Why can't I do "{$a::class}"?

2024-05-19 Thread Peter Stalman
Hi Internals, Obviously we can't use constants or functions directly in strings using variable parsing, I assume because it lacks the easily detectable $. However, we _can_ use methods because the object variable has the $, which I assume is the reason methods work and functions don't. I feel li

Re: [PHP-DEV] [Discussion] "Internal" attribute and warning

2024-05-19 Thread Robert Landers
On Sat, May 18, 2024 at 10:33 PM Barney Laurance wrote: > > On 18/05/2024 15:00, Robert Landers wrote: > > Hello internals, > > > > I've been thinking about having an "internal" attribute that will emit > > a warning if called from outside it's left-most namespace. > > Hello Robert, > > It's worth

Re: [PHP-DEV] [Discussion] "Internal" attribute and warning

2024-05-19 Thread Robert Landers
On Sat, May 18, 2024 at 9:11 PM Andreas Heigl wrote: > > > > Am 18.05.24 um 19:46 schrieb Robert Landers: > > On Sat, May 18, 2024 at 7:38 PM Andreas Heigl wrote: > >> > >> Hey all. > >> > >> Am 18.05.24 um 16:00 schrieb Robert Landers: > >>> Hello internals, > >>> > >>> I've been thinking about