why can not I see the value (status) of safe_mode and register_globals

StackOverflow https://stackoverflow.com/questions/9758716

  •  24-05-2021
  •  | 
  •  

سؤال

why can not I see the value (status) of safe_mode and register_globals

I use this code from php.net:

echo 'display_errors = ' . ini_get('display_errors') . "\n";
echo 'register_globals = ' . ini_get('register_globals') . "\n";

The above example will output something similar to:

display_errors = 1, register_globals = 0

but i gеt this:

display_errors = 1, register_globals =

register_globals is off but i get nothing instead of 0 (zero)

هل كانت مفيدة؟

المحلول

Converting false to a string results in an empty string and those values are booleans:

> echo gettype(ini_get('register_globals'));
boolean

The documentation of ini_get() is indeed misleading about this.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top