Skip to content

Commit fccbbd6

Browse files
authored
Fix PHP version check (#30)
1 parent df30535 commit fccbbd6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.7.4] - 2020-01-26
8+
9+
### Fixed
10+
- PHP version check for empty property name support.
11+
712
## [3.7.3] - 2020-01-24
813

914
### Fixed
@@ -35,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3540
### Added
3641
- Compatibility option to `TOLERATE_ASSOCIATIVE_ARRAYS` that mimic JSON objects.
3742

43+
[3.7.4]: https://github.com/swaggest/json-diff/compare/v3.7.3...v3.7.4
3844
[3.7.3]: https://github.com/swaggest/json-diff/compare/v3.7.2...v3.7.3
3945
[3.7.2]: https://github.com/swaggest/json-diff/compare/v3.7.1...v3.7.2
4046
[3.7.1]: https://github.com/swaggest/json-diff/compare/v3.7.0...v3.7.1

src/JsonPointer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public static function add(&$holder, $pathItems, $value, $flags = self::RECURSIV
104104
$ref = &$holder;
105105
while (null !== $key = array_shift($pathItems)) {
106106
if ($ref instanceof \stdClass || is_object($ref)) {
107-
if (PHP_VERSION_ID < 71000 && '' === $key) {
107+
if (PHP_VERSION_ID < 70100 && '' === $key) {
108108
throw new Exception('Empty property name is not supported by PHP <7.1',
109109
Exception::EMPTY_PROPERTY_NAME_UNSUPPORTED);
110110
}
@@ -202,7 +202,7 @@ public static function get($holder, $pathItems)
202202
$ref = $holder;
203203
while (null !== $key = array_shift($pathItems)) {
204204
if ($ref instanceof \stdClass) {
205-
if (PHP_VERSION_ID < 71000 && '' === $key) {
205+
if (PHP_VERSION_ID < 70100 && '' === $key) {
206206
throw new Exception('Empty property name is not supported by PHP <7.1',
207207
Exception::EMPTY_PROPERTY_NAME_UNSUPPORTED);
208208
}

0 commit comments

Comments
 (0)