update page now

Voting

: five plus zero?
(Example: nine)

The Note You're Voting On

Philo
2 years ago
Hi,
Up to PHP 8.3 (at least), it seems that INI_SCANNER_TYPED is ignored when trying to get values from constants.
For example :
<?php
// https://3v4l.org/qK5o8

const OK = true;
const KO = false;
const NIL = null;

$ini = <<<'INI'
a = TRUE
b = FALSE
c = null
d = 9223372036854775807
INI;
var_dump(parse_ini_string($ini, false, INI_SCANNER_NORMAL), parse_ini_string($ini, false, INI_SCANNER_TYPED));
$ini = <<<'INI'
a = OK
b = KO
c = NIL
d = PHP_INT_MAX
INI;
var_dump(parse_ini_string($ini, false, INI_SCANNER_NORMAL), parse_ini_string($ini, false, INI_SCANNER_TYPED));
?>

I thought it was worth mentioning.

<< Back to user notes page

To Top