Skip to content

Commit

Permalink
Merge pull request #9 from lvht/int
Browse files Browse the repository at this point in the history
fix convert int to float issue
  • Loading branch information
leonelquinteros authored Sep 25, 2017
2 parents fa8ca7c + cfb54df commit efe540a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Toml.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,10 @@ private static function parseValue($val)
{
$val = str_replace('_', '', $val);

if(is_int($val))
$intVal = filter_var($val, FILTER_VALIDATE_INT);
if($intVal !== false)
{
$parsedVal = (int) $val;
$parsedVal = $intVal;
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions travis-test/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,5 @@ color = "gray"

[user.contributed.cases]
slashes="SERVER\\MASTER"

foo = [1,2,3.1, +1, -1, -2.5]

0 comments on commit efe540a

Please sign in to comment.