Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-06 Thread Mike Schinkel
> On Apr 5, 2021, at 9:00 PM, Jesse Rushlow wrote: > > Sure thing - > > In Symfony's MakeBundle we have a command "php bin/console make:command". > This ultimately generates a "App\Console\XyzUserlandCommand::class" that > allows the developer to customize in order to perform some task within >

Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-06 Thread Rowan Tommins
On 06/04/2021 02:00, Jesse Rushlow wrote: As an example, when the user runs "make:command"; we check if they have PHP 8 && if "class_exists(Symfony\.\Attributes::class)" - if both of those === true, we import the attribute class and generate the needed attributes for the command. Otherwise

Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Marco Pivetta
Hey Jesse, On Tue, Apr 6, 2021, 03:00 Jesse Rushlow wrote: > Sure thing - > > In Symfony's MakeBundle we have a command "php bin/console make:command". > This ultimately generates a "App\Console\XyzUserlandCommand::class" that > allows the developer to customize in order to perform some task

Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Jesse Rushlow
Sure thing - In Symfony's MakeBundle we have a command "php bin/console make:command". This ultimately generates a "App\Console\XyzUserlandCommand::class" that allows the developer to customize in order to perform some task within their app. e.g. run persistence operations, generate a backup,

Re: [PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Rowan Tommins
On 05/04/2021 18:14, Jesse Rushlow wrote: I was attempting to use class_exists(UsesPropertyPromotion::class) to determine if an attribute implementation existed in order to generate a PHP 8 appropriate class - else fall back to generating a PHP 7 appropriate class. For context, this check was

[PHP-DEV] Path forward for class_exists with different targeted PHP version implementations

2021-04-05 Thread Jesse Rushlow
Howdy Internals, I discovered today (purely on accident) that class_exists($subject) actually parses the "$subect" class in question. I was attempting to use class_exists(UsesPropertyPromotion::class) to determine if an attribute implementation existed in order to generate a PHP 8 appropriate