|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-08-01 09:55 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2019-08-01 09:55 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 03:00:01 2025 UTC |
Description: ------------ With the following .ini file ... ---------- NUMBER = 1 TEXT = "1" DEFINED_INTEGER_CONSTANT = FOO DEFINED_BOOLEAN_CONSTANT = BAR UNDEFINED_CONSTANT = BAZ ---------- I have tested this behaviour in 7.1.26, 7.3.1 and 7.3.7. Test script: --------------- <?php declare(strict_types=1); define("FOO", 123); define("BAR", true); $ini_file = parse_ini_file(__DIR__ . '/test.ini', false, INI_SCANNER_TYPED); foreach($ini_file as $key => $value) { define($key, $value); } var_dump(NUMBER); // => int(1) var_dump(TEXT); // => string(1) "1" var_dump(DEFINED_INTEGER_CONSTANT); // => string(3) "123" var_dump(DEFINED_BOOLEAN_CONSTANT); // => "1" var_dump(UNDEFINED_CONSTANT); // => "BAZ" Expected result: ---------------- I expect the third var_dump to output an integer (123) due to the use of INI_SCANNER_TYPED. Actual result: -------------- The third var_dump outputs a string ("123").