- Fix tests

- Update README.PARAMETER_PARSING_API
This commit is contained in:
Jani Taskinen 2007-11-02 19:41:12 +00:00
parent b489251177
commit a541bb8078
170 changed files with 5015 additions and 2526 deletions

View File

@ -31,28 +31,38 @@ resources cannot be auto-converted.
Type specifiers
---------------
a - array
b - boolean, stored in zend_bool
d - double
f - function or array containing php method call info (returned as
zend_fcall_info* and zend_fcall_info_cache*)
h - array (returned as HashTable*)
l - long
o - object (of any type)
O - object (of specific type, specified by class entry)
r - resource (stored in zval)
s - string (with possible null bytes) and its length
z - the actual zval
The following list shows the type specifier, its meaning and the parameter
types that need to be passed by address. All passed paramaters are set
if the PHP parameter is non optional and untouched if optional and the
parameter is not present. The only exception is O where the zend_class_entry*
has to be provided on input and is used to verify the PHP parameter is an
instance of that class.
a - array (zval*)
b - boolean (zend_bool)
C - class (zend_class_entry*)
d - double (double)
f - function or array containing php method call info (returned as
zend_fcall_info and zend_fcall_info_cache)
h - array (returned as HashTable*)
l - long (long)
o - object of any type (zval*)
O - object of specific type given by class entry (zval*, zend_class_entry)
r - resource (zval*)
s - string (with possible null bytes) and its length (char*, int)
z - the actual zval (zval*)
Z - the actual zval (zval**)
* - variable arguments list
The following characters also have a meaning in the specifier string:
| - indicates that the remaining parameters are optional, they
should be initialized to default values by the extension since they
will not be touched by the parsing function if they are not
passed to it.
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
! - the parameter it follows can be of specified type or NULL (only applies
to 's', 'a', 'o', 'O', 'r', 'h', 'C', 'z', and 'Z'). If NULL is passed,
the results pointer is set to NULL as well.
| - indicates that the remaining parameters are optional, they
should be initialized to default values by the extension since they
will not be touched by the parsing function if they are not
passed to it.
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
! - the parameter it follows can be of specified type or NULL (applies
to all specifiers except for 'b', 'l', and 'd'). If NULL is passed, the
results pointer is set to NULL as well.
Examples
--------
@ -62,8 +72,8 @@ char *s;
int s_len;
zval *param;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
&l, &s, &s_len, &param) == FAILURE) {
return;
&l, &s, &s_len, &param) == FAILURE) {
return;
}
@ -72,8 +82,8 @@ zval *obj;
double d = 0.5;
zend_class_entry *my_ce;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
&obj, my_ce, &d) == FAILURE) {
return;
&obj, my_ce, &d) == FAILURE) {
return;
}
@ -82,29 +92,18 @@ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
zval *obj;
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a",
&obj, &arr) == FAILURE) {
return;
&obj, &arr) == FAILURE) {
return;
}
/* Gets a separated array which can also be null. */
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!",
&arr) == FAILURE) {
return;
&arr) == FAILURE) {
return;
}
/* Get only the first three parameters (useful for varargs functions). */
zval *z;
zend_bool b;
zval *r;
if (zend_parse_parameters(3 TSRMLS_CC, "zbr!",
&z, &b, &r) == FAILURE) {
return;
}
/* Get either a set of 3 longs or a string. */
long l1, l2, l3;
char *s;
@ -118,13 +117,72 @@ char *s;
int length;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"lll", &l1, &l2, &l3) == SUCCESS) {
/* manipulate longs */
"lll", &l1, &l2, &l3) == SUCCESS) {
/* manipulate longs */
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"s", &s, &length) == SUCCESS) {
/* manipulate string */
"s", &s, &length) == SUCCESS) {
/* manipulate string */
} else {
/* output error */
/* output error */
return;
return;
}
/* Function that accepts only varargs (0 or more) */
int i, num_varargs;
zval ***varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &varargs, &num_varargs) == FAILURE) {
return;
}
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
if (varargs) {
efree(varargs);
}
/* Function that accepts a string, followed by varargs (1 or more) */
char *str;
int str_len;
int i, num_varargs;
zval ***varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s+", &str, &str_len, &varargs, &num_varargs) == FAILURE) {
return;
}
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
if (varargs) {
efree(varargs);
}
/* Function that takes an array, followed by varargs, and ending with a long */
long num;
zval *array;
int i, num_varargs;
zval ***varargs = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a*l", &array, &varargs, &num_varargs, &num) == FAILURE) {
return;
}
for (i = 0; i < num_varargs; i++) {
/* do something with varargs[i] */
}
if (varargs) {
efree(varargs);
}

View File

@ -10,7 +10,5 @@ array_walk($array, array($nonesuchvar,'show'));
--EXPECTF--
Notice: Undefined variable: nonesuchvar in %s on line %d
Notice: Non-callable array passed to zend_call_function() in %s on line %d
Warning: array_walk(): Unable to call Array() - function does not exist in %s on line %d
Warning: array_walk() expects parameter 2 to be valid callback, array given in %s on line %d
===DONE===

View File

@ -1,5 +1,7 @@
--TEST--
Bug #32290 (calling call_user_func_array() ends in infinite loop within child class)
--INI--
error_reporting=8191
--FILE--
<?php
@ -98,9 +100,8 @@ var_dump($x->doSomethingStatic(1));
===A===
TestB::doSomething(1)
Strict Standards: Non-static method TestA::doSomething() cannot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d
TestA::doSomething(2)
int(1)
Warning: call_user_func_array() expects parameter 1 to be valid callback, array given in %s on line %d
NULL
===B===
TestB::doSomethingThis(1)
@ -110,9 +111,8 @@ int(1)
===C===
TestB::doSomethingParent(1)
Strict Standards: Non-static method TestA::doSomethingParent() cannot be called statically, assuming $this from compatible context TestB in %sbug32290.php on line %d
TestA::doSomethingParent(2)
int(1)
Warning: call_user_func_array() expects parameter 1 to be valid callback, array given in %s on line %d
NULL
===D===
TestB::doSomethingParentThis(1)

View File

@ -33,7 +33,7 @@ $ctx->comment_preview[0] = 1;
$ctx->comment_preview[1] = 2;
var_dump($ctx->comment_preview);
?>
--EXPECT--
--EXPECTF--
array(2) {
[0]=>
int(1)
@ -46,9 +46,12 @@ array(2) {
[1]=>
int(2)
}
object(ArrayObject)#2 (2) {
[0]=>
int(1)
[1]=>
int(2)
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
}

View File

@ -41,15 +41,15 @@ var_dump($B);
===DONE===
--EXPECTF--
object(B)#%d (1) {
["value:protected"]=>
["value":protected]=>
string(1) "B"
}
object(C)#%d (1) {
["value:protected"]=>
["value":protected]=>
string(1) "C"
}
object(B)#%d (1) {
["value:protected"]=>
["value":protected]=>
string(1) "C"
}
===DONE===

View File

@ -33,7 +33,7 @@ string(3) "bar"
Notice: Undefined offset: 2 in %sbug37667.php on line 16
NULL
object(Test)#%d (1) {
["property:protected"]=>
["property":protected]=>
array(1) {
["foo"]=>
string(3) "bar"
@ -44,7 +44,7 @@ Notice: Indirect modification of overloaded property Test::$property has no effe
Notice: Indirect modification of overloaded property Test::$property has no effect in %sbug37667.php on line 21
object(Test)#%d (1) {
["property:protected"]=>
["property":protected]=>
array(1) {
["foo"]=>
string(3) "bar"

View File

@ -22,15 +22,15 @@ $rootNode->appendChild($rootNode);
--EXPECTF--
--- Catch exception with try/catch
object(DOMException)#%d (6) {
["message:protected"]=>
["message":protected]=>
string(23) "Hierarchy Request Error"
["string:private"]=>
["string":"Exception":private]=>
string(0) ""
["file:protected"]=>
["file":protected]=>
string(%d) "%sdom003.php"
["line:protected"]=>
["line":protected]=>
int(8)
["trace:private"]=>
["trace":"Exception":private]=>
array(1) {
[0]=>
array(6) {

View File

@ -32,15 +32,15 @@ try {
?>
--EXPECTF--
object(DOMException)#%d (6) {
["message:protected"]=>
["message":protected]=>
string(20) "Wrong Document Error"
["string:private"]=>
["string":"Exception":private]=>
string(0) ""
["file:protected"]=>
["file":protected]=>
string(%d) "%sdom_set_attr_node.php"
["line:protected"]=>
["line":protected]=>
int(%d)
["trace:private"]=>
["trace":"Exception":private]=>
array(1) {
[0]=>
array(6) {

View File

@ -38,11 +38,14 @@ var_dump($ar);
===DONE===
<?php exit(0); ?>
--EXPECTF--
object(ArrayObject)#1 (2) {
[0]=>
int(0)
[1]=>
int(1)
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(2) {
[0]=>
int(0)
[1]=>
int(1)
}
}
int(2)
int(3)
@ -61,17 +64,20 @@ array(6) {
int(5)
}
string(1) "a"
object(ArrayObject)#1 (5) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
["a"]=>
string(1) "a"
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(5) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
["a"]=>
string(1) "a"
}
}
int(0)
@ -84,20 +90,26 @@ NULL
Notice: Undefined offset: 7 in %sarray_001.php on line %d
Notice: Undefined index: c in %sarray_001.php on line %d
object(ArrayObject)#1 (2) {
[0]=>
int(0)
[2]=>
int(2)
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(2) {
[0]=>
int(0)
[2]=>
int(2)
}
}
object(ArrayObject)#1 (4) {
[0]=>
int(0)
[2]=>
int(2)
[4]=>
string(1) "3"
[5]=>
int(4)
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(4) {
[0]=>
int(0)
[2]=>
int(2)
[4]=>
string(1) "3"
[5]=>
int(4)
}
}
===DONE===

View File

@ -22,16 +22,22 @@ var_dump($arrayObject);
===DONE===
<?php exit(0); ?>
--EXPECTF--
object(ArrayObject)#%d (5) {
[1]=>
string(3) "one"
[2]=>
string(3) "two"
[3]=>
string(5) "three"
[4]=>
string(4) "four"
[5]=>
string(4) "five"
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
object(ArrayObject)#1 (1) {
["storage":"ArrayObject":private]=>
array(5) {
[1]=>
string(3) "one"
[2]=>
string(3) "two"
[3]=>
string(5) "three"
[4]=>
string(4) "four"
[5]=>
string(4) "five"
}
}
}
===DONE===

View File

@ -43,17 +43,21 @@ test Object
(
[pub] => public
[pro:protected] => protected
[pri:private] => private
[pri:test:private] => private
[imp] => implicit
[dyn] => dynamic
)
ArrayObject Object
(
[pub] => public
[pro:protected] => protected
[pri:private] => private
[imp] => implicit
[dyn] => dynamic
[storage:ArrayObject:private] => test Object
(
[pub] => public
[pro:protected] => protected
[pri:test:private] => private
[imp] => implicit
[dyn] => dynamic
)
)
pub => public
imp => implicit

View File

@ -3,7 +3,7 @@ SPL: ArrayIterator
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip"; ?>
--INI--
allow_call_time_pass_reference=1
error_reporting=2047
--FILE--
<?php

View File

@ -3,7 +3,7 @@ SPL: ArrayIterator without ArrayObject
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip"; ?>
--INI--
allow_call_time_pass_reference=1
error_reporting=2047
--FILE--
<?php

View File

@ -47,17 +47,25 @@ test Object
(
[pub] => public
[pro:protected] => protected
[pri:private] => private
[pri:test:private] => private
[imp] => implicit
[dyn] => dynamic
)
ArrayIterator Object
(
[pub] => public
[pro:protected] => protected
[pri:private] => private
[imp] => implicit
[dyn] => dynamic
[storage:ArrayIterator:private] => ArrayObject Object
(
[storage:ArrayObject:private] => test Object
(
[pub] => public
[pro:protected] => protected
[pri:test:private] => private
[imp] => implicit
[dyn] => dynamic
)
)
)
pub => public
imp => implicit

View File

@ -3,7 +3,7 @@ SPL: ArrayIterator and foreach reference
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip"; ?>
--INI--
allow_call_time_pass_reference=1
error_reporting=2047
--FILE--
<?php

View File

@ -43,38 +43,47 @@ var_dump($ar);
===DONE===
<?php exit(0); ?>
--EXPECTF--
object(ArrayObject)#%d (5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
object(ArrayObject)#%d (1) {
%s"storage"%s"ArrayObject":private]=>
array(5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
}
}
Notice: ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d
int(2)
object(ArrayObject)#%d (4) {
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
object(ArrayObject)#%d (1) {
%s"storage"%s"ArrayObject":private]=>
array(4) {
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
}
}
1=>2
3=>4
object(ArrayObject)#%d (2) {
[1]=>
int(2)
[3]=>
int(4)
object(ArrayObject)#%d (1) {
%s"storage"%s"ArrayObject":private]=>
array(2) {
[1]=>
int(2)
[3]=>
int(4)
}
}
1=>2
@ -82,6 +91,9 @@ Notice: main(): ArrayIterator::next(): Array was modified outside object and int
3=>4
Notice: main(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in %sarray_015.php on line %d
object(ArrayObject)#%d (0) {
object(ArrayObject)#%d (1) {
%s"storage"%s"ArrayObject":private]=>
array(0) {
}
}
===DONE===

View File

@ -148,13 +148,26 @@ array(3) {
int(42)
}
["$this"]=>
object(ArrayObjectEx)#1 (3) {
[0]=>
int(1)
["a"]=>
int(25)
object(ArrayObjectEx)#%d (6) {
["pub1"]=>
int(42)
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
}
}
}
ArrayObjectEx::show()
@ -172,13 +185,39 @@ array(3) {
int(42)
}
["$this"]=>
object(ArrayIteratorEx)#2 (3) {
[0]=>
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
["pro2":protected]=>
int(2)
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp2"]=>
int(4)
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (6) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
}
}
}
}
array(1) {
@ -208,13 +247,39 @@ array(3) {
int(42)
}
["$this"]=>
object(ArrayIteratorEx)#3 (3) {
[0]=>
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
["pro2":protected]=>
int(2)
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp2"]=>
int(4)
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (6) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
}
}
}
}
array(1) {
@ -260,17 +325,26 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayObjectEx)#1 (5) {
object(ArrayObjectEx)#%d (6) {
["pub1"]=>
int(1)
["pro1:protected"]=>
["pro1":protected]=>
int(2)
["pri1:private"]=>
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
}
}
}
ArrayObjectEx::show()
@ -294,17 +368,39 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayIteratorEx)#3 (5) {
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["pro2:protected"]=>
["pro2":protected]=>
int(2)
["pri2:private"]=>
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp2"]=>
int(4)
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (6) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
}
}
}
}
array(1) {
@ -340,17 +436,39 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayIteratorEx)#2 (5) {
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["pro2:protected"]=>
["pro2":protected]=>
int(2)
["pri2:private"]=>
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp2"]=>
int(4)
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (6) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
["a"]=>
int(25)
["pub1"]=>
int(42)
}
}
}
}
array(1) {
@ -398,12 +516,12 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayObjectEx)#1 (5) {
object(ArrayObjectEx)#%d (5) {
["pub1"]=>
int(1)
["pro1:protected"]=>
["pro1":protected]=>
int(2)
["pri1:private"]=>
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
@ -430,17 +548,30 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayIteratorEx)#2 (5) {
["pub1"]=>
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["pro1:protected"]=>
["pro2":protected]=>
int(2)
["pri1:private"]=>
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp1"]=>
["imp2"]=>
int(4)
["dyn1"]=>
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (5) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
}
}
}
array(1) {
@ -474,17 +605,30 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayIteratorEx)#3 (5) {
["pub1"]=>
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["pro1:protected"]=>
["pro2":protected]=>
int(2)
["pri1:private"]=>
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp1"]=>
["imp2"]=>
int(4)
["dyn1"]=>
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (5) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
}
}
}
array(1) {
@ -530,12 +674,12 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayObjectEx)#1 (5) {
object(ArrayObjectEx)#%d (5) {
["pub1"]=>
int(1)
["pro1:protected"]=>
["pro1":protected]=>
int(2)
["pri1:private"]=>
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
@ -564,17 +708,30 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayIteratorEx)#3 (5) {
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["pro2:protected"]=>
["pro2":protected]=>
int(2)
["pri2:private"]=>
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp2"]=>
int(4)
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (5) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
}
}
}
array(1) {
@ -610,17 +767,30 @@ array(3) {
int(5)
}
["$this"]=>
object(ArrayIteratorEx)#2 (5) {
object(ArrayIteratorEx)#%d (6) {
["pub2"]=>
int(1)
["pro2:protected"]=>
["pro2":protected]=>
int(2)
["pri2:private"]=>
["pri2":"ArrayIteratorEx":private]=>
int(3)
["imp2"]=>
int(4)
["dyn2"]=>
int(5)
["storage":"ArrayIterator":private]=>
object(ArrayObjectEx)#%d (5) {
["pub1"]=>
int(1)
["pro1":protected]=>
int(2)
["pri1":"ArrayObjectEx":private]=>
int(3)
["imp1"]=>
int(4)
["dyn1"]=>
int(5)
}
}
}
array(1) {

View File

@ -34,9 +34,15 @@ var_dump($foo);
===DONE===
--EXPECTF--
string(44) "An offset must not begin with \0 or be empty"
object(ArrayObject)#%d (0) {
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(0) {
}
}
string(44) "An offset must not begin with \0 or be empty"
object(ArrayObject)#%d (0) {
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(0) {
}
}
===DONE===

View File

@ -52,21 +52,31 @@ object(MyArrayObject)#%d (1) {
["bar"]=>
string(3) "baz"
}
object(MyArrayObject)#%d (2) {
object(MyArrayObject)#%d (3) {
["bar"]=>
string(3) "baz"
["baz"]=>
string(3) "Foo"
["storage":"ArrayObject":private]=>
array(1) {
["bar"]=>
string(3) "baz"
}
}
==ArrayIterator===
object(MyArrayIterator)#%d (1) {
["bar"]=>
string(3) "baz"
}
object(MyArrayIterator)#%d (2) {
object(MyArrayIterator)#%d (3) {
["bar"]=>
string(3) "baz"
["baz"]=>
string(3) "Foo"
["storage":"ArrayIterator":private]=>
object(MyArrayIterator)#%d (1) {
["bar"]=>
string(3) "baz"
}
}
===DONE===

View File

@ -52,7 +52,7 @@ FooBar::offsetSet(2, 2)
CAUGHT: FAIL
FooBar Object
(
[array:private] => Array
[array:FooBar:private] => Array
(
[0] => 0
[1] => 1

View File

@ -66,9 +66,17 @@ Collection::offsetGet(foo)
string(3) "baz"
Collection Object
(
[0] => foo
[1] => bar
[foo] => baz
[data:Collection:private] => Array
(
)
[storage:ArrayObject:private] => Array
(
[0] => foo
[1] => bar
[foo] => baz
)
)
int(3)
===DONE===

View File

@ -13,9 +13,9 @@ foreach ($diriter as $key => $file) {
break;
}
echo "Done\n";
?>
===DONE===
--EXPECTF--
string(%d) "%s"
string(%d) "%s"
Done
===DONE===

View File

@ -11,15 +11,9 @@ $idx = 0;
foreach($it as $file)
{
echo "First\n";
if("." != $file && ".." != $file)
{
var_Dump($file->getFilename());
}
var_Dump($file->getFilename());
echo "Second\n";
if($file != "." && $file != "..")
{
var_dump($file->getFilename());
}
var_dump($file->getFilename());
if (++$idx > 1)
{
break;

View File

@ -1,5 +1,7 @@
--TEST--
Bug #40872 (inconsistency in offsetSet, offsetExists treatment of string enclosed integers)
--SKIPIF--
<?php if (!extension_loaded("spl")) die("skip"); ?>
--FILE--
<?php
class Project {

View File

@ -1,5 +1,7 @@
--TEST--
Bug #41692 (ArrayObject shows weird behaviour in respect to inheritance)
--SKIPIF--
<?php if (!extension_loaded("spl")) die("skip"); ?>
--FILE--
<?php
@ -21,20 +23,44 @@ var_dump($bar);
echo "Done\n";
?>
--EXPECTF--
object(Bar)#%d (3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
object(Bar)#%d (2) {
["foo":"Bar":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
}
object(Bar)#%d (3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
object(Bar)#%d (2) {
["foo":"Bar":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
}
Done

View File

@ -6,13 +6,21 @@ Bug #42364 (Crash when using getRealPath with DirectoryIterator)
<?php
$it = new DirectoryIterator(dirname(__FILE__));
$count = 0;
foreach ($it as $e) {
if (gettype($e->getRealPath()) != "string") {
$count++;
$type = gettype($e->getRealPath());
if ($type != "string" && $type != "unicode") {
echo $e->getFilename(), " is a ", gettype($e->getRealPath()), "\n";
}
}
if ($count > 0) {
echo "Found $count entries!\n";
}
echo "===DONE==="
?>
--EXPECT--
--EXPECTF--
Found %i entries!
===DONE===

View File

@ -23,98 +23,122 @@ var_dump($copy);
?>
--EXPECTF--
update 1
object(RecursiveArrayIterator)#%d (3) {
[1]=>
string(4) "val1"
[2]=>
array(2) {
object(RecursiveArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(3) {
[1]=>
string(4) "val1"
[2]=>
string(4) "val2"
[3]=>
array(1) {
array(2) {
[2]=>
string(4) "val2"
[3]=>
string(4) "val3"
array(1) {
[3]=>
string(4) "val3"
}
}
[4]=>
string(4) "val4"
}
[4]=>
string(4) "val4"
}
object(RecursiveArrayIterator)#%d (3) {
[1]=>
string(5) "alter"
[2]=>
array(2) {
object(RecursiveArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(3) {
[1]=>
string(5) "alter"
[2]=>
string(4) "val2"
[3]=>
array(1) {
array(2) {
[2]=>
string(4) "val2"
[3]=>
string(4) "val3"
array(1) {
[3]=>
string(4) "val3"
}
}
[4]=>
string(4) "val4"
}
[4]=>
string(4) "val4"
}
update 2
object(RecursiveArrayIterator)#%d (2) {
[2]=>
string(4) "val2"
[3]=>
array(1) {
object(RecursiveArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(2) {
[2]=>
string(4) "val2"
[3]=>
string(4) "val3"
array(1) {
[3]=>
string(4) "val3"
}
}
}
object(RecursiveArrayIterator)#%d (2) {
[2]=>
string(5) "alter"
[3]=>
array(1) {
object(RecursiveArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(2) {
[2]=>
string(5) "alter"
[3]=>
string(4) "val3"
array(1) {
[3]=>
string(4) "val3"
}
}
}
update 3
object(RecursiveArrayIterator)#%d (1) {
[3]=>
string(4) "val3"
["storage":"ArrayIterator":private]=>
array(1) {
[3]=>
string(4) "val3"
}
}
object(RecursiveArrayIterator)#%d (1) {
[3]=>
string(5) "alter"
["storage":"ArrayIterator":private]=>
array(1) {
[3]=>
string(5) "alter"
}
}
update 4
object(RecursiveArrayIterator)#%d (3) {
[1]=>
string(5) "alter"
[2]=>
array(2) {
object(RecursiveArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(3) {
[1]=>
string(5) "alter"
[2]=>
string(4) "val2"
[3]=>
array(1) {
array(2) {
[2]=>
string(4) "val2"
[3]=>
string(4) "val3"
array(1) {
[3]=>
string(4) "val3"
}
}
[4]=>
string(4) "val4"
}
[4]=>
string(4) "val4"
}
object(RecursiveArrayIterator)#%d (3) {
[1]=>
string(5) "alter"
[2]=>
array(2) {
object(RecursiveArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(3) {
[1]=>
string(5) "alter"
[2]=>
string(4) "val2"
[3]=>
array(1) {
array(2) {
[2]=>
string(4) "val2"
[3]=>
string(4) "val3"
array(1) {
[3]=>
string(4) "val3"
}
}
[4]=>
string(5) "alter"
}
[4]=>
string(5) "alter"
}
array(3) {
[1]=>

View File

@ -12,7 +12,9 @@ var_dump(is_string($d));
?>
===DONE===
--EXPECTF--
object(DirectoryIterator)#%d (0) {
object(DirectoryIterator)#%d (1) {
%s"pathName"%s"SplFileInfo":private]=>
%s(1) "."
}
bool(false)
bool(false)

View File

@ -45,14 +45,22 @@ test(dirname(__FILE__), substr(dirname(__FILE__),-1), 'l');
<?php exit(0); ?>
--EXPECTF--
===0===
object(SplFileInfo)#%d (0) {
object(SplFileInfo)#%d (2) {
["pathName":"SplFileInfo":private]=>
string(%d) "%s"
["fileName":"SplFileInfo":private]=>
string(%d) "%sfileobject_001a.txt"
}
object(SplFileInfo)#%d (0) {
object(SplFileInfo)#%d (2) {
["pathName":"SplFileInfo":private]=>
string(%d) "%s"
["fileName":"SplFileInfo":private]=>
string(%d) "%sfileobject_001a.txt"
}
bool(false)
bool(true)
bool(true)
string(%d) "%sfileobject_001a.txt"
%s(%d) "%sfileobject_001a.txt"
string(%d) "%sfileobject_001a.txt"
bool(true)
string(19) "fileobject_001a.txt"
@ -63,14 +71,22 @@ string(%d) "%sfileobject_001a.txt"
string(19) "fileobject_001a.txt"
string(%d) "%stests"
===1===
object(SplFileInfo)#%d (0) {
object(SplFileInfo)#%d (2) {
["pathName":"SplFileInfo":private]=>
string(%d) "%s"
["fileName":"SplFileInfo":private]=>
string(%d) "%s"
}
object(SplFileInfo)#%d (0) {
object(SplFileInfo)#%d (2) {
["pathName":"SplFileInfo":private]=>
string(%d) "%s"
["fileName":"SplFileInfo":private]=>
string(%d) "%s"
}
bool(false)
bool(true)
bool(true)
string(%d) "%stests/"
%s(%d) "%stests/"
string(%d) "%stests"
bool(true)
string(5) "tests"
@ -81,14 +97,22 @@ string(%d) "%stests"
string(%d) "%stests"
string(%d) "%stests"
===2===
object(SplFileInfo)#1 (0) {
object(SplFileInfo)#%d (2) {
["pathName":"SplFileInfo":private]=>
string(%d) "%s"
["fileName":"SplFileInfo":private]=>
string(%d) "%s"
}
object(SplFileInfo)#2 (0) {
object(SplFileInfo)#%d (2) {
["pathName":"SplFileInfo":private]=>
string(%d) "%s"
["fileName":"SplFileInfo":private]=>
string(%d) "%s"
}
bool(false)
bool(true)
bool(true)
string(%d) "%stests"
%s(%d) "%stests"
string(%d) "%stests"
bool(true)
string(%d) "tests"

View File

@ -5,7 +5,7 @@ SPL: IteratorIterator and SimpleXMlElement
--FILE--
<?php
$root = simplexml_load_string('<?xml version="1.0"?>
$root = simplexml_load_string(b'<?xml version="1.0"?>
<root>
<child>Hello</child>
<child>World</child>

View File

@ -20,7 +20,7 @@ foreach($it as $k=>$v)
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
--EXPECTF--
0=>1
hasNext: yes
1=>2

View File

@ -40,41 +40,62 @@ foreach($it as $k => $v)
<?php exit(0); ?>
--EXPECTF--
Error Argument 1 passed to AppendIterator::append() must implement interface Iterator, array given in %siterator_042.php on line %d
object(ArrayIterator)#%d (2) {
[0]=>
object(ArrayIterator)#%d (1) {
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(2) {
[0]=>
int(1)
}
[1]=>
object(ArrayIterator)#%d (2) {
[0]=>
int(21)
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(1) {
[0]=>
int(1)
}
}
[1]=>
int(22)
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(2) {
[0]=>
int(21)
[1]=>
int(22)
}
}
}
}
object(ArrayIterator)#%d (3) {
[0]=>
object(ArrayIterator)#%d (1) {
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(3) {
[0]=>
int(1)
}
[1]=>
object(ArrayIterator)#%d (2) {
[0]=>
int(21)
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(1) {
[0]=>
int(1)
}
}
[1]=>
int(22)
}
[2]=>
object(ArrayIterator)#5 (3) {
[0]=>
int(31)
[1]=>
int(32)
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(2) {
[0]=>
int(21)
[1]=>
int(22)
}
}
[2]=>
int(33)
object(ArrayIterator)#5 (1) {
%s"storage"%s"ArrayIterator":private]=>
array(3) {
[0]=>
int(31)
[1]=>
int(32)
[2]=>
int(33)
}
}
}
}
===0===

View File

@ -88,14 +88,14 @@ int(4)
int(4)
===1===
MyRecursiveArrayIterator::hasChildren()
Exception: State 1: MyRecursiveArrayIterator::hasChildren() in %siterator_047.php on line %d
Exception: State 1: MyRecursiveArrayIterator::hasChildren() in %s on line %d
===2===
MyRecursiveArrayIterator::hasChildren()
int(0)
int(0)
MyRecursiveArrayIterator::hasChildren()
MyRecursiveArrayIterator::getChildren()
Exception: State 2: MyRecursiveArrayIterator::getChildren() in %siterator_047.php on line %d
Exception: State 2: MyRecursiveArrayIterator::getChildren() in %s on line %d
===3===
MyRecursiveArrayIterator::hasChildren()
int(0)

View File

@ -14,8 +14,11 @@ var_dump($ar->getArrayCopy());
<?php exit(0); ?>
--EXPECTF--
object(ArrayIterator)#%d (1) {
[""]=>
NULL
["storage":"ArrayIterator":private]=>
array(1) {
[""]=>
NULL
}
}
array(1) {
[""]=>

Binary file not shown.

View File

@ -33,61 +33,64 @@ var_dump($ar);
int(1)
array(3) {
[0]=>
string(3) "1,2"
%s(3) "1,2"
[1]=>
string(1) "1"
%s(1) "1"
[2]=>
string(1) "2"
%s(1) "2"
}
int(2)
array(3) {
[0]=>
string(3) "1,2"
%s(3) "1,2"
[1]=>
string(1) "1"
%s(1) "1"
[2]=>
string(1) "2"
%s(1) "2"
}
int(0)
array(2) {
[0]=>
string(1) "1"
%s(1) "1"
[1]=>
string(1) "1"
%s(1) "1"
}
int(1)
array(2) {
[0]=>
string(1) "1"
%s(1) "1"
[1]=>
string(1) "1"
%s(1) "1"
}
int(2)
array(2) {
[0]=>
string(1) "1"
[1]=>
string(1) "1"
}
object(ArrayIterator)#%d (9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
%s(1) "1"
}
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
===DONE===

View File

@ -76,20 +76,23 @@ array(2) {
[1]=>
string(1) "0"
}
object(ArrayIterator)#%d (7) {
[1]=>
int(0)
["1,2"]=>
int(1)
["1,2,3"]=>
int(2)
[0]=>
int(3)
["FooBar"]=>
int(4)
[","]=>
int(5)
[",,"]=>
int(6)
object(ArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(7) {
[1]=>
int(0)
["1,2"]=>
int(1)
["1,2,3"]=>
int(2)
[0]=>
int(3)
["FooBar"]=>
int(4)
[","]=>
int(5)
[",,"]=>
int(6)
}
}
===DONE===

View File

@ -290,25 +290,28 @@ array(2) {
array(0) {
}
}
object(ArrayIterator)#%d (9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
object(ArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
===DONE===

View File

@ -290,25 +290,28 @@ array(2) {
string(1) "8"
}
}
object(ArrayIterator)#%d (9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
object(ArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
===DONE===

View File

@ -60,25 +60,28 @@ array(3) {
[2]=>
string(0) ""
}
object(ArrayIterator)#%d (9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
object(ArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(9) {
[0]=>
%s(1) "1"
[1]=>
%s(3) "1,2"
[2]=>
%s(5) "1,2,3"
[3]=>
%s(0) ""
[4]=>
NULL
[5]=>
array(0) {
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
[6]=>
%s(6) "FooBar"
[7]=>
%s(1) ","
[8]=>
%s(2) ",,"
}
===DONE===

View File

@ -42,20 +42,23 @@ array(2) {
[1]=>
string(2) ",3"
}
object(ArrayIterator)#%d (7) {
[1]=>
int(0)
["1,2"]=>
int(1)
["1,2,3"]=>
int(2)
[0]=>
int(3)
["FooBar"]=>
int(4)
[","]=>
int(5)
[",,"]=>
int(6)
object(ArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(7) {
[1]=>
int(0)
["1,2"]=>
int(1)
["1,2,3"]=>
int(2)
[0]=>
int(3)
["FooBar"]=>
int(4)
[","]=>
int(5)
[",,"]=>
int(6)
}
}
===DONE===

View File

@ -62,17 +62,43 @@ var_dump($storage2);
int(2)
int(1)
int(2)
object(MyStorage)#%d (1) {
object(MyStorage)#%d (2) {
["bla"]=>
int(26)
["storage":"SplObjectStorage":private]=>
array(2) {
["%s"]=>
object(TestClass)#%d (1) {
["test"]=>
int(1)
}
["%s"]=>
object(TestClass)#%d (1) {
["test"]=>
int(2)
}
}
}
string(%d) "%s"
===UNSERIALIZE===
int(2)
int(1)
int(2)
object(MyStorage)#%d (1) {
object(MyStorage)#%d (2) {
["bla"]=>
int(26)
["storage":"SplObjectStorage":private]=>
array(2) {
["%s"]=>
object(TestClass)#%d (1) {
["test"]=>
int(1)
}
["%s"]=>
object(TestClass)#%d (1) {
["test"]=>
int(2)
}
}
}
===DONE===

View File

@ -83,9 +83,9 @@ object(TestClass)#%d (4) {
int(24)
["pub"]=>
int(4)
["pro:protected"]=>
["pro":protected]=>
int(5)
["pri:private"]=>
["pri":"TestClass":private]=>
int(6)
}
object(TestClass)#%d (4) {
@ -93,20 +93,45 @@ object(TestClass)#%d (4) {
int(24)
["pub"]=>
int(7)
["pro:protected"]=>
["pro":protected]=>
int(8)
["pri:private"]=>
["pri":"TestClass":private]=>
int(9)
}
object(MyStorage)#%d (4) {
object(MyStorage)#%d (5) {
["def"]=>
int(24)
["pub"]=>
int(1)
["pro:protected"]=>
["pro":protected]=>
int(2)
["pri:private"]=>
["pri":"MyStorage":private]=>
int(3)
["storage":"SplObjectStorage":private]=>
array(2) {
["%s"]=>
object(TestClass)#%d (4) {
["def"]=>
int(24)
["pub"]=>
int(4)
["pro":protected]=>
int(5)
["pri":"TestClass":private]=>
int(6)
}
["%s"]=>
object(TestClass)#%d (4) {
["def"]=>
int(24)
["pub"]=>
int(7)
["pro":protected]=>
int(8)
["pri":"TestClass":private]=>
int(9)
}
}
}
string(%d) "%s"
===UNSERIALIZE===
@ -116,9 +141,9 @@ object(TestClass)#%d (4) {
int(24)
["pub"]=>
int(4)
["pro:protected"]=>
["pro":protected]=>
int(5)
["pri:private"]=>
["pri":"TestClass":private]=>
int(6)
}
object(TestClass)#%d (4) {
@ -126,19 +151,44 @@ object(TestClass)#%d (4) {
int(24)
["pub"]=>
int(7)
["pro:protected"]=>
["pro":protected]=>
int(8)
["pri:private"]=>
["pri":"TestClass":private]=>
int(9)
}
object(MyStorage)#%d (4) {
object(MyStorage)#%d (5) {
["def"]=>
int(24)
["pub"]=>
int(1)
["pro:protected"]=>
["pro":protected]=>
int(2)
["pri:private"]=>
["pri":"MyStorage":private]=>
int(3)
["storage":"SplObjectStorage":private]=>
array(2) {
["%s"]=>
object(TestClass)#%d (4) {
["def"]=>
int(24)
["pub"]=>
int(4)
["pro":protected]=>
int(5)
["pri":"TestClass":private]=>
int(6)
}
["%s"]=>
object(TestClass)#%d (4) {
["def"]=>
int(24)
["pub"]=>
int(7)
["pro":protected]=>
int(8)
["pri":"TestClass":private]=>
int(9)
}
}
}
===DONE===

View File

@ -73,4 +73,4 @@ array(0) {
}
bool(false)
bool(false)
===DONE===
===DONE===

View File

@ -79,7 +79,7 @@ int(4)
Error: Argument 3 passed to iterator_apply() must be an array, integer given
Error: iterator_apply() expects parameter 3 to be array, integer given
NULL
Error: iterator_apply() expects parameter 2 to be function,%sstring given
Error: iterator_apply() expects parameter 2 to be valid callback,%sstring given
NULL
Error: iterator_apply() expects at most 3 parameters, 4 given
NULL

View File

@ -1,8 +1,8 @@
--TEST--
SPL: spl_autoloadfunctions()
SPL: spl_autoload_functions()
--SKIPIF--
<?php
if (!extension_loaded("spl")) die ("skip");
if (!extension_loaded("spl")) die("skip");
if (spl_autoload_functions() !== false) die('skip __autoload() registered by php.ini');
?>
--FILE--

View File

@ -26,7 +26,7 @@ $xml =<<<EOF
</sxe>
EOF;
var_dump(simplexml_load_string($xml, 'SimpleXMLIterator'));
var_dump(simplexml_load_string((binary)$xml, 'SimpleXMLIterator'));
?>
===DONE===

View File

@ -37,7 +37,7 @@ $xml =<<<EOF
</sxe>
EOF;
$sxe = simplexml_load_string($xml, 'SimpleXMLIterator');
$sxe = simplexml_load_string((binary)$xml, 'SimpleXMLIterator');
foreach(new RecursiveIteratorIterator($sxe, 1) as $name => $data) {
var_dump($name);

View File

@ -37,7 +37,7 @@ $xml =<<<EOF
</sxe>
EOF;
$sxe = simplexml_load_string($xml, 'SimpleXMLIterator');
$sxe = simplexml_load_string((binary)$xml, 'SimpleXMLIterator');
foreach($sxe->getChildren() as $name => $data) {
var_dump($name);

View File

@ -76,7 +76,7 @@ class SXETest extends SimpleXMLIterator
}
}
$sxe = new SXETest($xml);
$sxe = new SXETest((binary)$xml);
$rit = new RecursiveIteratorIterator($sxe, RecursiveIteratorIterator::SELF_FIRST);
foreach($rit as $data) {

View File

@ -28,7 +28,7 @@ class SXETest extends SimpleXMLIterator
}
}
$sxe = new SXETest($xml);
$sxe = new SXETest((binary)$xml);
var_dump(count($sxe));
var_dump(count($sxe->elem1));

View File

@ -29,7 +29,7 @@ foreach (array ('arsort', 'asort', 'krsort', 'ksort', 'rsort', 'sort') as $test_
}
?>
--EXPECT--
--EXPECTF--
Unsorted data:
array(8) {
[0]=>

View File

@ -56,4 +56,4 @@ array(5) {
string(6) "test10"
[6]=>
string(6) "test21"
}
}

View File

@ -84,16 +84,16 @@ echo"Done";
--EXPECTF--
*** Testing Error Conditions ***
Warning: Wrong parameter count for array_shift() in %s line %d
Warning: array_shift() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: array_shift(): The argument should be an array in %s on line %d
Warning: array_shift() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: array_shift(): The argument should be an array in %s on line %d
Warning: array_shift() expects parameter 1 to be array, string given in %s on line %d
NULL
Warning: Wrong parameter count for array_shift() in %s on line %d
Warning: array_shift() expects exactly 1 parameter, 2 given in %s on line %d
NULL
NULL

View File

@ -61,10 +61,6 @@ class cr {
if ($a->priv_member === $b->priv_member) return 0;
return ($a->priv_member > $b->priv_member)? 1:-1;
}
function __toString() {
return "Object";
}
}
function comp_func($a, $b) {
@ -112,12 +108,6 @@ echo 'var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_fun
var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_diff_assoc($a, $b));'."\n";
var_dump(@array_diff_assoc($a, $b));
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_udiff($a, $b, "comp_func_cr"));'."\n";
@ -314,21 +304,21 @@ var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(3) {
["0.1"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(23)
["public_member"]=>
int(23)
@ -392,21 +382,21 @@ var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func"));
array(3) {
["0.1"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(23)
["public_member"]=>
int(23)
@ -466,82 +456,18 @@ $b=array (
'public_member' => -15,
)),
);
var_dump(array_diff_assoc($a, $b));
array(1) {
["0.1"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
}
$a=array (
'0.1' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 12,
'public_member' => 12,
)),
0 =>
cr::__set_state(array(
'priv_member' => 23,
'public_member' => 23,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
$b=array (
'0.2' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 22,
'public_member' => 22,
)),
0 =>
cr::__set_state(array(
'priv_member' => 3,
'public_member' => 3,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
var_dump(array_udiff($a, $b, "comp_func_cr"));
array(2) {
["0.5"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(23)
["public_member"]=>
int(23)
@ -605,21 +531,21 @@ var_dump(array_udiff_assoc($a, $b, "comp_func_cr"));
array(3) {
["0.1"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(23)
["public_member"]=>
int(23)

View File

@ -114,89 +114,6 @@ var_dump( reset($int_var) );
var_dump( reset($float_var) );
var_dump( reset($string) );
echo "\n*** Testing operation on Objects ***\n";
// class having members of different scope
class test_class
{
private $private_var = "private_var";
public $public_var = "public_var";
protected $protected_var = "protected_var";
private $var1 = 10;
public $var2 = 30;
protected $var3 = 40;
var $integer = 3092;
private function private_fun() {
echo "private_fun() called\n";
}
protected function protected_fun() {
echo "protected_fun() called\n";
}
public function public_fun() {
echo "public_fun() called\n";
}
}
// class with no member variables
class zero_member_var_class
{
public function fun() {
echo "fun() called\n";
}
}
// class with no members
class zero_member_class
{
// no members
}
//create object of all classes defined above
$test_class_obj = new test_class();
$zero_member_var_class_obj = new zero_member_var_class();
$zero_member_class_obj = new zero_member_class();
$object_array = array (
$test_class_obj,
$zero_member_var_class_obj,
$zero_member_class_obj
);
/* loop to use function key(), current(), next() and reset()
on different class objects */
$loop_count = 1;
foreach( $object_array as $object ) {
echo "--- Outerloop Iteration $loop_count ---\n";
/* dump the object before performing operation on it */
echo "Object before performing operations ...\n";
var_dump($object) ;
/* loop to feach all the key/value pair from the object*/
$inner_loop_count = 1;
do {
echo "-- Innerloop iteration $inner_loop_count of Outerloop Iteration $loop_count --\n";
$inner_loop_count ++;
// print the key/value pair of the current value
echo "current => "; var_dump( current($object) ); // key & value pair
echo "key => "; var_dump( key($object) ); // key
$next_pair = next($object);
echo "next => "; var_dump($next_pair);
} while( FALSE != $next_pair );
$loop_count++;
/* reset the object */
echo "reset => "; var_dump( reset($object) );
echo "current => "; var_dump( current($object) ); // first variable in object
echo "\nObject after performing operations ...\n";
var_dump($object) ; // no change expected
}
echo "Done\n";
?>
--EXPECTF--
@ -542,173 +459,77 @@ array(5) {
-- Testing variation: when array is unset --
Warning: current(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: current() expects parameter 1 to be array, null given in %s on line %d
NULL
Warning: key(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: key() expects parameter 1 to be array, null given in %s on line %d
NULL
Warning: next(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: next() expects parameter 1 to be array, null given in %s on line %d
NULL
Warning: reset(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: reset() expects parameter 1 to be array, null given in %s on line %d
NULL
*** Testing error conditions ***
Warning: Wrong parameter count for key() in %s on line %d
Warning: key() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: Wrong parameter count for current() in %s on line %d
Warning: current() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: Wrong parameter count for reset() in %s on line %d
Warning: reset() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: Wrong parameter count for next() in %s on line %d
Warning: next() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: Wrong parameter count for key() in %s on line %d
Warning: key() expects exactly 1 parameter, 2 given in %s on line %d
NULL
Warning: Wrong parameter count for current() in %s on line %d
Warning: current() expects exactly 1 parameter, 2 given in %s on line %d
NULL
Warning: Wrong parameter count for reset() in %s on line %d
Warning: reset() expects exactly 1 parameter, 2 given in %s on line %d
NULL
Warning: Wrong parameter count for next() in %s on line %d
Warning: next() expects exactly 1 parameter, 2 given in %s on line %d
NULL
Warning: key(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: key() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: key(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: key() expects parameter 1 to be array, double given in %s on line %d
NULL
Warning: key(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: key() expects parameter 1 to be array, string given in %s on line %d
NULL
Warning: current(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: current() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: current(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: current() expects parameter 1 to be array, double given in %s on line %d
NULL
Warning: current(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: current() expects parameter 1 to be array, string given in %s on line %d
NULL
Warning: next(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: next() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: next(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: next() expects parameter 1 to be array, double given in %s on line %d
NULL
Warning: next(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: next() expects parameter 1 to be array, string given in %s on line %d
NULL
Warning: reset(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: reset() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: reset(): Passed variable is not an array or object in %s on line %d
bool(false)
Warning: reset() expects parameter 1 to be array, double given in %s on line %d
NULL
Warning: reset(): Passed variable is not an array or object in %s on line %d
bool(false)
*** Testing operation on Objects ***
--- Outerloop Iteration 1 ---
Object before performing operations ...
object(test_class)#1 (7) {
["private_var:private"]=>
string(11) "private_var"
["public_var"]=>
string(10) "public_var"
["protected_var:protected"]=>
string(13) "protected_var"
["var1:private"]=>
int(10)
["var2"]=>
int(30)
["var3:protected"]=>
int(40)
["integer"]=>
int(3092)
}
-- Innerloop iteration 1 of Outerloop Iteration 1 --
current => string(11) "private_var"
key => string(23) "test_classprivate_var"
next => string(10) "public_var"
-- Innerloop iteration 2 of Outerloop Iteration 1 --
current => string(10) "public_var"
key => string(10) "public_var"
next => string(13) "protected_var"
-- Innerloop iteration 3 of Outerloop Iteration 1 --
current => string(13) "protected_var"
key => string(16) "*protected_var"
next => int(10)
-- Innerloop iteration 4 of Outerloop Iteration 1 --
current => int(10)
key => string(16) "test_classvar1"
next => int(30)
-- Innerloop iteration 5 of Outerloop Iteration 1 --
current => int(30)
key => string(4) "var2"
next => int(40)
-- Innerloop iteration 6 of Outerloop Iteration 1 --
current => int(40)
key => string(7) "*var3"
next => int(3092)
-- Innerloop iteration 7 of Outerloop Iteration 1 --
current => int(3092)
key => string(7) "integer"
next => bool(false)
reset => string(11) "private_var"
current => string(11) "private_var"
Object after performing operations ...
object(test_class)#1 (7) {
["private_var:private"]=>
string(11) "private_var"
["public_var"]=>
string(10) "public_var"
["protected_var:protected"]=>
string(13) "protected_var"
["var1:private"]=>
int(10)
["var2"]=>
int(30)
["var3:protected"]=>
int(40)
["integer"]=>
int(3092)
}
--- Outerloop Iteration 2 ---
Object before performing operations ...
object(zero_member_var_class)#2 (0) {
}
-- Innerloop iteration 1 of Outerloop Iteration 2 --
current => bool(false)
key => NULL
next => bool(false)
reset => bool(false)
current => bool(false)
Object after performing operations ...
object(zero_member_var_class)#2 (0) {
}
--- Outerloop Iteration 3 ---
Object before performing operations ...
object(zero_member_class)#3 (0) {
}
-- Innerloop iteration 1 of Outerloop Iteration 3 --
current => bool(false)
key => NULL
next => bool(false)
reset => bool(false)
current => bool(false)
Object after performing operations ...
object(zero_member_class)#3 (0) {
}
Warning: reset() expects parameter 1 to be array, string given in %s on line %d
NULL
Done

View File

@ -14,15 +14,15 @@ var_dump( array_change_key_case($item, $item["one"], "CASE_UPPER") ); // more th
echo "end\n";
?>
--EXPECTF--
Warning: array_change_key_case(): The argument should be an array in %s on line %d
bool(false)
Warning: array_change_key_case(): The argument should be an array in %s on line %d
bool(false)
Warning: Wrong parameter count for array_change_key_case() in %s on line %d
Warning: array_change_key_case() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: Wrong parameter count for array_change_key_case() in %s on line %d
Warning: array_change_key_case() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: array_change_key_case() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: array_change_key_case() expects at most 2 parameters, 3 given in %s on line %d
NULL
end

View File

@ -21,16 +21,8 @@ var_dump( array_change_key_case( array("ONE" => 1, "one" => 1, "One" => 2), 5 )
echo "end\n";
?>
--EXPECTF--
array(4) {
["one"]=>
int(1)
["two"]=>
int(2)
["three"]=>
int(3)
["four"]=>
string(4) "four"
}
Warning: array_change_key_case() expects parameter 2 to be long, string given in %s on line %d
NULL
array(4) {
["ONE"]=>
int(1)
@ -45,10 +37,9 @@ array(1) {
["one"]=>
int(4)
}
array(1) {
["one"]=>
int(5)
}
Warning: array_change_key_case() expects parameter 2 to be long, string given in %s on line %d
NULL
array(1) {
["ONE"]=>
int(3)

View File

@ -92,4 +92,3 @@ array(1) {
[1]=>
int(1)
}

View File

@ -2,7 +2,7 @@
Test array_fill() function : basic functionality
--FILE--
<?php
/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
/* Prototype : proto array array_fill(int start_key, int num, mixed val)
* Description: Create an array containing num elements starting with index start_key each initialized to val
* Source code: ext/standard/array.c
*/
@ -10,7 +10,6 @@ Test array_fill() function : basic functionality
echo "*** Testing array_fill() : basic functionality ***\n";
// calling the array_fill with all possible valid values for 'val' argument
$start_key = 0 ;
$num = 2;
$heredoc = <<<HERE_DOC
@ -36,7 +35,7 @@ for($i = 0; $i < count($values); $i ++)
echo "-- Iteration $counter --\n";
$val = $values[$i];
var_dump( array_fill($start_key, $num, $val) );
var_dump( array_fill($start_key,$num,$val) );
$counter++;
}

View File

@ -2,10 +2,10 @@
Test array_fill() function : error conditions
--FILE--
<?php
/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
/* Prototype : proto array array_fill(int start_key, int num, mixed val)
* Description: Create an array containing num elements starting with index start_key each initialized to val
* Source code: ext/standard/array.c
*/
*/
echo "*** Testing array_fill() : error conditions ***\n";
@ -20,21 +20,21 @@ $start_key = 0;
$num = 2;
$val = 1;
$extra_arg = 10;
var_dump( array_fill($start_key, $num,$val, $extra_arg) );
var_dump( array_fill($start_key,$num,$val, $extra_arg) );
// Less than the expected number of arguments
echo "-- Testing array_fill() function with less than expected no. of arguments --\n";
$start_key = 0;
$num = 2;
var_dump( array_fill($start_key, $num) );
var_dump( array_fill($start_key,$num) );
//calling array_fill with negative values for 'num' parameter
$num = -1;
var_dump( array_fill($start_key, $num, $val) );
var_dump( array_fill($start_key,$num,$val) );
//callin array_fill with 'num' equal to zero value
$num = 0;
var_dump( array_fill($start_key, $num, $val) );
var_dump( array_fill($start_key,$num,$val) );
echo "Done";
?>
@ -42,15 +42,15 @@ echo "Done";
*** Testing array_fill() : error conditions ***
-- Testing array_fill() function with Zero arguments --
Warning: Wrong parameter count for array_fill() in %s on line %d
Warning: array_fill() expects exactly 3 parameters, 0 given in %s on line %d
NULL
-- Testing array_fill() function with more than expected no. of arguments --
Warning: Wrong parameter count for array_fill() in %s on line %d
Warning: array_fill() expects exactly 3 parameters, 4 given in %s on line %d
NULL
-- Testing array_fill() function with less than expected no. of arguments --
Warning: Wrong parameter count for array_fill() in %s on line %d
Warning: array_fill() expects exactly 3 parameters, 2 given in %s on line %d
NULL
Warning: array_fill(): Number of elements must be positive in %s on line %d

View File

@ -22,7 +22,7 @@ class Test
{
}
//class with public, static, constant members and consturctor to initialize the public member
//class with public member, static member , constant and consturctor to initialize the public member
class Test1
{
const test1_constant = "test1";
@ -31,7 +31,7 @@ class Test1
var $var1 = 30;
var $var2;
function __construct($value1, $value2)
function __construct($value1 , $value2)
{
$this->member1 = $value1;
$this->var2 = $value2;
@ -43,14 +43,14 @@ class Child_test1 extends Test1
{
public $member2;
function __construct($value1, $value2, $value3)
function __construct($value1 , $value2 , $value3)
{
parent::__construct($value1, $value2);
parent::__construct($value1 , $value2);
$this->member2 = $value3;
}
}
//class with private, static, constant members and constructor to initialize the private member
//class with private member, static member, constant and constructor to initialize the private member
class Test2
{
const test2_constant = "test2";
@ -59,7 +59,7 @@ class Test2
var $var1 = 30;
var $var2;
function __construct($value1,$value2)
function __construct($value1 , $value2)
{
$this->member1 = $value1;
$this->var2 = $value2;
@ -71,14 +71,14 @@ class Child_test2 extends Test2
{
private $member1;
function __construct($value1, $value2, $value3)
function __construct($value1 , $value2 , $value3)
{
parent::__construct($value1, $value2);
parent::__construct($value1 , $value2);
$this->member1 = $value3;
}
}
// class with protected, static, constant members and consturctor to initialize the protected member
// class with protected member, static member, constant and consturctor to initialize the protected member
class Test3
{
const test3_constant = "test3";
@ -87,7 +87,7 @@ class Test3
var $var1 = 30;
var $var2;
function __construct($value1, $value2)
function __construct($value1 , $value2)
{
$this->member1 = $value1;
$this->var2 = $value2;
@ -99,9 +99,9 @@ class Child_test3 extends Test3
{
protected $member1;
function __construct($value1, $value2, $value3)
function __construct($value1 , $value2 , $value3)
{
parent::__construct($value1, $value2);
parent::__construct($value1 , $value2);
$this->member1 = $value3;
}
}
@ -115,7 +115,7 @@ class Test4
private $member2;
protected $member3;
function __construct($value1, $value2, $value3)
function __construct($value1 , $value2 , $value3)
{
$this->member1 = $value1;
$this->member2 = $value2;
@ -128,9 +128,9 @@ class Child_test4 extends Test4
{
var $var1;
function __construct($value1, $value2, $value3, $value4)
function __construct($value1 , $value2 , $value3 , $value4)
{
parent::__construct($value1, $value2, $value3);
parent::__construct($value1 , $value2 , $value3);
$this->var1 = $value4;
}
}
@ -196,7 +196,7 @@ for($index = 0; $index < count($objects); $index ++)
echo "-- Iteration $counter --\n";
$val = $objects[$index];
var_dump( array_fill($start_key, $num, $val) );
var_dump( array_fill($start_key,$num,$val) );
$counter++;
}
@ -265,7 +265,7 @@ array(2) {
array(2) {
[0]=>
object(Test2)#%d (3) {
["member1:private"]=>
["member1":"Test2":private]=>
int(100)
["var1"]=>
int(30)
@ -274,7 +274,7 @@ array(2) {
}
[1]=>
object(Test2)#%d (3) {
["member1:private"]=>
["member1":"Test2":private]=>
int(100)
["var1"]=>
int(30)
@ -286,9 +286,9 @@ array(2) {
array(2) {
[0]=>
object(Child_test2)#%d (4) {
["member1:private"]=>
["member1":"Child_test2":private]=>
int(102)
["member1:private"]=>
["member1":"Test2":private]=>
int(100)
["var1"]=>
int(30)
@ -297,9 +297,9 @@ array(2) {
}
[1]=>
object(Child_test2)#%d (4) {
["member1:private"]=>
["member1":"Child_test2":private]=>
int(102)
["member1:private"]=>
["member1":"Test2":private]=>
int(100)
["var1"]=>
int(30)
@ -311,7 +311,7 @@ array(2) {
array(2) {
[0]=>
object(Test3)#%d (3) {
["member1:protected"]=>
["member1":protected]=>
int(100)
["var1"]=>
int(30)
@ -320,7 +320,7 @@ array(2) {
}
[1]=>
object(Test3)#%d (3) {
["member1:protected"]=>
["member1":protected]=>
int(100)
["var1"]=>
int(30)
@ -332,7 +332,7 @@ array(2) {
array(2) {
[0]=>
object(Child_test3)#%d (3) {
["member1:protected"]=>
["member1":protected]=>
int(102)
["var1"]=>
int(30)
@ -341,7 +341,7 @@ array(2) {
}
[1]=>
object(Child_test3)#%d (3) {
["member1:protected"]=>
["member1":protected]=>
int(102)
["var1"]=>
int(30)
@ -355,18 +355,18 @@ array(2) {
object(Test4)#%d (3) {
["member1"]=>
int(100)
["member2:private"]=>
["member2":"Test4":private]=>
int(101)
["member3:protected"]=>
["member3":protected]=>
int(102)
}
[1]=>
object(Test4)#%d (3) {
["member1"]=>
int(100)
["member2:private"]=>
["member2":"Test4":private]=>
int(101)
["member3:protected"]=>
["member3":protected]=>
int(102)
}
}
@ -378,9 +378,9 @@ array(2) {
int(103)
["member1"]=>
int(100)
["member2:private"]=>
["member2":"Test4":private]=>
int(101)
["member3:protected"]=>
["member3":protected]=>
int(102)
}
[1]=>
@ -389,9 +389,9 @@ array(2) {
int(103)
["member1"]=>
int(100)
["member2:private"]=>
["member2":"Test4":private]=>
int(101)
["member3:protected"]=>
["member3":protected]=>
int(102)
}
}
@ -401,9 +401,9 @@ array(2) {
object(ConcreteClass1)#%d (4) {
["member1"]=>
NULL
["member2:private"]=>
["member2":"AbstractClass":private]=>
NULL
["member3:protected"]=>
["member3":protected]=>
NULL
["var1"]=>
int(30)
@ -412,9 +412,9 @@ array(2) {
object(ConcreteClass1)#%d (4) {
["member1"]=>
NULL
["member2:private"]=>
["member2":"AbstractClass":private]=>
NULL
["member3:protected"]=>
["member3":protected]=>
NULL
["var1"]=>
int(30)
@ -429,4 +429,4 @@ array(2) {
object(Template1)#%d (0) {
}
}
Done
Done

View File

@ -1,8 +1,8 @@
--TEST--
Test array_fill() function : usage variations - unexpected values for 'start_key' argument(Bug#43017)
Test array_fill() function : usage variations - unexpected values for 'start_key' argument
--FILE--
<?php
/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
/* Prototype : proto array array_fill(int start_key, int num, mixed val)
* Description: Create an array containing num elements starting with index start_key each initialized to val
* Source code: ext/standard/array.c
*/
@ -42,7 +42,7 @@ $values = array(
/* 1 */ 10.5,
-10.5,
12.3456789000e10,
12.3456789000E-10,
12.34567890006E-10,
.5,
// array values
@ -142,26 +142,25 @@ array(2) {
}
-- Iteration 6 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
NULL
-- Iteration 7 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
NULL
-- Iteration 8 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
NULL
-- Iteration 9 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
NULL
-- Iteration 10 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
NULL
-- Iteration 11 --
array(2) {
[0]=>
int(100)
@ -169,7 +168,6 @@ array(2) {
int(100)
}
-- Iteration 12 --
array(2) {
[0]=>
int(100)
@ -177,7 +175,6 @@ array(2) {
int(100)
}
-- Iteration 13 --
array(2) {
[1]=>
int(100)
@ -185,7 +182,6 @@ array(2) {
int(100)
}
-- Iteration 14 --
array(2) {
[0]=>
int(100)
@ -193,7 +189,6 @@ array(2) {
int(100)
}
-- Iteration 15 --
array(2) {
[1]=>
int(100)
@ -201,7 +196,6 @@ array(2) {
int(100)
}
-- Iteration 16 --
array(2) {
[0]=>
int(100)
@ -209,47 +203,41 @@ array(2) {
int(100)
}
-- Iteration 17 --
array(2) {
[0]=>
int(100)
[1]=>
int(100)
}
Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
NULL
-- Iteration 18 --
array(2) {
[0]=>
int(100)
[1]=>
int(100)
}
Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
NULL
-- Iteration 19 --
array(2) {
[0]=>
int(100)
[1]=>
int(100)
}
Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
NULL
-- Iteration 20 --
array(2) {
[0]=>
int(100)
[1]=>
int(100)
}
Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
NULL
-- Iteration 21 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
Warning: array_fill() expects parameter 1 to be long, object given in %s on line %d
NULL
-- Iteration 22 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
array(2) {
[0]=>
int(100)
[1]=>
int(100)
}
-- Iteration 23 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
array(2) {
[0]=>
int(100)
[1]=>
int(100)
}
-- Iteration 24 --
Warning: array_fill(): Wrong data type for start key in %s on line %d
bool(false)
Warning: array_fill() expects parameter 1 to be long, resource given in %s on line %d
NULL
Done

View File

@ -2,7 +2,7 @@
Test array_fill() function : usage variations - unexpected values for 'num' argument
--FILE--
<?php
/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
/* Prototype : proto array array_fill(int start_key, int num, mixed val)
* Description: Create an array containing num elements starting with index start_key each initialized to val
* Source code: ext/standard/array.c
*/
@ -13,7 +13,7 @@ Test array_fill() function : usage variations - unexpected values for 'num' arg
echo "*** Testing array_fill() : usage variations ***\n";
// Initialise function arguments not being substituted (if any)
// Initialise function arguments not being substituted
$start_key = 0;
$val = 100;
@ -74,7 +74,7 @@ $values = array(
@$undefined_var,
// unset variable
/* 23 */ @$unset_var,
/* 24 */ @$unset_var,
);
@ -87,7 +87,7 @@ for($index = 0; $index < count($values); $index ++)
echo "-- Iteration $counter --\n";
$num = $values[$index];
var_dump( array_fill($start_key, $num, $val) );
var_dump( array_fill($start_key,$num,$val) );
$counter ++;
}
@ -131,28 +131,24 @@ Warning: array_fill(): Number of elements must be positive in %s on line %d
bool(false)
-- Iteration 6 --
Warning: array_fill(): Number of elements must be positive in %s on line %d
bool(false)
Warning: array_fill() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 7 --
array(1) {
[0]=>
int(100)
}
Warning: array_fill() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 8 --
array(1) {
[0]=>
int(100)
}
Warning: array_fill() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 9 --
array(1) {
[0]=>
int(100)
}
Warning: array_fill() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 10 --
array(1) {
[0]=>
int(100)
}
Warning: array_fill() expects parameter 2 to be long, array given in %s on line %d
NULL
-- Iteration 11 --
Warning: array_fill(): Number of elements must be positive in %s on line %d
@ -181,27 +177,24 @@ Warning: array_fill(): Number of elements must be positive in %s on line %d
bool(false)
-- Iteration 17 --
Warning: array_fill(): Number of elements must be positive in %s on line %d
bool(false)
Warning: array_fill() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 18 --
Warning: array_fill(): Number of elements must be positive in %s on line %d
bool(false)
Warning: array_fill() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 19 --
Warning: array_fill(): Number of elements must be positive in %s on line %d
bool(false)
Warning: array_fill() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 20 --
Warning: array_fill(): Number of elements must be positive in %s on line %d
bool(false)
Warning: array_fill() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 21 --
Notice: Object of class test could not be converted to int in %s on line %d
array(1) {
[0]=>
int(100)
}
Warning: array_fill() expects parameter 2 to be long, object given in %s on line %d
NULL
-- Iteration 22 --
Warning: array_fill(): Number of elements must be positive in %s on line %d

View File

@ -56,7 +56,7 @@ for($index = 0; $index < count($values); $index ++)
echo "-- Iteration $counter --\n";
$val = $values[$index];
var_dump( array_fill($start_key, $num, $val) );
var_dump( array_fill($start_key , $num , $val) );
$counter++;
}
@ -107,4 +107,4 @@ array(2) {
[1]=>
NULL
}
Done
Done

View File

@ -1,8 +1,8 @@
--TEST--
Test array_fill() function : usage variations - using return value of array_fill as 'val' arugment
Test array_fill() function : usage variations - using return value of array_fill for 'val' argument
--FILE--
<?php
/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
/* Prototype : proto array array_fill(int start_key, int num, mixed val)
* Description: Create an array containing num elements starting with index start_key each initialized to val
* Source code: ext/standard/array.c
*/
@ -36,7 +36,7 @@ for($i =0; $i < count($values); $i ++)
echo "-- Iteration $counter --\n";
$val = $values[$i];
var_dump( array_fill($start_key, $num, array_fill($start_key, $num, $val)) );
var_dump( array_fill($start_key,$num,array_fill($start_key,$num,$val)) );
$counter++;
}

View File

@ -45,7 +45,7 @@ for($i = 0; $i < count($values); $i++)
echo "-- Iteration $counter --\n";
$val = $values[$i];
var_dump( array_fill($start_key, $num, $val) );
var_dump( array_fill($start_key , $num , $val) );
$counter++;
}

View File

@ -82,12 +82,12 @@ array(2) {
array(0) {
}
Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, array given in %s on line %d
NULL
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, string given in %s on line %d
NULL
Warning: array_filter(): The second argument, '1', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, integer given in %s on line %d
NULL
== DONE ==

View File

@ -39,12 +39,12 @@ echo "Done"
--EXPECTF--
*** Testing array_filter() : error conditions ***
-- Testing array_filter() function with Zero arguments --
Warning: Wrong parameter count for array_filter() in %s on line %d
Warning: array_filter() expects at least 1 parameter, 0 given in %s on line %d
NULL
-- Testing array_filter() function with more than expected no. of arguments --
Warning: Wrong parameter count for array_filter() in %s on line %d
Warning: array_filter() expects at most 2 parameters, 3 given in %s on line %d
NULL
-- Testing array_filter() function with incorrect callback --
Warning: array_filter(): The second argument, 'even', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, string given in %s on line %d
NULL
Done

View File

@ -111,14 +111,14 @@ array(5) {
}
[2]=>
object(ChildClass)#%d (2) {
["var3:private"]=>
["var3":"ChildClass":private]=>
NULL
["var2:protected"]=>
["var2":protected]=>
int(5)
}
[3]=>
object(FinalClass)#%d (1) {
["var4:private"]=>
["var4":"FinalClass":private]=>
NULL
}
[4]=>
@ -136,14 +136,14 @@ array(5) {
}
[2]=>
object(ChildClass)#%d (2) {
["var3:private"]=>
["var3":"ChildClass":private]=>
NULL
["var2:protected"]=>
["var2":protected]=>
int(5)
}
[3]=>
object(FinalClass)#%d (1) {
["var4:private"]=>
["var4":"FinalClass":private]=>
NULL
}
[4]=>

View File

@ -7,7 +7,7 @@ Test array_filter() function : usage variations - Unexpected values for 'input'
* Source code: ext/standard/array.c
*/
/* Testing different scalar and non-scalar values for 'input' argument
/* Passing different scalar and nonscalar values for 'input' argument
*/
echo "*** Testing array_filter() : usage variations - unexpected values for 'input'***\n";
@ -102,94 +102,94 @@ echo "Done"
*** Testing array_filter() : usage variations - unexpected values for 'input'***
-- Iteration 1 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 2 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 3 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 4 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 5 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 6 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 7 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 8 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 9 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 10 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 11 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 12 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 13 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 14 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 15 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 16 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 17 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 18 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 19 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 20 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, object given in %s on line %d
NULL
-- Iteration 21 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, resource given in %s on line %d
NULL
-- Iteration 22 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 23 --
Warning: array_filter(): The first argument should be an array in %s on line %d
Warning: array_filter() expects parameter 1 to be array, null given in %s on line %d
NULL
Done

View File

@ -7,7 +7,7 @@ Test array_filter() function : usage variations - Unexpected values for 'callbac
* Source code: ext/standard/array.c
*/
/* Testing different scalar non-scalar values in place of 'callback' argument
/* Passing different scalar and nonscalar values in place of 'callback' argument
*/
echo "*** Testing array_filter() : usage variations - unexpected values for 'callback' function***\n";
@ -30,7 +30,7 @@ class MyClass
// resource variable
$fp = fopen(__FILE__, 'r');
// different scalar/non-scalar values inplace of 'callback'
// different scalar and nonscalar values in place of callback function
$values = array(
// int data
@ -98,87 +98,87 @@ echo "Done"
--EXPECTF--
*** Testing array_filter() : usage variations - unexpected values for 'callback' function***
-- Iteration 1 --
Warning: array_filter(): The second argument, '0', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, integer given in %s on line %d
NULL
-- Iteration 2 --
Warning: array_filter(): The second argument, '1', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, integer given in %s on line %d
NULL
-- Iteration 3 --
Warning: array_filter(): The second argument, '12345', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, integer given in %s on line %d
NULL
-- Iteration 4 --
Warning: array_filter(): The second argument, '-2345', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, integer given in %s on line %d
NULL
-- Iteration 5 --
Warning: array_filter(): The second argument, '10.5', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, double given in %s on line %d
NULL
-- Iteration 6 --
Warning: array_filter(): The second argument, '-10.5', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, double given in %s on line %d
NULL
-- Iteration 7 --
Warning: array_filter(): The second argument, '123456789000', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, double given in %s on line %d
NULL
-- Iteration 8 --
Warning: array_filter(): The second argument, '1.23456789E-9', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, double given in %s on line %d
NULL
-- Iteration 9 --
Warning: array_filter(): The second argument, '0.5', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, double given in %s on line %d
NULL
-- Iteration 10 --
Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, array given in %s on line %d
NULL
-- Iteration 11 --
Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, array given in %s on line %d
NULL
-- Iteration 12 --
Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, array given in %s on line %d
NULL
-- Iteration 13 --
Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, array given in %s on line %d
NULL
-- Iteration 14 --
Warning: array_filter(): The second argument, 'Array', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, array given in %s on line %d
NULL
-- Iteration 15 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, null given in %s on line %d
NULL
-- Iteration 16 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, null given in %s on line %d
NULL
-- Iteration 17 --
Warning: array_filter(): The second argument, '1', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, boolean given in %s on line %d
NULL
-- Iteration 18 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, boolean given in %s on line %d
NULL
-- Iteration 19 --
Warning: array_filter(): The second argument, '1', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, boolean given in %s on line %d
NULL
-- Iteration 20 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, boolean given in %s on line %d
NULL
-- Iteration 21 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, string given in %s on line %d
NULL
-- Iteration 22 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, string given in %s on line %d
NULL
-- Iteration 23 --
Warning: array_filter(): The second argument, 'string', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, string given in %s on line %d
NULL
-- Iteration 24 --
Warning: array_filter(): The second argument, 'string', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, string given in %s on line %d
NULL
-- Iteration 25 --
Warning: array_filter(): The second argument, 'object', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, object given in %s on line %d
NULL
-- Iteration 26 --
Warning: array_filter(): The second argument, %s, should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, resource given in %s on line %d
NULL
-- Iteration 27 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, null given in %s on line %d
NULL
-- Iteration 28 --
Warning: array_filter(): The second argument, '', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, null given in %s on line %d
NULL
Done

View File

@ -9,9 +9,9 @@ Test array_filter() function : usage variations - Different types of 'callback'
/*
* Passing different types of callback functions to array_filter()
* with parameter and return
* with paramter and without return
* with parameters and return
* without parameter and with return
* with parameter and without return
* without parameter and without return
*/

View File

@ -8,7 +8,7 @@ Test array_filter() function : usage variations - anonymous callback functions
*/
/*
* Passing different anonymous callback functions with passed by value and reference arguments,
* Passing different anonymous callback functions with passed by value and reference arguments
*/
echo "*** Testing array_filter() : usage variations - Anonymous callback functions ***\n";

View File

@ -64,9 +64,9 @@ array(8) {
NULL
}
Warning: array_filter(): The second argument, 'echo', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, string given in %s on line %d
NULL
Warning: array_filter(): The second argument, 'exit', should be a valid callback in %s on line %d
Warning: array_filter() expects parameter 2 to be valid callback, string given in %s on line %d
NULL
Done

View File

@ -14,13 +14,6 @@ $trans = array("a" => 1,
2 => "i");
$trans = array_flip($trans);
var_dump($trans);
var_dump(array_flip());
var_dump(array_flip(array()));
var_dump(array_flip(array(1)));
var_dump(array_flip(array(array())));
echo "Done\n";
?>
--EXPECTF--
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
@ -42,17 +35,3 @@ array(6) {
["i"]=>
int(2)
}
Warning: Wrong parameter count for array_flip() in %s on line %d
NULL
array(0) {
}
array(1) {
[1]=>
int(0)
}
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
array(0) {
}
Done

View File

@ -25,10 +25,10 @@ echo "Done"
*** Testing array_flip() : error conditions ***
-- Testing array_flip() function with Zero arguments --
Warning: Wrong parameter count for array_flip() in %s on line %d
Warning: array_flip() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-- Testing array_flip() function with more than expected no. of arguments --
Warning: Wrong parameter count for array_flip() in %s on line %d
Warning: array_flip() expects exactly 1 parameter, 2 given in %s on line %d
NULL
Done

View File

@ -86,93 +86,94 @@ echo "Done"
*** Testing array_flip() : usage variations - unexpected values for 'input' ***
-- Iteration 1 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 2 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 3 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 4 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 5 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 6 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 7 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 8 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 9 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 10 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 11 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 12 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 13 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 14 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 15 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 16 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 17 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 18 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 19 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 20 --
array(0) {
}
Warning: array_flip() expects parameter 1 to be array, object given in %s on line %d
NULL
-- Iteration 21 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 22 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 23 --
Warning: array_flip(): The argument should be an array in %s on line %d
bool(false)
Warning: array_flip() expects parameter 1 to be array, resource given in %s on line %d
NULL
Done

View File

@ -30,8 +30,8 @@ $input = array(
// float values
'float_value1' => 1.2,
'float_value2' => 0.5,
'float_value3' => 3.4E3,
'float_value4' => 5.6E-6,
'flaot_value3' => 3.4E3,
'flaot_value4' => 5.6E-6,
// bool values
'bool_value1' => true,

View File

@ -2,7 +2,7 @@
Test of the *intersect* bunch of functions (both assoc and non-assoc)
--FILE--
<?php
error_reporting(E_ALL|E_STRICT);
error_reporting(E_ALL);
class cr {
private $priv_member;
public $public_member;
@ -14,10 +14,6 @@ class cr {
if ($a->priv_member === $b->priv_member) return 0;
return ($a->priv_member > $b->priv_member)? 1:-1;
}
function __toString() {
return "Object";
}
}
function comp_func($a, $b) {
@ -34,14 +30,6 @@ function comp_func_cr($a, $b) {
$a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1=> new cr(4), 2 => new cr(-15),);
$b = array("0.2" => new cr(9), "0.5" => new cr(22), 0 => new cr( 3), 1=> new cr(4), 2 => new cr(-15),);
/* array_intersect() */
echo "begin ------------ array_intersect() ----------------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_intersect($a, $b);'."\n";
var_dump(array_intersect($a, $b));
echo "end ------------ array_intersect() ----------------------------\n";
/* array_uintersect() */
echo "begin ------------ array_uintersect() ---------------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
@ -50,14 +38,6 @@ echo 'var_dump(array_uintersect($a, $b, "comp_func_cr"));'."\n";
var_dump(array_uintersect($a, $b, "comp_func_cr"));
echo "end ------------ array_uintersect() ---------------------------\n";
/* array_intersect_assoc() */
echo "begin ------------ array_intersect_assoc() ----------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_intersect_assoc($a, $b));'."\n";
var_dump(array_intersect_assoc($a, $b));
echo "end ------------ array_intersect_assoc() ----------------------\n";
/* array_uintersect_assoc() */
echo "begin ------------ array_uintersect_assoc() ---------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
@ -66,14 +46,6 @@ echo 'var_dump(array_uintersect_assoc($a, $b, "comp_func_cr"));'."\n";
var_dump(array_uintersect_assoc($a, $b, "comp_func_cr"));
echo "end ------------ array_uintersect_assoc() ---------------------\n";
/* array_intersect_uassoc() */
echo "begin ------------ array_intersect_uassoc() ---------------------\n";
echo '$a='.var_export($a,TRUE).";\n";
echo '$b='.var_export($b,TRUE).";\n";
echo 'var_dump(array_intersect_uassoc($a, $b, "comp_func"));'."\n";
var_dump(array_intersect_uassoc($a, $b, "comp_func"));
echo "end ------------ array_intersect_uassoc() ---------------------\n";
/* array_uintersect_uassoc() - with ordinary function */
echo "begin ------------ array_uintersect_uassoc() with ordinary func -\n";
echo '$a='.var_export($a,TRUE).";\n";
@ -91,100 +63,6 @@ var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func
echo "end ------------ array_uintersect_uassoc() with method --------\n";
?>
--EXPECTF--
begin ------------ array_intersect() ----------------------------
$a=array (
'0.1' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 12,
'public_member' => 12,
)),
0 =>
cr::__set_state(array(
'priv_member' => 23,
'public_member' => 23,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
$b=array (
'0.2' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 22,
'public_member' => 22,
)),
0 =>
cr::__set_state(array(
'priv_member' => 3,
'public_member' => 3,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
var_dump(array_intersect($a, $b);
array(5) {
["0.1"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(9)
["public_member"]=>
int(9)
}
["0.5"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
int(23)
}
[1]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
int(-15)
}
}
end ------------ array_intersect() ----------------------------
begin ------------ array_uintersect() ---------------------------
$a=array (
'0.1' =>
@ -244,114 +122,27 @@ var_dump(array_uintersect($a, $b, "comp_func_cr"));
array(3) {
["0.1"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(9)
["public_member"]=>
int(9)
}
[1]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(-15)
["public_member"]=>
int(-15)
}
}
end ------------ array_uintersect() ---------------------------
begin ------------ array_intersect_assoc() ----------------------
$a=array (
'0.1' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 12,
'public_member' => 12,
)),
0 =>
cr::__set_state(array(
'priv_member' => 23,
'public_member' => 23,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
$b=array (
'0.2' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 22,
'public_member' => 22,
)),
0 =>
cr::__set_state(array(
'priv_member' => 3,
'public_member' => 3,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
var_dump(array_intersect_assoc($a, $b));
array(4) {
["0.5"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
int(23)
}
[1]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
int(-15)
}
}
end ------------ array_intersect_assoc() ----------------------
begin ------------ array_uintersect_assoc() ---------------------
$a=array (
'0.1' =>
@ -411,107 +202,20 @@ var_dump(array_uintersect_assoc($a, $b, "comp_func_cr"));
array(2) {
[1]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(-15)
["public_member"]=>
int(-15)
}
}
end ------------ array_uintersect_assoc() ---------------------
begin ------------ array_intersect_uassoc() ---------------------
$a=array (
'0.1' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 12,
'public_member' => 12,
)),
0 =>
cr::__set_state(array(
'priv_member' => 23,
'public_member' => 23,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
$b=array (
'0.2' =>
cr::__set_state(array(
'priv_member' => 9,
'public_member' => 9,
)),
'0.5' =>
cr::__set_state(array(
'priv_member' => 22,
'public_member' => 22,
)),
0 =>
cr::__set_state(array(
'priv_member' => 3,
'public_member' => 3,
)),
1 =>
cr::__set_state(array(
'priv_member' => 4,
'public_member' => 4,
)),
2 =>
cr::__set_state(array(
'priv_member' => -15,
'public_member' => -15,
)),
);
var_dump(array_intersect_uassoc($a, $b, "comp_func"));
array(4) {
["0.5"]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(12)
["public_member"]=>
int(12)
}
[0]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(23)
["public_member"]=>
int(23)
}
[1]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
object(cr)#%d (2) {
["priv_member:private"]=>
int(-15)
["public_member"]=>
int(-15)
}
}
end ------------ array_intersect_uassoc() ---------------------
begin ------------ array_uintersect_uassoc() with ordinary func -
$a=array (
'0.1' =>
@ -571,14 +275,14 @@ var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func"));
array(2) {
[1]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(-15)
["public_member"]=>
int(-15)
@ -644,14 +348,14 @@ var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func
array(2) {
[1]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(4)
["public_member"]=>
int(4)
}
[2]=>
object(cr)#%d (2) {
["priv_member:private"]=>
["priv_member":"cr":private]=>
int(-15)
["public_member"]=>
int(-15)

View File

@ -25,11 +25,11 @@ echo "Done";
-- Testing array_intersect() function with Zero arguments --
Warning: Wrong parameter count for array_intersect() in %s on line %d
Warning: array_intersect(): at least 2 parameters are required, 0 given in %s on line %d
NULL
-- Testing array_intersect() function with less than expected no. of arguments --
Warning: Wrong parameter count for array_intersect() in %s on line %d
Warning: array_intersect(): at least 2 parameters are required, 1 given in %s on line %d
NULL
Done

View File

@ -1,5 +1,5 @@
--TEST--
Test array_intersect() function : usage variations - two dimensional arrays for $arr1 and $arr2 arguments
Test array_intersect() function : usage variations - two dimensional arrays for $arr1 and $arr2 arguments(Bug#43109)
--FILE--
<?php
/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])

View File

@ -249,7 +249,7 @@ bool(true)
*** Testing error conditions ***
Warning: Wrong parameter count for array_key_exists() in %s on line %d
Warning: array_key_exists() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: array_key_exists(): The first argument should be either a string or an integer in %s on line %d
@ -273,7 +273,7 @@ bool(false)
Warning: array_key_exists(): The second argument should be either an array or an object in %s on line %d
bool(false)
Warning: Wrong parameter count for array_key_exists() in %s on line %d
Warning: array_key_exists() expects exactly 2 parameters, 3 given in %s on line %d
NULL
Warning: array_key_exists(): The first argument should be either a string or an integer in %s on line %d

View File

@ -0,0 +1,27 @@
--TEST--
Test array_keys() function (basic)
--FILE--
<?php
echo "*** Testing array_keys() on basic array operation ***\n";
$basic_arr = array("a" => 1, "b" => 2, 2.0 => 2.0, -23.45 => "asdasd",
array(1,2,3));
var_dump(array_keys($basic_arr));
echo "Done\n";
?>
--EXPECTF--
*** Testing array_keys() on basic array operation ***
array(5) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
int(2)
[3]=>
int(-23)
[4]=>
int(3)
}
Done

View File

@ -15,19 +15,19 @@ echo "Done\n";
?>
--EXPECTF--
*** Testing error conditions ***
Warning: array_keys(): The first argument should be an array in %s on line %d
Warning: array_keys() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: array_keys(): The first argument should be an array in %s on line %d
Warning: array_keys() expects parameter 1 to be array, string given in %s on line %d
NULL
Warning: array_keys(): The first argument should be an array in %s on line %d
Warning: array_keys() expects parameter 1 to be array, object given in %s on line %d
NULL
Warning: Wrong parameter count for array_keys() in %s on line %d
Warning: array_keys() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: Wrong parameter count for array_keys() in %s on line %d
Warning: array_keys() expects at most 3 parameters, 4 given in %s on line %d
NULL
Warning: Illegal offset type in %s on line %d

View File

@ -20,13 +20,15 @@ $types_arr = array(
);
$values = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", "");
foreach ($values as $value){
var_dump(array_keys($types_arr, $value));
var_dump($value);
var_dump(array_keys($types_arr, $value));
}
echo "Done\n";
?>
--EXPECTF--
*** Testing array_keys() on all the types other than arrays ***
bool(true)
array(3) {
[0]=>
int(1)
@ -35,6 +37,7 @@ array(3) {
[2]=>
string(3) "php"
}
bool(false)
array(4) {
[0]=>
int(0)
@ -45,10 +48,12 @@ array(4) {
[3]=>
string(0) ""
}
int(1)
array(1) {
[0]=>
int(1)
}
int(0)
array(4) {
[0]=>
int(0)
@ -59,22 +64,27 @@ array(4) {
[3]=>
string(0) ""
}
int(-1)
array(1) {
[0]=>
int(-1)
}
string(1) "1"
array(1) {
[0]=>
int(1)
}
string(1) "0"
array(1) {
[0]=>
int(0)
}
string(2) "-1"
array(1) {
[0]=>
int(-1)
}
NULL
array(3) {
[0]=>
int(2)
@ -83,16 +93,20 @@ array(3) {
[2]=>
string(0) ""
}
array(0) {
}
array(2) {
[0]=>
int(2)
[1]=>
int(3)
}
string(3) "php"
array(1) {
[0]=>
string(3) "php"
}
string(0) ""
array(2) {
[0]=>
int(2)

View File

@ -106,7 +106,7 @@ class check_array_map {
/* call static member function */
var_dump( array_map( array('check_array_map', 'Square'), array(1,2,3)) );
/* call non static member function - notice should be issues*/
/* call non static member function - warning should be issues*/
var_dump( array_map( array('check_array_map', 'Message'), array(1)) );
/* call function using object */
@ -369,31 +369,31 @@ NULL
Warning: array_map(): Argument #2 should be an array in %s on line %d
NULL
Warning: Wrong parameter count for array_map() %s on line %d
Warning: array_map() expects at least 2 parameters, 0 given in %s on line %d
NULL
Warning: array_map(): The first argument, 'echo', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
Warning: array_map(): The first argument, 'array', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
Warning: array_map(): The first argument, 'empty', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
Warning: array_map(): The first argument, 'eval', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
Warning: array_map(): The first argument, 'exit', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
Warning: array_map(): The first argument, 'isset', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
Warning: array_map(): The first argument, 'list', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
Warning: array_map(): The first argument, 'print', should be either NULL or a valid callback in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, string given in %s on line %d
NULL
*** Testing operation on objects ***
@ -406,15 +406,10 @@ array(3) {
int(9)
}
Strict Standards: Non-static method check_array_map::Message() cannot be called statically in %s on line %d
Warning: array_map() expects parameter 1 to be valid callback, array given in %s on line %d
NULL
Strict Standards: Non-static method check_array_map::Message() cannot be called statically in %s on line %d
array(1) {
[0]=>
int(1)
}
Warning: Wrong parameter count for array_map() in %s on line %d
Warning: array_map() expects at least 2 parameters, 1 given in %s on line %d
NULL
array(1) {
[0]=>

View File

@ -0,0 +1,764 @@
--TEST--
Test array_merge() function
--INI--
precision=14
--FILE--
<?php
/* Prototype: array array_merge(array $array1 [, array $array2 [, array $...]]);
Description: Merge one or more arrays
*/
echo "\n*** Testing array_merge() basic functionality ***";
$begin_array = array(
array(),
array( 1 => "string"),
array( "" => "string"),
array( -2.44444 => 12),
array( "a" => 1, "b" => -2.344, "b" => "string", "c" => NULL, "d" => -2.344),
array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL,1 => -2.344),
array( NULL, 1.23 => "Hi", "string" => "hello",
array("" => "World", "-2.34" => "a", "0" => "b"))
);
$end_array = array(
array(),
array( 1 => "string"),
array( "" => "string"),
array( -2.44444 => 12),
array( "a" => 1, "b" => -2.344, "b" => "string", "c" => NULL, "d" => -2.344),
array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL, 1=> -2.344),
array( NULL, 1.23 => "Hi", "string" => "hello",
array("" => "World", "-2.34" => "a", "0" => "b"))
);
/* loop through to merge two arrays */
$count_outer = 0;
foreach($begin_array as $first) {
echo "\n\n--- Iteration $count_outer ---";
$count_inner = 0;
foreach($end_array as $second) {
echo "\n-- Inner iteration $count_inner of Iteration $count_outer --\n";
$result = array_merge($first, $second);
print_r($result);
$count_inner++;
}
$count_outer++;
}
echo "\n*** Testing array_merge() with three or more arrays ***\n";
var_dump( array_merge( $end_array[0],
$end_array[5],
$end_array[4],
$end_array[6]
)
);
var_dump( array_merge( $end_array[0],
$end_array[5],
array("array on fly"),
array("nullarray" => array())
)
);
echo "\n*** Testing single array argument ***\n";
/* Empty array */
var_dump(array_merge(array()));
/* associative array with string keys, which will not be re-indexed */
var_dump(array_merge($begin_array[4]));
/* associative array with numeric keys, which will be re-indexed */
var_dump(array_merge($begin_array[5]));
/* associative array with mixed keys and sub-array as element */
var_dump(array_merge($begin_array[6]));
echo "\n*** Testing array_merge() with typecasting non-array to array ***\n";
var_dump(array_merge($begin_array[4], (array)"type1", (array)10, (array)12.34));
echo "\n*** Testing error conditions ***";
/* Invalid argumens */
var_dump(array_merge());
var_dump(array_merge(100, 200));
var_dump(array_merge($begin_array[0], $begin_array[1], 100));
var_dump(array_merge($begin_array[0], $begin_array[1], $arr4));
echo "Done\n";
?>
--EXPECTF--
*** Testing array_merge() basic functionality ***
--- Iteration 0 ---
-- Inner iteration 0 of Iteration 0 --
Array
(
)
-- Inner iteration 1 of Iteration 0 --
Array
(
[0] => string
)
-- Inner iteration 2 of Iteration 0 --
Array
(
[] => string
)
-- Inner iteration 3 of Iteration 0 --
Array
(
[0] => 12
)
-- Inner iteration 4 of Iteration 0 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 5 of Iteration 0 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
)
-- Inner iteration 6 of Iteration 0 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
--- Iteration 1 ---
-- Inner iteration 0 of Iteration 1 --
Array
(
[0] => string
)
-- Inner iteration 1 of Iteration 1 --
Array
(
[0] => string
[1] => string
)
-- Inner iteration 2 of Iteration 1 --
Array
(
[0] => string
[] => string
)
-- Inner iteration 3 of Iteration 1 --
Array
(
[0] => string
[1] => 12
)
-- Inner iteration 4 of Iteration 1 --
Array
(
[0] => string
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 5 of Iteration 1 --
Array
(
[0] => string
[1] => 1
[2] => string
[3] =>
[4] => -2.344
)
-- Inner iteration 6 of Iteration 1 --
Array
(
[0] => string
[1] =>
[2] => Hi
[string] => hello
[3] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
--- Iteration 2 ---
-- Inner iteration 0 of Iteration 2 --
Array
(
[] => string
)
-- Inner iteration 1 of Iteration 2 --
Array
(
[] => string
[0] => string
)
-- Inner iteration 2 of Iteration 2 --
Array
(
[] => string
)
-- Inner iteration 3 of Iteration 2 --
Array
(
[] => string
[0] => 12
)
-- Inner iteration 4 of Iteration 2 --
Array
(
[] => string
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 5 of Iteration 2 --
Array
(
[] => string
[0] => 1
[1] => string
[2] =>
[3] => -2.344
)
-- Inner iteration 6 of Iteration 2 --
Array
(
[] => string
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
--- Iteration 3 ---
-- Inner iteration 0 of Iteration 3 --
Array
(
[0] => 12
)
-- Inner iteration 1 of Iteration 3 --
Array
(
[0] => 12
[1] => string
)
-- Inner iteration 2 of Iteration 3 --
Array
(
[0] => 12
[] => string
)
-- Inner iteration 3 of Iteration 3 --
Array
(
[0] => 12
[1] => 12
)
-- Inner iteration 4 of Iteration 3 --
Array
(
[0] => 12
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 5 of Iteration 3 --
Array
(
[0] => 12
[1] => 1
[2] => string
[3] =>
[4] => -2.344
)
-- Inner iteration 6 of Iteration 3 --
Array
(
[0] => 12
[1] =>
[2] => Hi
[string] => hello
[3] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
--- Iteration 4 ---
-- Inner iteration 0 of Iteration 4 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 1 of Iteration 4 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
[0] => string
)
-- Inner iteration 2 of Iteration 4 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
[] => string
)
-- Inner iteration 3 of Iteration 4 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
[0] => 12
)
-- Inner iteration 4 of Iteration 4 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 5 of Iteration 4 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
[0] => 1
[1] => string
[2] =>
[3] => -2.344
)
-- Inner iteration 6 of Iteration 4 --
Array
(
[a] => 1
[b] => string
[c] =>
[d] => -2.344
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
--- Iteration 5 ---
-- Inner iteration 0 of Iteration 5 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
)
-- Inner iteration 1 of Iteration 5 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
[4] => string
)
-- Inner iteration 2 of Iteration 5 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
[] => string
)
-- Inner iteration 3 of Iteration 5 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
[4] => 12
)
-- Inner iteration 4 of Iteration 5 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 5 of Iteration 5 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
[4] => 1
[5] => string
[6] =>
[7] => -2.344
)
-- Inner iteration 6 of Iteration 5 --
Array
(
[0] => 1
[1] => string
[2] =>
[3] => -2.344
[4] =>
[5] => Hi
[string] => hello
[6] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
--- Iteration 6 ---
-- Inner iteration 0 of Iteration 6 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
-- Inner iteration 1 of Iteration 6 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
[3] => string
)
-- Inner iteration 2 of Iteration 6 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
[] => string
)
-- Inner iteration 3 of Iteration 6 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
[3] => 12
)
-- Inner iteration 4 of Iteration 6 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
[a] => 1
[b] => string
[c] =>
[d] => -2.344
)
-- Inner iteration 5 of Iteration 6 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
[3] => 1
[4] => string
[5] =>
[6] => -2.344
)
-- Inner iteration 6 of Iteration 6 --
Array
(
[0] =>
[1] => Hi
[string] => hello
[2] => Array
(
[] => World
[-2.34] => a
[0] => b
)
[3] =>
[4] => Hi
[5] => Array
(
[] => World
[-2.34] => a
[0] => b
)
)
*** Testing array_merge() with three or more arrays ***
array(12) {
[0]=>
int(1)
[1]=>
string(6) "string"
[2]=>
NULL
[3]=>
float(-2.344)
["a"]=>
int(1)
["b"]=>
string(6) "string"
["c"]=>
NULL
["d"]=>
float(-2.344)
[4]=>
NULL
[5]=>
string(2) "Hi"
["string"]=>
string(5) "hello"
[6]=>
array(3) {
[""]=>
string(5) "World"
["-2.34"]=>
string(1) "a"
[0]=>
string(1) "b"
}
}
array(6) {
[0]=>
int(1)
[1]=>
string(6) "string"
[2]=>
NULL
[3]=>
float(-2.344)
[4]=>
string(12) "array on fly"
["nullarray"]=>
array(0) {
}
}
*** Testing single array argument ***
array(0) {
}
array(4) {
["a"]=>
int(1)
["b"]=>
string(6) "string"
["c"]=>
NULL
["d"]=>
float(-2.344)
}
array(4) {
[0]=>
int(1)
[1]=>
string(6) "string"
[2]=>
NULL
[3]=>
float(-2.344)
}
array(4) {
[0]=>
NULL
[1]=>
string(2) "Hi"
["string"]=>
string(5) "hello"
[2]=>
array(3) {
[""]=>
string(5) "World"
["-2.34"]=>
string(1) "a"
[0]=>
string(1) "b"
}
}
*** Testing array_merge() with typecasting non-array to array ***
array(7) {
["a"]=>
int(1)
["b"]=>
string(6) "string"
["c"]=>
NULL
["d"]=>
float(-2.344)
[0]=>
string(5) "type1"
[1]=>
int(10)
[2]=>
float(12.34)
}
*** Testing error conditions ***
Warning: Wrong parameter count for array_merge() in %s on line %d
NULL
Warning: array_merge(): Argument #1 is not an array in %s on line %d
Warning: array_merge(): Argument #2 is not an array in %s on line %d
NULL
Warning: array_merge(): Argument #3 is not an array in %s on line %d
NULL
Notice: Undefined variable: arr4 in %s on line %d
Warning: array_merge(): Argument #3 is not an array in %s on line %d
NULL
Done

View File

@ -21,13 +21,13 @@ var_dump(array_pad("", 2000000, 0));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for array_pad() in %s on line %d
Warning: array_pad() expects exactly 3 parameters, 0 given in %s on line %d
NULL
Warning: Wrong parameter count for array_pad() in %s on line %d
Warning: array_pad() expects exactly 3 parameters, 1 given in %s on line %d
NULL
Warning: Wrong parameter count for array_pad() in %s on line %d
Warning: array_pad() expects exactly 3 parameters, 2 given in %s on line %d
NULL
array(1) {
[0]=>
@ -96,6 +96,6 @@ array(4) {
Warning: array_pad(): You may only pad up to 1048576 elements at a time in %s on line %d
bool(false)
Warning: array_pad(): The argument should be an array in %s on line %d
Warning: array_pad() expects parameter 1 to be array, string given in %s on line %d
NULL
Done

View File

@ -48,16 +48,16 @@ echo"\nDone";
--EXPECTF--
*** Testing Error Conditions ***
Warning: Wrong parameter count for array_pop() in %s on line %d
Warning: array_pop() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Warning: array_pop(): The argument should be an array in %s on line %d
Warning: array_pop() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: array_pop(): The argument should be an array in %s on line %d
Warning: array_pop() expects parameter 1 to be array, string given in %s on line %d
NULL
Warning: Wrong parameter count for array_pop() in %s on line %d
Warning: array_pop() expects exactly 1 parameter, 2 given in %s on line %d
NULL
NULL

View File

@ -0,0 +1,282 @@
--TEST--
Test array_push() function
--FILE--
<?php
/* Prototype: int array_push( array &array );
* Description: Push one or more elements onto the end of array
and returns the new number of elements in the array.
*/
$empty_array = array();
$number = 5;
$str = "abc";
/* Various combinations of arrays to be used for the test */
$mixed_array = array(
array(),
array( 1,2,3,4,5,6,7,8,9 ),
array( "One", "_Two", "Three", "Four", "Five" ),
array( 6, "six", 7, "seven", 8, "eight", 9, "nine" ),
array( "a" => "aaa", "A" => "AAA", "c" => "ccc", "d" => "ddd", "e" => "eee" ),
array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five" ),
array( 1 => "one", 2 => "two", 3 => 7, 4 => "four", 5 => "five" ),
array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF",
"blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ),
array( 12, "name", 'age', '45' ),
array( array("oNe", "tWo", 4), array(10, 20, 30, 40, 50), array() ),
array( "one" => 1, "one" => 2, "three" => 3, 3, 4, 3 => 33, 4 => 44, 5, 6,
5.4 => 54, 5.7 => 57, "5.4" => 554, "5.7" => 557 )
);
/* Error Conditions */
echo "\n*** Testing Error Conditions ***\n";
/* Zero argument */
var_dump( array_push() );
/* Scalar argument */
var_dump( array_push($number, 22) );
/* String argument */
var_dump( array_push($str, 22) );
/* Invalid Number of arguments */
var_dump( array_push($mixed_array[1],1,2) );
/* Empty Array as argument */
var_dump( array_push($empty_array, 2) );
/* Loop to test normal functionality with different arrays inputs */
echo "\n*** Testing with various array inputs ***\n";
$counter = 1;
foreach( $mixed_array as $sub_array )
{
echo "\n-- Input Array for Iteration $counter is --\n";
print_r( $sub_array );
echo "\nOutput after push is :\n";
var_dump( array_push($sub_array, 22, "abc") );
$counter++;
}
/* Checking for return value and the new array formed from push operation */
echo "\n*** Checking for return value and the new array formed from push operation ***\n";
var_dump( array_push($mixed_array[2], 22, 33, "44") );
var_dump( $mixed_array[2] );
echo"\nDone";
?>
--EXPECTF--
*** Testing Error Conditions ***
Warning: Wrong parameter count for array_push() in %s on line %d
NULL
Warning: array_push(): First argument should be an array in %s on line %d
bool(false)
Warning: array_push(): First argument should be an array in %s on line %d
bool(false)
int(11)
int(1)
*** Testing with various array inputs ***
-- Input Array for Iteration 1 is --
Array
(
)
Output after push is :
int(2)
-- Input Array for Iteration 2 is --
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 9
[9] => 1
[10] => 2
)
Output after push is :
int(13)
-- Input Array for Iteration 3 is --
Array
(
[0] => One
[1] => _Two
[2] => Three
[3] => Four
[4] => Five
)
Output after push is :
int(7)
-- Input Array for Iteration 4 is --
Array
(
[0] => 6
[1] => six
[2] => 7
[3] => seven
[4] => 8
[5] => eight
[6] => 9
[7] => nine
)
Output after push is :
int(10)
-- Input Array for Iteration 5 is --
Array
(
[a] => aaa
[A] => AAA
[c] => ccc
[d] => ddd
[e] => eee
)
Output after push is :
int(7)
-- Input Array for Iteration 6 is --
Array
(
[1] => one
[2] => two
[3] => three
[4] => four
[5] => five
)
Output after push is :
int(7)
-- Input Array for Iteration 7 is --
Array
(
[1] => one
[2] => two
[3] => 7
[4] => four
[5] => five
)
Output after push is :
int(7)
-- Input Array for Iteration 8 is --
Array
(
[f] => fff
[1] => one
[4] => 6
[] => 3
[2] => float
[F] => FFF
[blank] =>
[3] => 3.7
[5] => Five
[6] => 8.6
[4name] => jonny
[a] =>
)
Output after push is :
int(14)
-- Input Array for Iteration 9 is --
Array
(
[0] => 12
[1] => name
[2] => age
[3] => 45
)
Output after push is :
int(6)
-- Input Array for Iteration 10 is --
Array
(
[0] => Array
(
[0] => oNe
[1] => tWo
[2] => 4
)
[1] => Array
(
[0] => 10
[1] => 20
[2] => 30
[3] => 40
[4] => 50
)
[2] => Array
(
)
)
Output after push is :
int(5)
-- Input Array for Iteration 11 is --
Array
(
[one] => 2
[three] => 3
[0] => 3
[1] => 4
[3] => 33
[4] => 44
[5] => 57
[6] => 6
[5.4] => 554
[5.7] => 557
)
Output after push is :
int(12)
*** Checking for return value and the new array formed from push operation ***
int(8)
array(8) {
[0]=>
string(3) "One"
[1]=>
string(4) "_Two"
[2]=>
string(5) "Three"
[3]=>
string(4) "Four"
[4]=>
string(4) "Five"
[5]=>
int(22)
[6]=>
int(33)
[7]=>
string(2) "44"
}
Done

View File

@ -16,14 +16,14 @@ var_dump(array_rand(array(1,2,3), 2));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for array_rand() in %s on line %d
Warning: array_rand() expects at least 1 parameter, 0 given in %s on line %d
NULL
NULL
Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d
NULL
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, integer given in %s on line %d
NULL
Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d

View File

@ -50,3 +50,4 @@ array(%d) {
-- with default argument --
int(%d)
Done

View File

@ -55,3 +55,4 @@ array(6) {
-- with default argument --
string(%d) "%s"
Done

View File

@ -27,11 +27,12 @@ echo "Done";
-- Testing array_rand() function with Zero arguments --
Warning: Wrong parameter count for array_rand() in %s on line %d
Warning: array_rand() expects at least 1 parameter, 0 given in %s on line %d
NULL
-- Testing array_rand() function with more than expected no. of arguments --
Warning: Wrong parameter count for array_rand() in %s on line %d
Warning: array_rand() expects at most 2 parameters, 3 given in %s on line %d
NULL
Done

View File

@ -1,5 +1,5 @@
--TEST--
Test array_rand() function : usage variations - unexpected values for 'input' parameter
Test array_rand() function : usage variations - unexpected values for 'input' parameter
--FILE--
<?php
/* Prototype : mixed array_rand(array input [, int num_req])
@ -101,116 +101,117 @@ echo "Done";
-- Iteration 1 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 2 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 3 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 4 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, integer given in %s on line %d
NULL
-- Iteration 5 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 6 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 7 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 8 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 9 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, double given in %s on line %d
NULL
-- Iteration 10 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 11 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 12 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 13 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 14 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 15 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, boolean given in %s on line %d
NULL
-- Iteration 16 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 17 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 18 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 19 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, string given in %s on line %d
NULL
-- Iteration 20 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, object given in %s on line %d
NULL
-- Iteration 21 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, resource given in %s on line %d
NULL
-- Iteration 22 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, null given in %s on line %d
NULL
-- Iteration 23 --
Warning: array_rand(): First argument has to be an array in %s on line %d
Warning: array_rand() expects parameter 1 to be array, null given in %s on line %d
NULL
Done

View File

@ -1,5 +1,5 @@
--TEST--
Test array_rand() function : usage variations - unexpected values for 'num_req' parameter
Test array_rand() function : usage variations - unexpected values for 'num_req' parameter
--FILE--
<?php
/* Prototype : mixed array_rand(array input [, int num_req])
@ -179,28 +179,28 @@ NULL
-- Iteration 16 --
Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d
Warning: array_rand() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 17 --
Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d
Warning: array_rand() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 18 --
Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d
Warning: array_rand() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 19 --
Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d
Warning: array_rand() expects parameter 2 to be long, string given in %s on line %d
NULL
-- Iteration 20 --
Notice: Object of class test could not be converted to int in %s on line %d
int(%d)
Warning: array_rand() expects parameter 2 to be long, object given in %s on line %d
NULL
-- Iteration 21 --
@ -212,3 +212,4 @@ NULL
Warning: array_rand(): Second argument has to be between 1 and the number of elements in the array in %s on line %d
NULL
Done

View File

@ -147,3 +147,4 @@ array(3) {
int(%d)
}
Done

Some files were not shown because too many files have changed in this diff Show More