summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-09-04 14:44:55 +0000
committerMarcus Boerger <helly@php.net>2003-09-04 14:44:55 +0000
commit0f91d8a4f6508f8885a82f7f713a9a3770d6462d (patch)
tree9412f196a811c65f5500c6d93728d3a7fe8cd75e /ext
parentf4511d4aae675acd4b56de01401ce94e1cc4b57c (diff)
downloadphp-git-0f91d8a4f6508f8885a82f7f713a9a3770d6462d.tar.gz
Go with stdlyCaps
Diffstat (limited to 'ext')
-rwxr-xr-xext/spl/examples/dba_reader.inc2
-rwxr-xr-xext/spl/examples/filter.inc4
-rwxr-xr-xext/spl/examples/key_filter.inc4
-rwxr-xr-xext/spl/examples/sub_dir.inc16
-rwxr-xr-xext/spl/php_spl.c4
-rwxr-xr-xext/spl/spl_array.c20
-rwxr-xr-xext/spl/spl_directory.c16
-rwxr-xr-xext/spl/spl_foreach.c6
-rwxr-xr-xext/spl/tests/array_iterator.phpt12
-rwxr-xr-xext/spl/tests/foreach.phpt87
-rwxr-xr-xext/spl/tests/foreach_break.phpt26
-rwxr-xr-xext/spl/tests/foreach_continue.phpt28
-rwxr-xr-xext/spl/tests/foreach_non_spl.phpt2
-rwxr-xr-xext/spl/tests/forward.phpt26
-rwxr-xr-xext/spl/tests/sequence.phpt24
15 files changed, 143 insertions, 134 deletions
diff --git a/ext/spl/examples/dba_reader.inc b/ext/spl/examples/dba_reader.inc
index e31960a54d..b8c7365f97 100755
--- a/ext/spl/examples/dba_reader.inc
+++ b/ext/spl/examples/dba_reader.inc
@@ -64,7 +64,7 @@ class dba_reader implements spl_sequence_assoc
/**
* @return Whether more elements are available.
*/
- function has_more() {
+ function hasMore() {
if ($this->db && $this->key !== false) {
return true;
} else {
diff --git a/ext/spl/examples/filter.inc b/ext/spl/examples/filter.inc
index be25d6b1aa..1cab580edd 100755
--- a/ext/spl/examples/filter.inc
+++ b/ext/spl/examples/filter.inc
@@ -51,7 +51,7 @@ class filter implements spl_forward
*/
protected function fetch() {
$this->curr = false;
- while ($this->it->has_more()) {
+ while ($this->it->hasMore()) {
$curr = $this->it->current();
if ($this->accept($curr)) {
$this->curr = $curr;
@@ -74,7 +74,7 @@ class filter implements spl_forward
/**
* @return Whether more elements are available
*/
- function has_more() {
+ function hasMore() {
return $this->curr !== false;
}
diff --git a/ext/spl/examples/key_filter.inc b/ext/spl/examples/key_filter.inc
index e8c4e42edc..47ceed2246 100755
--- a/ext/spl/examples/key_filter.inc
+++ b/ext/spl/examples/key_filter.inc
@@ -49,7 +49,7 @@ class key_filter implements spl_forward_assoc
protected function fetch() {
$this->key = false;
$this->curr = false;
- while ($this->it->has_more()) {
+ while ($this->it->hasMore()) {
$key = $this->it->key();
if (ereg($this->regex, $key)) {
$this->key = $key;
@@ -73,7 +73,7 @@ class key_filter implements spl_forward_assoc
/**
* @return Whether more elements are available
*/
- function has_more() {
+ function hasMore() {
return $this->key !== false;
}
diff --git a/ext/spl/examples/sub_dir.inc b/ext/spl/examples/sub_dir.inc
index aa6daba5f9..2e869e78d4 100755
--- a/ext/spl/examples/sub_dir.inc
+++ b/ext/spl/examples/sub_dir.inc
@@ -43,7 +43,7 @@ class sub_dir implements spl_sequence
$this->adir[1] = $dir;
$this->cnt = 1;
if ($this->nodots) {
- while ($dir->has_more()) {
+ while ($dir->hasMore()) {
$ent = $dir->current();
if ($ent != '.' && $ent != '..') {
break;
@@ -62,7 +62,7 @@ class sub_dir implements spl_sequence
if ($this->cnt) {
$dir = $this->adir[$this->cnt];
$ent = $dir->current();
- $path = $dir->get_path().'/'.$ent;
+ $path = $dir->getPath().'/'.$ent;
if ($ent != '.' && $ent != '..' && is_dir($path)) {
$new = new spl_dir($path);
$new->path = $dir->path.$ent.'/';
@@ -70,7 +70,7 @@ class sub_dir implements spl_sequence
$this->adir[$this->cnt] = $new;
if ($this->nodots) {
$dir->has_more = false;
- while ($new->has_more()) {
+ while ($new->hasMore()) {
$ent = $new->current();
if ($ent != '.' && $ent != '..') {
$dir->has_more = true;
@@ -79,7 +79,7 @@ class sub_dir implements spl_sequence
$new->next();
}
} else {
- $dir->has_more = $dir->has_more();
+ $dir->has_more = $dir->hasMore();
}
}
$dir->next();
@@ -89,10 +89,10 @@ class sub_dir implements spl_sequence
/**
* @return Whether more dirs or files entries are available.
*/
- function has_more() {
+ function hasMore() {
while ($this->cnt) {
$dir = $this->adir[$this->cnt];
- if ($dir->has_more()) {
+ if ($dir->hasMore()) {
return true;
}
unset($this->adir[$this->cnt--]);
@@ -109,11 +109,11 @@ class sub_dir implements spl_sequence
$prefix = '';
for ($i = 1; $i < $this->cnt; $i++) {
$dir = $this->adir[$i];
- $prefix .= $dir->has_more() ? '| ' : ' ';
+ $prefix .= $dir->hasMore() ? '| ' : ' ';
}
$dir = $this->adir[$this->cnt];
$ent = $dir->current();
- $prefix .= $dir->has_more() ? '+-' : '\-';
+ $prefix .= $dir->hasMore() ? '+-' : '\-';
return $prefix . $ent;
} else {
$dir = $this->adir[$this->cnt];
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 9704fe261d..1eef9e085a 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -117,14 +117,14 @@ ZEND_BEGIN_ARG_INFO(arginfo_two_params, 0)
ZEND_END_ARG_INFO();
function_entry spl_funcs_iterator[] = {
- SPL_ABSTRACT_FE(iterator, new_iterator, NULL)
+ SPL_ABSTRACT_FE(iterator, newiterator, NULL)
{NULL, NULL, NULL}
};
function_entry spl_funcs_forward[] = {
SPL_ABSTRACT_FE(forward, current, NULL)
SPL_ABSTRACT_FE(forward, next, NULL)
- SPL_ABSTRACT_FE(forward, has_more, NULL)
+ SPL_ABSTRACT_FE(forward, hasmore, NULL)
{NULL, NULL, NULL}
};
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 6c066a1589..e052c503e1 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -301,12 +301,12 @@ ZEND_EXECUTE_HOOK_FUNCTION(ZEND_UNSET_DIM_OBJ)
/* }}} */
SPL_CLASS_FUNCTION(array, __construct);
-SPL_CLASS_FUNCTION(array, new_iterator);
+SPL_CLASS_FUNCTION(array, newiterator);
SPL_CLASS_FUNCTION(array, rewind);
SPL_CLASS_FUNCTION(array, current);
SPL_CLASS_FUNCTION(array, key);
SPL_CLASS_FUNCTION(array, next);
-SPL_CLASS_FUNCTION(array, has_more);
+SPL_CLASS_FUNCTION(array, hasmore);
static
ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0)
@@ -315,7 +315,7 @@ ZEND_END_ARG_INFO();
static zend_function_entry spl_array_class_functions[] = {
SPL_CLASS_FE(array, __construct, arginfo_array___construct, ZEND_ACC_PUBLIC)
- SPL_CLASS_FE(array, new_iterator, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(array, newiterator, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -325,7 +325,7 @@ static zend_function_entry spl_array_it_class_functions[] = {
SPL_CLASS_FE(array, current, NULL, ZEND_ACC_PUBLIC)
SPL_CLASS_FE(array, key, NULL, ZEND_ACC_PUBLIC)
SPL_CLASS_FE(array, next, NULL, ZEND_ACC_PUBLIC)
- SPL_CLASS_FE(array, has_more, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(array, hasmore, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -459,7 +459,7 @@ static zval *spl_array_read_dimension(zval *object, zval *offset TSRMLS_DC)
index = Z_LVAL_P(offset);
}
if (zend_hash_index_find(HASH_OF(intern->array), index, (void **) &retval) == FAILURE) {
- zend_error(E_NOTICE,"Undefined offset: %d", Z_LVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset));
return EG(uninitialized_zval_ptr);
} else {
return *retval;
@@ -522,7 +522,7 @@ static void spl_array_unset_dimension(zval *object, zval *offset TSRMLS_DC)
index = Z_LVAL_P(offset);
}
if (zend_hash_index_del(HASH_OF(intern->array), index) == FAILURE) {
- zend_error(E_NOTICE,"Undefined offset: %d", Z_LVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset));
}
return;
default:
@@ -598,9 +598,9 @@ SPL_CLASS_FUNCTION(array, __construct)
}
/* }}} */
-/* {{{ proto spl_array_it|NULL spl_array::new_iterator()
+/* {{{ proto spl_array_it|NULL spl_array::newIterator()
Create a new iterator from a spl_array instance */
-SPL_CLASS_FUNCTION(array, new_iterator)
+SPL_CLASS_FUNCTION(array, newiterator)
{
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
@@ -740,9 +740,9 @@ SPL_CLASS_FUNCTION(array, next)
}
/* }}} */
-/* {{{ proto bool spl_array_it::has_more()
+/* {{{ proto bool spl_array_it::hasMore()
Check whether array contains more entries */
-SPL_CLASS_FUNCTION(array, has_more)
+SPL_CLASS_FUNCTION(array, hasmore)
{
zval *object = getThis();
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index b343e97a22..a698d36a2e 100755
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -40,8 +40,8 @@ SPL_CLASS_FUNCTION(dir, __construct);
SPL_CLASS_FUNCTION(dir, rewind);
SPL_CLASS_FUNCTION(dir, current);
SPL_CLASS_FUNCTION(dir, next);
-SPL_CLASS_FUNCTION(dir, has_more);
-SPL_CLASS_FUNCTION(dir, get_path);
+SPL_CLASS_FUNCTION(dir, hasmore);
+SPL_CLASS_FUNCTION(dir, getpath);
static
ZEND_BEGIN_ARG_INFO(arginfo_dir___construct, 0)
@@ -53,8 +53,8 @@ static zend_function_entry spl_dir_class_functions[] = {
SPL_CLASS_FE(dir, rewind, NULL, ZEND_ACC_PUBLIC)
SPL_CLASS_FE(dir, current, NULL, ZEND_ACC_PUBLIC)
SPL_CLASS_FE(dir, next, NULL, ZEND_ACC_PUBLIC)
- SPL_CLASS_FE(dir, has_more, NULL, ZEND_ACC_PUBLIC)
- SPL_CLASS_FE(dir, get_path, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(dir, hasmore, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(dir, getpath, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
@@ -243,9 +243,9 @@ SPL_CLASS_FUNCTION(dir, next)
}
/* }}} */
-/* {{{ proto string has_more()
+/* {{{ proto string hasMore()
Check whether dir contains more entries */
-SPL_CLASS_FUNCTION(dir, has_more)
+SPL_CLASS_FUNCTION(dir, hasmore)
{
zval *object = getThis();
spl_dir_object *intern = (spl_dir_object*)zend_object_store_get_object(object TSRMLS_CC);
@@ -254,9 +254,9 @@ SPL_CLASS_FUNCTION(dir, has_more)
}
/* }}} */
-/* {{{ proto string get_path()
+/* {{{ proto string getPath()
Return directory path */
-SPL_CLASS_FUNCTION(dir, get_path)
+SPL_CLASS_FUNCTION(dir, getpath)
{
zval *object = getThis();
spl_dir_object *intern = (spl_dir_object*)zend_object_store_get_object(object TSRMLS_CC);
diff --git a/ext/spl/spl_foreach.c b/ext/spl/spl_foreach.c
index 54d4e06a45..90441415d8 100755
--- a/ext/spl/spl_foreach.c
+++ b/ext/spl/spl_foreach.c
@@ -69,11 +69,11 @@ ZEND_EXECUTE_HOOK_FUNCTION(ZEND_FE_RESET)
if (is_a & SPL_IS_A_ITERATOR) {
spl_unlock_zval_ptr_ptr(&EX(opline)->op1, EX(Ts) TSRMLS_CC);
obj_ce = instance_ce;
- spl_call_method_0(obj, obj_ce, NULL, "new_iterator", sizeof("new_iterator")-1, &retval);
+ spl_call_method_0(obj, obj_ce, NULL, "newiterator", sizeof("newiterator")-1, &retval);
instance_ce = spl_get_class_entry(retval TSRMLS_CC);
is_a = spl_implements(instance_ce);
if (!(is_a & SPL_IS_A_FORWARD)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Objects created by %s::new_iterator() must implement spl_forward", obj_ce->name);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Objects created by %s::newIterator() must implement spl_forward", obj_ce->name);
ZEND_EXECUTE_HOOK_ORIGINAL(ZEND_FE_RESET);
}
spl_pzval_lock_func(retval);
@@ -158,7 +158,7 @@ ZEND_EXECUTE_HOOK_FUNCTION(ZEND_FE_FETCH)
op_array->opcodes[EX(opline)->op2.u.opline_num].op2 = *op1;
}
- spl_call_method_0(obj, proxy->obj_ce, &proxy->funcs.more, "has_more", sizeof("has_more")-1, &more);
+ spl_call_method_0(obj, proxy->obj_ce, &proxy->funcs.more, "hasmore", sizeof("hasmore")-1, &more);
has_more = i_zend_is_true(more);
zval_dtor(more);
FREE_ZVAL(more);
diff --git a/ext/spl/tests/array_iterator.phpt b/ext/spl/tests/array_iterator.phpt
index 57e1976f03..167498a19d 100755
--- a/ext/spl/tests/array_iterator.phpt
+++ b/ext/spl/tests/array_iterator.phpt
@@ -112,11 +112,11 @@ echo "Done\n";
1=>1 - 0=>0
1=>1 - 1=>1
-Notice: next(): Array was modified outside object and internal position is no longer valid in %sarray_iterator.php on line %d
+Notice: spl_array_it::next(): Array was modified outside object and internal position is no longer valid in %sarray_iterator.php on line %d
1=>1 - 0=>0
1=>1 - 2=>2
-Notice: next(): Array was modified outside object and internal position is no longer valid in %sarray_iterator.php on line %d
+Notice: spl_array_it::next(): Array was modified outside object and internal position is no longer valid in %sarray_iterator.php on line %d
0=>0 - 0=>0
0=>0 - 2=>2
2=>2 - 0=>0
@@ -128,11 +128,11 @@ Notice: next(): Array was modified outside object and internal position is no lo
1=>1 - 0=>0
1=>1 - 1=>1
-Notice: next(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
+Notice: spl_array_it::next(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
-Notice: has_more(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
+Notice: spl_array_it::hasmore(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
-Notice: next(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
+Notice: spl_array_it::next(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
-Notice: has_more(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
+Notice: spl_array_it::hasmore(): Array was modified outside object and is no longer an array in %sarray_iterator.php on line %d
Done
diff --git a/ext/spl/tests/foreach.phpt b/ext/spl/tests/foreach.phpt
index de05f4b3f5..c6b8b1c4ec 100755
--- a/ext/spl/tests/foreach.phpt
+++ b/ext/spl/tests/foreach.phpt
@@ -10,6 +10,8 @@ class c_iter implements spl_forward_assoc {
private $num = 0;
function __construct($obj) {
+ echo __METHOD__ . "\n";
+ $this->num = 0;
$this->obj = $obj;
}
function current() {
@@ -20,7 +22,7 @@ class c_iter implements spl_forward_assoc {
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
$more = $this->num < $this->obj->max;
echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
return $more;
@@ -40,7 +42,7 @@ class c implements spl_iterator {
public $max = 3;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -48,7 +50,7 @@ class c implements spl_iterator {
$t = new c();
-for ($iter = $t->new_iterator(); $iter->has_more(); $iter->next()) {
+for ($iter = $t->newIterator(); $iter->hasMore(); $iter->next()) {
echo $iter->current() . "\n";
}
@@ -74,120 +76,127 @@ foreach($t as $i => $v) {
print "Done\n";
?>
--EXPECT--
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::__construct
+c_iter::hasmore = true
c_iter::current
0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
1
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
2
c_iter::next
-c_iter::has_more = false
+c_iter::hasmore = false
array:0
array:1
array:2
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::__construct
+c_iter::hasmore = true
c_iter::current
c_iter::key
object:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
object:1
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
object:2
c_iter::next
-c_iter::has_more = false
-c::new_iterator
-c_iter::has_more = true
+c_iter::hasmore = false
+c::newiterator
+c_iter::__construct
+c_iter::hasmore = true
c_iter::current
c_iter::key
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::__construct
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:0:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:0:1
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:0:2
c_iter::next
-c_iter::has_more = false
+c_iter::hasmore = false
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::__construct
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:1:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:1:1
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:1:2
c_iter::next
-c_iter::has_more = false
+c_iter::hasmore = false
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::__construct
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:2:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:2:1
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:2:2
c_iter::next
-c_iter::has_more = false
+c_iter::hasmore = false
c_iter::next
-c_iter::has_more = false
-c::new_iterator
-c_iter::has_more = true
+c_iter::hasmore = false
+c::newiterator
+c_iter::__construct
+c_iter::hasmore = true
c_iter::current
c_iter::key
object:1st=>0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
object:2nd=>1
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
object:3rd=>2
c_iter::next
-c_iter::has_more = false
-Done \ No newline at end of file
+c_iter::hasmore = false
+Done
diff --git a/ext/spl/tests/foreach_break.phpt b/ext/spl/tests/foreach_break.phpt
index b17831c74c..82fdc03527 100755
--- a/ext/spl/tests/foreach_break.phpt
+++ b/ext/spl/tests/foreach_break.phpt
@@ -20,7 +20,7 @@ class c_iter implements spl_forward_assoc {
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
$more = $this->num < $this->obj->max;
echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
return $more;
@@ -40,7 +40,7 @@ class c implements spl_iterator {
public $max = 3;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -58,33 +58,33 @@ foreach($t as $v) {
print "Done\n";
?>
--EXPECT--
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::hasmore = true
c_iter::current
c_iter::key
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:0:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:1:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
c_iter::key
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::hasmore = true
c_iter::current
c_iter::key
double:2:0
c_iter::next
-c_iter::has_more = false
+c_iter::hasmore = false
Done
diff --git a/ext/spl/tests/foreach_continue.phpt b/ext/spl/tests/foreach_continue.phpt
index aa8b40f63b..760460d2f4 100755
--- a/ext/spl/tests/foreach_continue.phpt
+++ b/ext/spl/tests/foreach_continue.phpt
@@ -20,7 +20,7 @@ class c_iter implements spl_forward {
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
$more = $this->num < $this->obj->max;
echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
return $more;
@@ -31,7 +31,7 @@ class c implements spl_iterator {
public $max = 4;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -64,38 +64,38 @@ foreach($t as $v) {
print "Done\n";
?>
--EXPECT--
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::hasmore = true
c_iter::current
continue outer
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::hasmore = true
c_iter::current
double:1:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
continue inner
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
break inner
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
-c::new_iterator
-c_iter::has_more = true
+c::newiterator
+c_iter::hasmore = true
c_iter::current
double:2:0
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
continue inner
c_iter::next
-c_iter::has_more = true
+c_iter::hasmore = true
c_iter::current
break inner
break outer
diff --git a/ext/spl/tests/foreach_non_spl.phpt b/ext/spl/tests/foreach_non_spl.phpt
index bb2eed1c1e..71a7cb7f4d 100755
--- a/ext/spl/tests/foreach_non_spl.phpt
+++ b/ext/spl/tests/foreach_non_spl.phpt
@@ -30,7 +30,7 @@ class c2 {
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
echo __METHOD__ . "\n";
return $this->num < $this->max;
}
diff --git a/ext/spl/tests/forward.phpt b/ext/spl/tests/forward.phpt
index 1be8f1913e..6acb697f89 100755
--- a/ext/spl/tests/forward.phpt
+++ b/ext/spl/tests/forward.phpt
@@ -17,7 +17,7 @@ class c implements spl_forward_assoc {
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
echo __METHOD__ . "\n";
return $this->num < $this->max;
}
@@ -86,51 +86,51 @@ Array
Array
(
[0] => current
- [1] => has_more
+ [1] => hasmore
[2] => key
[3] => next
)
Array
(
[0] => current
- [1] => has_more
+ [1] => hasmore
[2] => key
[3] => next
)
1st try
-c::has_more
+c::hasmore
c::current
c::key
object:0
c::next
-c::has_more
+c::hasmore
c::current
c::key
object:1
c::next
-c::has_more
+c::hasmore
c::current
c::key
object:2
c::next
-c::has_more
+c::hasmore
2nd try
-c::has_more
+c::hasmore
3rd try
-c::has_more
+c::hasmore
c::current
c::key
object:1st=>0
c::next
-c::has_more
+c::hasmore
c::current
c::key
object:2nd=>1
c::next
-c::has_more
+c::hasmore
c::current
c::key
object:3rd=>2
c::next
-c::has_more
-Done \ No newline at end of file
+c::hasmore
+Done
diff --git a/ext/spl/tests/sequence.phpt b/ext/spl/tests/sequence.phpt
index aa8d2c4258..e6d9da2e12 100755
--- a/ext/spl/tests/sequence.phpt
+++ b/ext/spl/tests/sequence.phpt
@@ -8,7 +8,7 @@ class c implements spl_iterator {
public $max = 3;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -34,7 +34,7 @@ class c_iter implements spl_sequence_assoc {
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
echo __METHOD__ . "\n";
return $this->num < $this->obj->max;
}
@@ -50,7 +50,7 @@ class c_iter implements spl_sequence_assoc {
}
$t = new c();
-$i = $t->new_iterator();
+$i = $t->newIterator();
$c_info = array(get_class($t) => array('inheits' => class_parents($t), 'implements' => class_implements($t)),
get_class($i) => array('inheits' => class_parents($i), 'implements' => class_implements($i)));
@@ -67,7 +67,7 @@ foreach($i as $v => $w) {
print "Done\n";
?>
--EXPECT--
-c::new_iterator
+c::newiterator
Array
(
[c] => Array
@@ -102,37 +102,37 @@ Array
)
c_iter::rewind
-c_iter::has_more
+c_iter::hasmore
c_iter::current
c_iter::key
object:0
c_iter::next
-c_iter::has_more
+c_iter::hasmore
c_iter::current
c_iter::key
object:1
c_iter::next
-c_iter::has_more
+c_iter::hasmore
c_iter::current
c_iter::key
object:2
c_iter::next
-c_iter::has_more
+c_iter::hasmore
c_iter::rewind
-c_iter::has_more
+c_iter::hasmore
c_iter::current
c_iter::key
object:1st=>0
c_iter::next
-c_iter::has_more
+c_iter::hasmore
c_iter::current
c_iter::key
object:2nd=>1
c_iter::next
-c_iter::has_more
+c_iter::hasmore
c_iter::current
c_iter::key
object:3rd=>2
c_iter::next
-c_iter::has_more
+c_iter::hasmore
Done \ No newline at end of file