Skip to content
Snippets Groups Projects
Unverified Commit fccbbd6e authored by Viacheslav Poturaev's avatar Viacheslav Poturaev Committed by GitHub
Browse files

Fix PHP version check (#30)

parent df305359
No related merge requests found
......@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.7.4] - 2020-01-26
### Fixed
- PHP version check for empty property name support.
## [3.7.3] - 2020-01-24
### Fixed
......@@ -35,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Compatibility option to `TOLERATE_ASSOCIATIVE_ARRAYS` that mimic JSON objects.
[3.7.4]: https://github.com/swaggest/json-diff/compare/v3.7.3...v3.7.4
[3.7.3]: https://github.com/swaggest/json-diff/compare/v3.7.2...v3.7.3
[3.7.2]: https://github.com/swaggest/json-diff/compare/v3.7.1...v3.7.2
[3.7.1]: https://github.com/swaggest/json-diff/compare/v3.7.0...v3.7.1
......
......@@ -104,7 +104,7 @@ class JsonPointer
$ref = &$holder;
while (null !== $key = array_shift($pathItems)) {
if ($ref instanceof \stdClass || is_object($ref)) {
if (PHP_VERSION_ID < 71000 && '' === $key) {
if (PHP_VERSION_ID < 70100 && '' === $key) {
throw new Exception('Empty property name is not supported by PHP <7.1',
Exception::EMPTY_PROPERTY_NAME_UNSUPPORTED);
}
......@@ -202,7 +202,7 @@ class JsonPointer
$ref = $holder;
while (null !== $key = array_shift($pathItems)) {
if ($ref instanceof \stdClass) {
if (PHP_VERSION_ID < 71000 && '' === $key) {
if (PHP_VERSION_ID < 70100 && '' === $key) {
throw new Exception('Empty property name is not supported by PHP <7.1',
Exception::EMPTY_PROPERTY_NAME_UNSUPPORTED);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment