@@ -11,7 +11,16 @@ class Pointer
11
11
* have string indices. This option can be used to enable non-numeric
12
12
* array indices addressing.
13
13
*/
14
- const OPTION_NON_NUMERIC_ARRAY_INDICES = 0x01 ;
14
+ const OPTION_NON_NUMERIC_INDICES = 0x01 ;
15
+ /**
16
+ * "Native" JSON arrays have consistent indices, so allowing to create
17
+ * arbitrary numeric indices will break them. But PHP arrays support
18
+ * arrays with "gaps" between indices, and this option enables writing
19
+ * to array at any index.
20
+ *
21
+ * @todo Implement this option.
22
+ */
23
+ const OPTION_WRITE_ANY_INDEX = 0x02 ;
15
24
16
25
/**
17
26
* Bit-packed options.
@@ -134,7 +143,7 @@ public function unsetData()
134
143
public function test ()
135
144
{
136
145
return Pointer \Evaluate \Test::factory ()
137
- ->setNonNumericArrayIndices ($ this ->hasOption (self ::OPTION_NON_NUMERIC_ARRAY_INDICES ))
146
+ ->setNonNumericIndices ($ this ->hasOption (self ::OPTION_NON_NUMERIC_INDICES ))
138
147
->setLocator ($ this ->getLocator ())
139
148
->setData ($ this ->getData ())
140
149
->perform ()
@@ -144,7 +153,7 @@ public function test()
144
153
public function &read ()
145
154
{
146
155
return Pointer \Evaluate \Read::factory ()
147
- ->setNonNumericArrayIndices ($ this ->hasOption (self ::OPTION_NON_NUMERIC_ARRAY_INDICES ))
156
+ ->setNonNumericIndices ($ this ->hasOption (self ::OPTION_NON_NUMERIC_INDICES ))
148
157
->setLocator ($ this ->getLocator ())
149
158
->setData ($ this ->getData ())
150
159
->perform ()
@@ -155,7 +164,7 @@ public function &read()
155
164
public function write ($ value )
156
165
{
157
166
Pointer \Evaluate \Write::factory ()
158
- ->setNonNumericArrayIndices ($ this ->hasOption (self ::OPTION_NON_NUMERIC_ARRAY_INDICES ))
167
+ ->setNonNumericIndices ($ this ->hasOption (self ::OPTION_NON_NUMERIC_INDICES ))
159
168
->setLocator ($ this ->getLocator ())
160
169
->setData ($ this ->getData ())
161
170
->setValue ($ value )
0 commit comments