Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cast property value to boolean using boolean() method
- Loading branch information
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
use com\selfcoders\pini\Pini; | ||
|
||
require_once __DIR__ . "/../vendor/autoload.php"; | ||
|
||
$ini = new Pini(__DIR__ . "/example.ini"); | ||
|
||
$section = $ini->getSection("my section"); | ||
|
||
echo "some key = " . var_export($property = $section->getProperty("some key")->boolean(), true) . "\n"; | ||
echo "some bool = " . var_export($property = $section->getProperty("some bool")->boolean(), true) . "\n"; | ||
echo "another bool = " . var_export($property = $section->getProperty("another bool")->boolean(), true) . "\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters