#36149 [Opn]: error handling "{" in key names in parse_ini_file()

From: Date: Wed, 25 Jan 2006 02:26:17 +0000
Subject: #36149 [Opn]: error handling "{" in key names in parse_ini_file()
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969371737@lists.php.net to get a copy of this message
ID: 36149 User updated by: webmaster at dreamsee dot biz Reported By: webmaster at dreamsee dot biz Status: Open Bug Type: Documentation problem -Operating System: linux, frrebsd +Operating System: linux, freebsd PHP Version: 5.1.2 New Comment: The problem is that it cannot be solved by doublequotes (") like in bug #33574. Have no solution for now. Previous Comments: ------------------------------------------------------------------------ [2006-01-25 00:37:04] tony2001@php.net Related to the change mentioned in bug #33574. Reclassified as docu problem. ------------------------------------------------------------------------ [2006-01-25 00:30:08] webmaster at dreamsee dot biz Description: ------------ PHP 5.1.2 cannot handle "{}" in key names, so same code that works on PHP 4.x and 5.0.x, won't work. Almost same problem described in bug http://bugs.php.net/bug.php?id=33574, but since then it was not added in documentation and it bit different problems, as there it about values, but here problem with keys. Reproduce code: --------------- parser.php: <?php $ini = parse_ini_file ("./default.lang.php4", true); echo '<pre>'; print_r($ini); ?> default.lang.php4: ;<?php exit;?> [common] {charset} = "windows-1251" {title} = "some title" [check.php] {fail} = "fail here" Expected result: ---------------- Array ( [common] => Array ( [{charset}] => windows-1251 [{title}] => some title ) [check.php] => Array ( [{fail}] => fail here ) ) Actual result: -------------- Warning: Error parsing ./default.lang.php4 on line 4 in /home/webadmin/unixro.net/tmp/parser.php on line 2 Array ( [common] => Array ( ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36149&edit=1

« previous php.doc (#969371737) next »