Skip to content

Commit 17e16c0

Browse files
committedJun 12, 2016
Example in README updated.
1 parent 9cb5e31 commit 17e16c0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This library allows usage of [RFC6901](https://tools.ietf.org/html/rfc6901)-comp
1313

1414
##Features
1515
* Supports PHP 5.6, PHP 7.0 and HHVM
16-
* No extensions required
16+
* No PHP extensions required
1717
* Throws SPL exceptions
1818

1919
#License
@@ -71,13 +71,13 @@ $result = $pointer
7171
// Treating PHP arrays as objects (not compliant with RFC6901, but
7272
// it's the only way to access non-numeric index in PHP array).
7373
$subData = ['g' => 2, 'h' => 3];
74+
$pointer->write($subData); // Sets $data->a->c to ['g' => 2, 'h' => 3].
7475
$link = '/a/c/g'; // Link to non-numeric index of array.
75-
$result = $pointer
76-
->write($subData) // Sets $data->a->c to ['g' => 2, 'h' => 3].
76+
$result = $pointer
7777
->setText($link)
7878
->test(); // Sets $result to FALSE.
7979
$result $pointer
80-
->setOptions(Pointer::OPTION_NON_NUMERIC_ARRAY_INDICES)
80+
->setOptions(Pointer::OPTION_NON_NUMERIC_INDICES)
8181
->test(); // Sets $result to TRUE.
8282
echo $pointer->read(); // 2
8383
```

‎src/Pointer/Evaluate/Write.php

-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ protected function processNonExistingArrayIndex(Reference $reference)
6767
$result = null;
6868
return $this->setResult($result);
6969
}
70-
var_export($this->cursor);
71-
var_export($index);
7270
$indexText = is_int($index) ? "{$index}" : "'{$index}'";
7371
throw new EvaluateException("Accessing non-existing index {$indexText} in array");
7472
}

0 commit comments

Comments
 (0)