Re: [RFC] Conditional INI support

From: Date: Fri, 15 Feb 2008 13:19:56 +0000
Subject: Re: [RFC] Conditional INI support
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-35518@lists.php.net to get a copy of this message
Currently UNDEFINED would be just string 'UNDEFINED'. Doesn't atoi() for non-numeric string make it 0 ?? (or null..:) So that would work without changing anything.. --Jani Dmitry Stogov kirjoitti:
I think it will work. #ifdef UNDEFINED > 5 (false) #ifdef UNDEFINED <= 5 (true) (but anyway I think it is possible to find out an unclear condition) Dmitry. Marcus Boerger wrote:
Hello Dmitry, shouldn't this be like in C/C++ where a non existing value is treated like an empty string which behaves like false in boolean evaluations? marcus Friday, February 15, 2008, 11:25:42 AM, you wrote:
#if defined(PHP_MAJOR_VERSION) && PHP_MAJOR_VERSION >= 6 extension="unicode.so" #endif
Here PHP_MAJOR_VERSION is a PHP constant that is not defined in php-5.3 but might be defined in the future version.
Dmitry.
Jani Taskinen wrote:
On Fri, 2008-02-15 at 13:02 +0300, Dmitry Stogov wrote:
Jani Taskinen wrote:
c) We can use just "value" insted of ${value} in conditions.
Yup. ${foobar} is actually not any "variable" per se, but just a reference to existing ini entry in the file. And I don't think that needs to change.
Oh, I see. Then we can use just "$string" (or "$str.str") for ini entries and "string" for PHP constants. We can also implement defined() macro-function, to check if constant defined.
Why? Don't make php.ini parsing any more complex than it already is(n't). Any string which can pass as constant will have that constant's (or environment variable) value. Why do you need any "variable" in there anyway? And why do you need defined() ??? (examples please? :) --Jani
Best regards, Marcus


« previous php.internals (#35518) next »