# Typed Values from `ini` Files

> Section in “New and Extended Functionality › Type System” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/type-system/typed-values-from-ini-files/>

Already introduced in PHP 5.6.1, the `INI_SCANNER_TYPED` constant can be used to enable the `parse_ini_file()` and `parse_ini_string()` functions to return typed values from `ini` files:

``` php
var_dump(
    parse_ini_string(
        'setting=1',
        false,
        INI_SCANNER_TYPED
    )
);
```

    array(1) {
      ["setting"]=>
      int(1)
    }

This functionality will now come in handy when passing values that are read from `ini` files to functions or methods that use scalar type declarations in their parameter list.

---

Previous: [MySQL and Native Types](https://php7explained.com/new-and-extended-functionality/type-system/mysql-and-native-types/index.html.md) | Next: [Changed Error Messages](https://php7explained.com/new-and-extended-functionality/type-system/changed-error-messages/index.html.md)
