diff --git a/Spyc.php b/Spyc.php index c289bfe..f3d47c2 100644 --- a/Spyc.php +++ b/Spyc.php @@ -667,7 +667,7 @@ private function _toType($value) { if ( is_numeric($value) && preg_match ('/^(-|)[1-9]+[0-9]*$/', $value) ){ $intvalue = (int)$value; - if ($intvalue != PHP_INT_MAX) + if ($intvalue != PHP_INT_MAX && $intvalue != ~PHP_INT_MAX) $value = $intvalue; return $value; }