Skip to content

Commit e27edfb

Browse files
committed
Fix PHP 5.3 support
1 parent 024dc93 commit e27edfb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/JsonSchema/Tests/ValidatorTestCase.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,17 @@ protected function decodeJsonFromFile($file)
133133

134134
private function dump($variable)
135135
{
136-
$options = JSON_PRETTY_PRINT;
136+
if (defined('JSON_PRETTY_PRINT')) {
137+
$options = JSON_PRETTY_PRINT;
137138

138-
if (defined('JSON_PRESERVE_ZERO_FRACTION')) {
139-
$options |= JSON_PRESERVE_ZERO_FRACTION;
139+
if (defined('JSON_PRESERVE_ZERO_FRACTION')) {
140+
$options |= JSON_PRESERVE_ZERO_FRACTION;
141+
}
142+
143+
return json_encode($variable, $options);
140144
}
141145

142-
return json_encode($variable, $options);
146+
return print_r($variable, true);
143147
}
144148

145149
private function assertHasError(array $errors, array $reportParameters)

0 commit comments

Comments
 (0)