Bug #77256 [Nab]: PHP Version => 5.6.30-0+deb8u1

From: Date: Wed, 12 Dec 2018 10:56:29 +0000
Subject: Bug #77256 [Nab]: PHP Version => 5.6.30-0+deb8u1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218417@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77256&edit=1 ID: 77256 User updated by: kzg dot xc dot hu at gmail dot com Reported by: kzg dot xc dot hu at gmail dot com Summary: PHP Version => 5.6.30-0+deb8u1 Status: Not a bug Type: Bug Package: *Directory/Filesystem functions Operating System: Debian Jessie PHP Version: 5.6.30 Block user comment: N Private report: N New Comment: Thx a at b dot c dot de, of course I have control over the code, since I am writing that. It is some kind of parameter check of the online Google translator, and sadly, they use "no" as an identifier for "Norvegian". The simpliest way is: $chkarray["no"]="Norvegian". As a php source code, it is accepted, and works error-free. Some sniffing around docs, makes clear, that nowadays there is no official put_ini_file, or similar function, therefore all of us have the ability writing a proprietary code.It can be either file_put_contents, or write it line-by line, etc, or just write 1 line to the end of the strem, as I did. Writing a space to the beginning of each line is simple and effective. Previous Comments: ------------------------------------------------------------------------ [2018-12-11 20:14:13] a at b dot c dot de If you've got control over the codes used, ISO639-2 provides three-letter codes for languages; neither "yes" nor "off" conflict with this list. ------------------------------------------------------------------------ [2018-12-07 05:33:41] requinix@php.net As a workaround, put a space at the beginning of the line. Not sure it should work, but it does. $file_content=<<<thisone no = "norvegian" thisone; ------------------------------------------------------------------------ [2018-12-07 05:01:58] kzg dot xc dot hu at gmail dot com I see, that there are some limitations in keys, but this one is very uncomfortable, since "no" is the official ISO 3166-1 alpha-2 code of Norway. ------------------------------------------------------------------------ [2018-12-06 20:28:43] requinix@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php > Note: There are reserved words which must not be used as keys for ini files. > These include: null, yes, no, true, false, on, off, none. ------------------------------------------------------------------------ [2018-12-06 20:14:37] kzg dot xc dot hu at gmail dot com Description: ------------ --- From manual page: https://php.net/function.parse-ini-file --- PHP Version => 5.6.30-0+deb8u1 Test script: --------------- $file_content=<<<thisone no = "norvegian" thisone; $fName='/var/tmp/norvegian.txt'; $fp = fopen($fName, 'w'); fwrite($fp, $file_content); fclose($fp); $TOarrayORnotTOarray= parse_ini_file ($fName); // PHP Warning: syntax error, unexpected BOOL_FALSE in /var/tmp/norvegian.txt on line 1 in php shell code on line 1 var_dump($TOarrayORnotTOarray); // output: bool(false) // echo file_get_contents( $fName ); works fine ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77256&edit=1

« previous php.bugs (#218417) next »