Last active
June 12, 2016 18:00
-
-
Save leotm/25cf7640e07c4a527fe075f0b45fb7c3 to your computer and use it in GitHub Desktop.
PHP Options/Info Functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// It seems PDO attributes are set per connection establishment | |
// Rather than checking if the attribute is what we desire first, if so not executing it at all | |
// So I wondered, should the PHP options be just set each connection like PDO? | |
// Refresh | |
var_dump(memory_get_usage()); // 167704 | |
if (ini_get('error_reporting') != '22527') | |
ini_set('error_reporting', 'E_ALL'); | |
var_dump(memory_get_usage()); // 167704 | |
// Force refresh | |
var_dump(memory_get_usage()); // 167704 | |
if (ini_get('error_reporting') != '22527') | |
ini_set('error_reporting', 'E_ALL'); | |
var_dump(memory_get_usage()); // 167704 | |
// No additional memory usage | |
// Refresh | |
var_dump(memory_get_usage()); // 167376 | |
ini_set('error_reporting', 'E_ALL'); | |
var_dump(memory_get_usage()); // 167544 | |
// + 168 | |
// Force refresh | |
var_dump(memory_get_usage()); // 167600 | |
ini_set('error_reporting', 'E_ALL'); | |
var_dump(memory_get_usage()); // 167768 | |
// + 168 | |
// It seems checking is slightly more optimal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment