helly Thu Sep 4 10:44:56 2003 EDT
Modified files:
/spl php_spl.c spl_array.c spl_directory.c spl_foreach.c
/spl/examples dba_reader.inc filter.inc key_filter.inc sub_dir.inc
/spl/tests array_iterator.phpt foreach.phpt foreach_break.phpt
foreach_continue.phpt foreach_non_spl.phpt forward.phpt
sequence.phpt
Log:
Go with stdlyCaps
Index: spl/php_spl.c
diff -u spl/php_spl.c:1.14 spl/php_spl.c:1.15
--- spl/php_spl.c:1.14 Mon Aug 4 17:56:05 2003
+++ spl/php_spl.c Thu Sep 4 10:44:53 2003
@@ -105,26 +105,26 @@
#define SPL_ABSTRACT_FE(class, name, arg_info) \
{ #name, ZEND_FN(spl_abstract), arg_info, sizeof(arg_info)/sizeof(struct
_zend_arg_info)-1, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC },
-static
-ZEND_BEGIN_ARG_INFO(arginfo_one_param, 0)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO();
+static
+ZEND_BEGIN_ARG_INFO(arginfo_one_param, 0)
+ ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO();
-static
-ZEND_BEGIN_ARG_INFO(arginfo_two_params, 0)
- ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO();
+static
+ZEND_BEGIN_ARG_INFO(arginfo_two_params, 0)
+ ZEND_ARG_INFO(0, index)
+ ZEND_ARG_INFO(0, value)
+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}
};
Index: spl/spl_array.c
diff -u spl/spl_array.c:1.19 spl/spl_array.c:1.20
--- spl/spl_array.c:1.19 Wed Aug 20 20:10:49 2003
+++ spl/spl_array.c Thu Sep 4 10:44:53 2003
@@ -301,21 +301,21 @@
/* }}} */
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)
- ZEND_ARG_INFO(0, array)
-ZEND_END_ARG_INFO();
+static
+ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0)
+ ZEND_ARG_INFO(0, array)
+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 @@
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 @@
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 @@
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 @@
}
/* }}} */
-/* {{{ 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 @@
}
/* }}} */
-/* {{{ 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);
Index: spl/spl_directory.c
diff -u spl/spl_directory.c:1.8 spl/spl_directory.c:1.9
--- spl/spl_directory.c:1.8 Mon Aug 25 16:54:37 2003
+++ spl/spl_directory.c Thu Sep 4 10:44:53 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_directory.c,v 1.8 2003/08/25 20:54:37 helly Exp $ */
+/* $Id: spl_directory.c,v 1.9 2003/09/04 14:44:53 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -40,21 +40,21 @@
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)
- ZEND_ARG_INFO(0, path)
-ZEND_END_ARG_INFO();
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dir___construct, 0)
+ ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO();
static zend_function_entry spl_dir_class_functions[] = {
SPL_CLASS_FE(dir, __construct, arginfo_dir___construct, ZEND_ACC_PUBLIC)
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 @@
}
/* }}} */
-/* {{{ 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 @@
}
/* }}} */
-/* {{{ 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);
Index: spl/spl_foreach.c
diff -u spl/spl_foreach.c:1.20 spl/spl_foreach.c:1.21
--- spl/spl_foreach.c:1.20 Wed Aug 20 20:10:49 2003
+++ spl/spl_foreach.c Thu Sep 4 10:44:53 2003
@@ -69,11 +69,11 @@
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 @@
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);
Index: spl/examples/dba_reader.inc
diff -u spl/examples/dba_reader.inc:1.1 spl/examples/dba_reader.inc:1.2
--- spl/examples/dba_reader.inc:1.1 Wed Jul 16 17:52:03 2003
+++ spl/examples/dba_reader.inc Thu Sep 4 10:44:54 2003
@@ -64,7 +64,7 @@
/**
* @return Whether more elements are available.
*/
- function has_more() {
+ function hasMore() {
if ($this->db && $this->key !== false) {
return true;
} else {
Index: spl/examples/filter.inc
diff -u spl/examples/filter.inc:1.3 spl/examples/filter.inc:1.4
--- spl/examples/filter.inc:1.3 Sat Jul 19 05:50:18 2003
+++ spl/examples/filter.inc Thu Sep 4 10:44:54 2003
@@ -51,7 +51,7 @@
*/
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 @@
/**
* @return Whether more elements are available
*/
- function has_more() {
+ function hasMore() {
return $this->curr !== false;
}
Index: spl/examples/key_filter.inc
diff -u spl/examples/key_filter.inc:1.1 spl/examples/key_filter.inc:1.2
--- spl/examples/key_filter.inc:1.1 Wed Jul 16 17:52:03 2003
+++ spl/examples/key_filter.inc Thu Sep 4 10:44:54 2003
@@ -49,7 +49,7 @@
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 @@
/**
* @return Whether more elements are available
*/
- function has_more() {
+ function hasMore() {
return $this->key !== false;
}
Index: spl/examples/sub_dir.inc
diff -u spl/examples/sub_dir.inc:1.3 spl/examples/sub_dir.inc:1.4
--- spl/examples/sub_dir.inc:1.3 Thu Aug 14 17:14:04 2003
+++ spl/examples/sub_dir.inc Thu Sep 4 10:44:54 2003
@@ -43,7 +43,7 @@
$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 @@
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 @@
$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 @@
$new->next();
}
} else {
- $dir->has_more = $dir->has_more();
+ $dir->has_more = $dir->hasMore();
}
}
$dir->next();
@@ -89,10 +89,10 @@
/**
* @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 @@
$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];
Index: spl/tests/array_iterator.phpt
diff -u spl/tests/array_iterator.phpt:1.1 spl/tests/array_iterator.phpt:1.2
--- spl/tests/array_iterator.phpt:1.1 Sat Jul 19 21:22:03 2003
+++ spl/tests/array_iterator.phpt Thu Sep 4 10:44:55 2003
@@ -112,11 +112,11 @@
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 @@
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
Index: spl/tests/foreach.phpt
diff -u spl/tests/foreach.phpt:1.4 spl/tests/foreach.phpt:1.5
--- spl/tests/foreach.phpt:1.4 Wed Jun 4 16:54:13 2003
+++ spl/tests/foreach.phpt Thu Sep 4 10:44:55 2003
@@ -10,6 +10,8 @@
private $num = 0;
function __construct($obj) {
+ echo __METHOD__ . "\n";
+ $this->num = 0;
$this->obj = $obj;
}
function current() {
@@ -20,7 +22,7 @@
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 @@
public $max = 3;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -48,7 +50,7 @@
$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 @@
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
Index: spl/tests/foreach_break.phpt
diff -u spl/tests/foreach_break.phpt:1.3 spl/tests/foreach_break.phpt:1.4
--- spl/tests/foreach_break.phpt:1.3 Wed Jun 4 16:54:13 2003
+++ spl/tests/foreach_break.phpt Thu Sep 4 10:44:55 2003
@@ -20,7 +20,7 @@
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 @@
public $max = 3;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -58,33 +58,33 @@
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
Index: spl/tests/foreach_continue.phpt
diff -u spl/tests/foreach_continue.phpt:1.1 spl/tests/foreach_continue.phpt:1.2
--- spl/tests/foreach_continue.phpt:1.1 Sun Aug 10 09:17:02 2003
+++ spl/tests/foreach_continue.phpt Thu Sep 4 10:44:55 2003
@@ -20,7 +20,7 @@
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 @@
public $max = 4;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -64,39 +64,39 @@
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::current
+c_iter::next
+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::current
+c_iter::next
+c_iter::hasmore = true
+c_iter::current
break inner
break outer
Done
Index: spl/tests/foreach_non_spl.phpt
diff -u spl/tests/foreach_non_spl.phpt:1.1 spl/tests/foreach_non_spl.phpt:1.2
--- spl/tests/foreach_non_spl.phpt:1.1 Tue Jul 8 19:25:18 2003
+++ spl/tests/foreach_non_spl.phpt Thu Sep 4 10:44:55 2003
@@ -30,7 +30,7 @@
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
echo __METHOD__ . "\n";
return $this->num < $this->max;
}
Index: spl/tests/forward.phpt
diff -u spl/tests/forward.phpt:1.5 spl/tests/forward.phpt:1.6
--- spl/tests/forward.phpt:1.5 Tue Jun 17 16:18:10 2003
+++ spl/tests/forward.phpt Thu Sep 4 10:44:55 2003
@@ -17,7 +17,7 @@
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
echo __METHOD__ . "\n";
return $this->num < $this->max;
}
@@ -86,51 +86,51 @@
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
Index: spl/tests/sequence.phpt
diff -u spl/tests/sequence.phpt:1.4 spl/tests/sequence.phpt:1.5
--- spl/tests/sequence.phpt:1.4 Tue Jun 17 16:18:10 2003
+++ spl/tests/sequence.phpt Thu Sep 4 10:44:55 2003
@@ -8,7 +8,7 @@
public $max = 3;
- function new_iterator() {
+ function newIterator() {
echo __METHOD__ . "\n";
return new c_iter($this);
}
@@ -34,7 +34,7 @@
echo __METHOD__ . "\n";
$this->num++;
}
- function has_more() {
+ function hasMore() {
echo __METHOD__ . "\n";
return $this->num < $this->obj->max;
}
@@ -50,7 +50,7 @@
}
$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 @@
print "Done\n";
?>
--EXPECT--
-c::new_iterator
+c::newiterator
Array
(
[c] => Array
@@ -102,37 +102,37 @@
)
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
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php