--TEST-- Test V8::executeString() : Check array access setter behaviour --SKIPIF-- --INI-- v8js.use_array_access = 1 --FILE-- data[$offset]); } public function offsetGet($offset) { return $this->data[$offset]; } public function offsetSet($offset, $value) { $this->data[$offset] = $value; } public function offsetUnset($offset) { throw new Exception('Not implemented'); } public function count() { return count($this->data); } } } else { class MyArray implements ArrayAccess, Countable { private $data = array('one', 'two', 'three'); public function offsetExists($offset): bool { return isset($this->data[$offset]); } public function offsetGet(mixed $offset): mixed { return $this->data[$offset]; } public function offsetSet(mixed $offset, mixed $value): void { $this->data[$offset] = $value; } public function offsetUnset(mixed $offset): void { throw new Exception('Not implemented'); } public function count(): int { return count($this->data); } } } $myarr = new MyArray(); $myarr[0] = 'three'; $js = <<myarr = $myarr; $v8->executeString($js); var_dump($myarr[2]); ?> ===EOF=== --EXPECT-- string(5) "three" string(3) "one" string(13) "three,two,one" string(3) "one" ===EOF===