Req #79074 [Com]: Add null colleasing and ternary operator for php.ini directive
Edit report at https://bugs.php.net/bug.php?id=79074&edit=1
ID: 79074
Comment by: video dot ice dot power at seznam dot cz
Reported by: michael dot vorisek at email dot cz
Summary: Add null colleasing and ternary operator for php.ini
directive
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: Any
PHP Version: 7.4.1
Block user comment: N
Private report: N
New Comment:
memory_limit = 32M
memory_limit = "${PHP_MEMORY_LIMIT}"
I have tested this and currently this config does not ignore the 2nd line if the variable is not
set, i.e. it does not use "last default/correct value" but instead it uses "PHP
default value"
Ternary operator is definitely needed for these cases or is there currently any solution without
using shell before PHP is launched?
Previous Comments:
------------------------------------------------------------------------
[2020-01-11 22:36:17] michael dot vorisek at email dot cz
> https://github.com/php/php-src/blob/master/php.ini-production#L40#L41
@geekcom@php.net Thanks, so I could write:
memory_limit = 32M
memory_limit = "${PHP_MEMORY_LIMIT}"
Is there any test for this behaviour in the PHP source?
> ternary operator
What do you think about native ternary operator for php.ini?
------------------------------------------------------------------------
[2020-01-10 19:11:46] geekcom@php.net
https://github.com/php/php-src/blob/master/php.ini-production#L40#L41
------------------------------------------------------------------------
[2020-01-10 19:06:14] geekcom@php.net
Hi michael, bellow text is a snippet of php.ini packaged with PHP.
"If PHP can't find an expected directive because it is not set or is mistyped, a default
value will be used."
Please see at:
https://github.com/php/php-src/blob/master/php.ini-production
------------------------------------------------------------------------
[2020-01-07 13:22:18] michael dot vorisek at email dot cz
Should be easy to implement like the binary operators: https://github.com/php/php-src/blob/php-7.4.1/Zend/zend_ini_parser.y
Please add to PHP 7.4 if possible.
------------------------------------------------------------------------
[2020-01-07 13:20:43] michael dot vorisek at email dot cz
Description:
------------
php.ini configuration is currently quite flexible, it allows variables, binary bitwise operations
etc.
But currently there is no way to write conditional expressions. This is feature request for:
- null colleasing operator (very usefull for empty enviroment variables to assign some default value
instead)
- ternary operator (for general conditions)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79074&edit=1
Thread (9 messages)