3v4l.org

run code in 200+ PHP versions simultaneously
<?php declare(strict_types=1); $ini = <<<INI NUMBER = 1 TEXT = "1" DEFINED_INTEGER_CONSTANT = FOO DEFINED_BOOLEAN_CONSTANT = BAR UNDEFINED_CONSTANT = BAZ INI; define("FOO", 123); define("BAR", true); $ini_file = parse_ini_string($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"
based on pVePE
Output for 7.1.0 - 7.4.0
int(1) string(1) "1" string(3) "123" string(1) "1" string(3) "BAZ"