-
-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayAccess doesn't work in zephir-land #1400
Comments
Well ArrayAccess interface doesn't work at all in zephir-land. Even isset or array["index"] when array is object implementing ArrayAcces doesn't work: test.zep: namespace Arraytest;
class Test implements \ArrayAccess
{
protected test;
public function __construct() {
let this->test = [
"one":1,
"two":2,
"three":3
];
}
public function offsetSet(offset, value)
{
if is_null(offset) {
let this->test[] = value;
} else {
let this->test[offset] = value;
}
}
public function offsetExists(offset) {
return isset this->test[offset];
}
public function offsetUnset(offset) {
unset this->test[offset];
}
public function offsetGet(offset) {
return isset this->test[offset] ? this->test[offset] : null;
}
} test2.zep:
test.php:
Returns:
|
Looks like #1061 this issue was related but code to reproduce got deleted. |
@dreamsxin Could you please take a look |
Not sure if fetch keyword supports ArrayAccess interface. Doesn't seems so, check this PR for more phalcon/cphalcon#12670
It could be nice to implement it imho.
The text was updated successfully, but these errors were encountered: