#45012 [Opn->Bgs]: parse_ini_file() does not correctly bitwise XOR constants

From: Date: Thu, 15 May 2008 21:50:02 +0000
Subject: #45012 [Opn->Bgs]: parse_ini_file() does not correctly bitwise XOR constants
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-125034@lists.php.net to get a copy of this message
ID: 45012 Updated by: felipe@php.net Reported By: mjijackson at gmail dot com -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Win32 PHP Version: 5.2.6 New Comment: The php.ini says: ; Expressions in the INI file are limited to bitwise operators and parentheses: ; | bitwise OR ; & bitwise AND ; ~ bitwise NOT ; ! boolean NOT This is valid also to files parsed by parse_ini_file() function. Previous Comments: ------------------------------------------------------------------------ [2008-05-15 18:42:17] mjijackson at gmail dot com Changed OS from Windows XP SP2 to more general Win32 ------------------------------------------------------------------------ [2008-05-15 17:53:19] mjijackson at gmail dot com Description: ------------ parse_ini_file() correctly uses the | and & bitwise operators on constants. However, it does not correctly interpret the ^ (XOR) operator. Instead, it interprets the entire statement as a string. Reproduce code: --------------- *** test.ini *** or = E_ERROR | E_PARSE xor = E_ALL ^ E_NOTICE *** PHP *** $ini = parse_ini_file('test.ini'); echo $ini['or'] . ' ' . (E_ERROR | E_PARSE); echo "\n"; echo $ini['xor'] . ' ' . (E_ALL ^ E_NOTICE); Expected result: ---------------- 5 5 6135 6135 Actual result: -------------- 5 5 E_ALL ^ E_NOTICE 6135 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45012&edit=1

« previous php.bugs (#125034) next »