com php-src: Fixed fixedarray iterator fetching: ext/spl/spl_ fixedarray.c ext/spl/tests/fixedarray_003.phpt
| From: | Dmitry Stogov | Date: | Sat, 15 Mar 2014 05:18:32 +0000 |
| Subject: | com php-src: Fixed fixedarray iterator fetching: ext/spl/spl_ fixedarray.c ext/spl/tests/fixedarray_003.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77648@lists.php.net to get a copy of this message | ||
Commit: 28e0a580180b201214acdac77f5afba39b74f33b
Author: Xinchen Hui <laruence@gmail.com> Sat, 15 Mar 2014 13:18:32 +0800
Parents: b2432872c493fa05f297c6a15f8a37246e8c2de4
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=28e0a580180b201214acdac77f5afba39b74f33b
Log:
Fixed fixedarray iterator fetching
Changed paths:
M ext/spl/spl_fixedarray.c
M ext/spl/tests/fixedarray_003.phpt
Diff:
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index 9ab8035..2a66b0f 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -877,7 +877,7 @@ static void spl_fixedarray_it_dtor(zend_object_iterator *iter TSRMLS_DC) /* {{{
static void spl_fixedarray_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
{
- spl_fixedarray_object *object = (spl_fixedarray_object*)Z_OBJ(iter->data);
+ spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_REWIND) {
zend_user_it_rewind(iter TSRMLS_CC);
@@ -889,7 +889,7 @@ static void spl_fixedarray_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{
static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
{
- spl_fixedarray_object *object = (spl_fixedarray_object*)Z_OBJ(iter->data);
+ spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_VALID) {
return zend_user_it_valid(iter TSRMLS_CC);
@@ -906,7 +906,7 @@ static int spl_fixedarray_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{
static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
{
zval zindex;
- spl_fixedarray_object *object = (spl_fixedarray_object*)Z_OBJ(iter->data);
+ spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_CURRENT) {
return zend_user_it_get_current_data(iter TSRMLS_CC);
@@ -928,7 +928,7 @@ static zval *spl_fixedarray_it_get_current_data(zend_object_iterator *iter TSRML
static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) /*
{{{ */
{
- spl_fixedarray_object *object = (spl_fixedarray_object*)Z_OBJ(iter->data);
+ spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_KEY) {
zend_user_it_get_current_key(iter, key TSRMLS_CC);
@@ -940,7 +940,7 @@ static void spl_fixedarray_it_get_current_key(zend_object_iterator *iter, zval *
static void spl_fixedarray_it_move_forward(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
{
- spl_fixedarray_object *object = (spl_fixedarray_object*)Z_OBJ(iter->data);
+ spl_fixedarray_object *object = Z_SPLFIXEDARRAY_P(&iter->data);
if (object->flags & SPL_FIXEDARRAY_OVERLOADED_NEXT) {
zend_user_it_move_forward(iter TSRMLS_CC);
@@ -1043,7 +1043,7 @@ zend_object_iterator_funcs spl_fixedarray_it_funcs = {
zend_object_iterator *spl_fixedarray_get_iterator(zend_class_entry *ce, zval *object, int by_ref
TSRMLS_DC) /* {{{ */
{
- spl_fixedarray_it *iterator;
+ spl_fixedarray_it *iterator;
if (by_ref) {
zend_throw_exception(spl_ce_RuntimeException, "An iterator cannot be used with foreach by
reference", 0 TSRMLS_CC);
diff --git a/ext/spl/tests/fixedarray_003.phpt b/ext/spl/tests/fixedarray_003.phpt
index 7a01145..69cec75 100644
--- a/ext/spl/tests/fixedarray_003.phpt
+++ b/ext/spl/tests/fixedarray_003.phpt
@@ -4,7 +4,7 @@ SPL: FixedArray: Iterators
<?php
class A extends SplFixedArray {
public $prop1 = "dummy";
- public $prop1 = "dummy";
+ public $prop2 = "dummy";
public function current() {
echo "A::current\n";