On 9/1/2016 8:02 PM, Davey Shafik wrote:
> Hey all,
> 
> A while back I brought a small RFC to internals, that proposed a set of
> constants that were specifically for alternative implementations to
> identify themselves as such if they want to conform to the spec.
> 
> https://wiki.php.net/rfc/php_engine_constant
> 
> There were some folks who didn't like it, but nobody suggested different
> implementations, just didn't feel it was necessary. As such, I'm planning to
> bring it to a vote next week - this is simply a heads up as it's been a
> while
> and I want to give a chance for any objections other than not wanting it to
> be voiced before I open it up for voting.
> 
> The vote will be a straight 50%+1 yes/no vote.
> 
> - Davey
> 

+1 from my side.

What do you think about including a platform and architecture identifier
too?

const string PHP_ENGINE_PLATFORM = '';

WINDOWS
LINUX
MACOS
CYGWIN
FREEBSD
SOLARIS
...

This would solve all the tricks we see in various code bases that try to
determine what platform the current PHP installation is running on,
e.g.: if (DIRECTORY_SEPARATOR === '\\') could be replaced with a more
readable if (PHP_ENGINE_PLATFORM === 'WINDOWS').

const string PHP_ENGINE_ARCHITECTURE = '';

x86
x64
ia64
arm
...

This is not required as often but still needed at some places. This
would allow to replace checks like if (PHP_INT_SIZE === 8) with if
(PHP_ENGINE_ARCHITECTURE === 'x64').

-- 
Richard "Fleshgrinder" Fussenegger

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to