There are number of INI set/get functions. This RFC proposes deprecation of these functions.
Use of ini_set()/ini_get() simplifies/improves/cleanups PHP. Some of these alias function names is inconsistent, some aliases are missing while similar INI setting may be set/get by aliases. Simple INI set/get alias functions are just making PHP complex, creating more inconsistencies. PHP needs no more INI set/get aliases at least, document use of ini_get()/ini_set() in the CODING_STANDARDS.
Pros
Cons
Before
<?php // Setup environment session_cache_limiter('public'); session_name('MYSESS'); session_save_path('/var/php/session'); ini_set('session.cache_expire', 10); ini_set('max_execution_time', 15); ini_set('display_errors', 'Off'); ini_set('default_charset', 'UTF-8'); mb_internal_encoding('UTF-8'); date_default_time_zone_set('Asia/Tokyo');
After
<?php // Setup environment ini_set('session.cache_limiter', 'public'); ini_set('session.name', 'MYSESS'); ini_set('session.save_path', '/var/php/session'); ini_set('session.cache_expire', 10); ini_set('max_execution_time', 15); ini_set('display_errors', 'Off'); ini_set('default_charset', 'UTF-8'); ini_set('mbstring.internal_encoding', 'UTF-8'); ini_set('date.timezone','Asia/Tokyo');
From pre RFC discussion:
removing or disrupting functions without a very good reason (such as, functionality going away or this function is abused or is broken in many use cases) is wrong. These functions don't seem broken, they just do something that you can do in another way. I don't think it is necessary to deprecated them. (Stas)
There are 2 documentation and 1 code change proposal.
1. Add plain ini_get/set() usage in CODING_STANDARDS. In the “Code Implementation” session add following standard.
10. Use ini_set()/ini_get() function when modules need to change INI values. Do not add simple ini_set()/ini_get() alias functions.
2. Document INI set/get alias functions in the PHP Manual.
e.g.
3. Add E_DEPRICATED errors for INI set/get alias functions.
Exceptions: These are not simple INI set/get aliases.
1. None for CODING_STANDARD documentation.
2. None for deprecation documentation in the PHP manual.
3. E_DEPRECATED error may be ignored
No SAPI impact.
Modules that has INI set/get aliases are affected.
No Opcache impact.
No constant.
No changes for INI values.
Decided exceptions. Candidates are
E_DEPRECATED errors may be delayed until PHP 7.1
Functions that are not simple INI set/get aliases are not affected.
Proposals require 50%+1 majority
No patch is prepared as this is a trivial change.
After the project is implemented, this section should contain