How do I convert the string "E_ALL & ~E_NOTICE" to the decimal equivalent 6135?

From: Date: Thu, 11 Nov 2010 04:06:06 +0000
Subject: How do I convert the string "E_ALL & ~E_NOTICE" to the decimal equivalent 6135?
Groups: php.general 
Request: Send a blank email to php-general+get-309439@lists.php.net to get a copy of this message
We're trying to move all of our configuration files for our DEV/TEST/PROD and various python scripts and such that all need the same DB connection parameters and pathing information to a common and simple config.ini file they all can share across languages. One snag I ran into is this: [dart] relative_url = /dart2 absolute_path = /home/www/dart2 log_level = E_ALL & ~E_NOTICE But when I read it in from the file, it's a string (of course) $log_level_string = "E_ALL & ~E_NOTICE"; echo 'log level string = '.eval($log_level_string.';').'<br>'; This gives me nothing!: log level string = Wheras this one gives the proper values: echo 'log bit level = '.(E_ALL & ~E_NOTICE).'<br>'; Output is: log bit level = 6135 But that defeats the purpose of a config file.

« previous php.general (#309439) next »