Skip to content
Browse files

- Fix tests

- Update README.PARAMETER_PARSING_API
  • Loading branch information...
1 parent b489251 commit a541bb80788100606c59bf5a67478234a2045a6a Jani Taskinen committed
Showing with 4,503 additions and 2,014 deletions.
  1. +103 −45 README.PARAMETER_PARSING_API
  2. +1 −3 Zend/tests/bug31720.phpt
  3. +6 −6 Zend/tests/bug32290.phpt
  4. +9 −6 Zend/tests/bug36214.phpt
  5. +3 −3 Zend/tests/bug37212.phpt
  6. +2 −2 Zend/tests/bug37667.phpt
  7. +5 −5 ext/dom/tests/dom003.phpt
  8. +5 −5 ext/dom/tests/dom_set_attr_node.phpt
  9. +42 −30 ext/spl/tests/array_001.phpt
  10. +17 −11 ext/spl/tests/array_002.phpt
  11. +10 −6 ext/spl/tests/array_003.phpt
  12. +1 −1 ext/spl/tests/array_004.phpt
  13. +1 −1 ext/spl/tests/array_006.phpt
  14. +14 −6 ext/spl/tests/array_007.phpt
  15. +1 −1 ext/spl/tests/array_008.phpt
  16. +38 −26 ext/spl/tests/array_015.phpt
  17. +221 −51 ext/spl/tests/array_017.phpt
  18. +8 −2 ext/spl/tests/array_018.phpt
  19. +12 −2 ext/spl/tests/array_022.phpt
  20. +1 −1 ext/spl/tests/bug31185.phpt
  21. +11 −3 ext/spl/tests/bug33136.phpt
  22. +2 −2 ext/spl/tests/bug36258.phpt
  23. +2 −8 ext/spl/tests/bug36287.phpt
  24. +2 −0 ext/spl/tests/bug40872.phpt
  25. +40 −14 ext/spl/tests/bug41692.phpt
  26. +10 −2 ext/spl/tests/bug42364.phpt
  27. +78 −54 ext/spl/tests/bug42654.phpt
  28. +3 −1 ext/spl/tests/dit_001.phpt
  29. +33 −9 ext/spl/tests/fileobject_003.phpt
  30. +1 −1 ext/spl/tests/iterator_006.phpt
  31. +1 −1 ext/spl/tests/iterator_026.phpt
  32. +49 −28 ext/spl/tests/iterator_042.phpt
  33. +2 −2 ext/spl/tests/iterator_047.phpt
  34. +5 −2 ext/spl/tests/iterator_049.phpt
  35. BIN ext/spl/tests/iterator_049b.phpt
  36. +34 −31 ext/spl/tests/iterator_050.phpt
  37. +18 −15 ext/spl/tests/iterator_051.phpt
  38. +23 −20 ext/spl/tests/iterator_052.phpt
  39. +22 −19 ext/spl/tests/iterator_053.phpt
  40. +22 −19 ext/spl/tests/iterator_054.phpt
  41. +18 −15 ext/spl/tests/iterator_055.phpt
  42. +28 −2 ext/spl/tests/observer_004.phpt
  43. +64 −14 ext/spl/tests/observer_005.phpt
  44. +1 −1 ext/spl/tests/spl_003.phpt
  45. +1 −1 ext/spl/tests/spl_004.phpt
  46. +2 −2 ext/spl/tests/spl_autoload_002.phpt
  47. +1 −1 ext/spl/tests/sxe_001.phpt
  48. +1 −1 ext/spl/tests/sxe_002.phpt
  49. +1 −1 ext/spl/tests/sxe_003.phpt
  50. +1 −1 ext/spl/tests/sxe_004.phpt
  51. +1 −1 ext/spl/tests/sxe_005.phpt
  52. +1 −1 ext/standard/tests/array/002.phpt
  53. +1 −1 ext/standard/tests/array/004.phpt
  54. +4 −4 ext/standard/tests/array/005.phpt
  55. +11 −85 ext/standard/tests/array/007.phpt
  56. +40 −219 ext/standard/tests/array/009.phpt
  57. +6 −6 ext/standard/tests/array/array_change_key_case_errors.phpt
  58. +5 −14 ext/standard/tests/array/array_change_key_case_variation.phpt
  59. +0 −1 ext/standard/tests/array/array_count_values.phpt
  60. +2 −3 ext/standard/tests/array/array_fill_basic.phpt
  61. +9 −9 ext/standard/tests/array/array_fill_error.phpt
  62. +39 −39 ext/standard/tests/array/array_fill_object.phpt
  63. +34 −46 ext/standard/tests/array/array_fill_variation1.phpt
  64. +28 −35 ext/standard/tests/array/array_fill_variation2.phpt
  65. +2 −2 ext/standard/tests/array/array_fill_variation3.phpt
  66. +3 −3 ext/standard/tests/array/array_fill_variation4.phpt
  67. +1 −1 ext/standard/tests/array/array_fill_variation5.phpt
  68. +3 −3 ext/standard/tests/array/array_filter.phpt
  69. +3 −3 ext/standard/tests/array/array_filter_error.phpt
  70. +6 −6 ext/standard/tests/array/array_filter_object.phpt
  71. +24 −24 ext/standard/tests/array/array_filter_variation1.phpt
  72. +30 −30 ext/standard/tests/array/array_filter_variation2.phpt
  73. +2 −2 ext/standard/tests/array/array_filter_variation4.phpt
  74. +1 −1 ext/standard/tests/array/array_filter_variation7.phpt
  75. +2 −2 ext/standard/tests/array/array_filter_variation9.phpt
  76. +0 −21 ext/standard/tests/array/array_flip.phpt
  77. +2 −2 ext/standard/tests/array/array_flip_error.phpt
  78. +47 −46 ext/standard/tests/array/array_flip_variation1.phpt
  79. BIN ext/standard/tests/array/array_flip_variation2.phpt
  80. BIN ext/standard/tests/array/array_flip_variation3.phpt
  81. +2 −2 ext/standard/tests/array/array_flip_variation4.phpt
  82. +10 −306 ext/standard/tests/array/array_intersect_1.phpt
  83. +2 −2 ext/standard/tests/array/array_intersect_error.phpt
  84. +1 −1 ext/standard/tests/array/array_intersect_variation9.phpt
  85. +2 −2 ext/standard/tests/array/array_key_exists.phpt
  86. +27 −0 ext/standard/tests/array/array_keys_basic.phpt
  87. +5 −5 ext/standard/tests/array/array_keys_error.phpt
  88. +15 −1 ext/standard/tests/array/array_keys_variation_003.phpt
  89. +13 −18 ext/standard/tests/array/array_map.phpt
  90. +764 −0 ext/standard/tests/array/array_merge.phpt
  91. +4 −4 ext/standard/tests/array/array_pad.phpt
  92. +4 −4 ext/standard/tests/array/array_pop_errors.phpt
  93. +282 −0 ext/standard/tests/array/array_push.phpt
  94. +2 −2 ext/standard/tests/array/array_rand.phpt
  95. +1 −0 ext/standard/tests/array/array_rand_basic1.phpt
  96. +1 −0 ext/standard/tests/array/array_rand_basic2.phpt
  97. +3 −2 ext/standard/tests/array/array_rand_error.phpt
  98. +25 −24 ext/standard/tests/array/array_rand_variation1.phpt
  99. +8 −7 ext/standard/tests/array/array_rand_variation2.phpt
  100. +1 −0 ext/standard/tests/array/array_rand_variation3.phpt
  101. +1 −0 ext/standard/tests/array/array_rand_variation4.phpt
  102. +1 −0 ext/standard/tests/array/array_rand_variation5.phpt
  103. +1 −0 ext/standard/tests/array/array_rand_variation6.phpt
  104. +3 −3 ext/standard/tests/array/array_reverse_error.phpt
  105. +72 −72 ext/standard/tests/array/array_reverse_variation1.phpt
  106. +21 −98 ext/standard/tests/array/array_reverse_variation2.phpt
  107. +3 −3 ext/standard/tests/array/array_search1.phpt
  108. +7 −7 ext/standard/tests/array/array_search_errors.phpt
  109. +1 −1 ext/standard/tests/array/array_search_variation1.phpt
  110. +4 −4 ext/standard/tests/array/array_search_variation3.phpt
  111. +1 −1 ext/standard/tests/array/array_search_variation4.phpt
  112. +1,461 −0 ext/standard/tests/array/array_slice.phpt
  113. +6 −6 ext/standard/tests/array/array_splice_errors.phpt
  114. +1 −1 ext/standard/tests/array/array_splice_variation1.phpt
  115. +2 −2 ext/standard/tests/array/array_splice_variation2.phpt
  116. +1 −1 ext/standard/tests/array/array_splice_variation3.phpt
  117. +1 −1 ext/standard/tests/array/array_splice_variation4.phpt
  118. +1 −1 ext/standard/tests/array/array_unshift_basic1.phpt
  119. +15 −53 ext/standard/tests/array/array_unshift_object.phpt
  120. +1 −1 ext/standard/tests/array/array_unshift_variation7.phpt
  121. +1 −1 ext/standard/tests/array/array_unshift_variation8.phpt
  122. +5 −5 ext/standard/tests/array/array_values_errors.phpt
  123. +5 −3 ext/standard/tests/array/array_walk.phpt
  124. +5 −3 ext/standard/tests/array/array_walk_recursive1.phpt
  125. +1 −1 ext/standard/tests/array/bug14580.phpt
  126. +1 −1 ext/standard/tests/array/bug28739.phpt
  127. +2 −3 ext/standard/tests/array/bug29253.phpt
  128. +1 −2 ext/standard/tests/array/bug33940.phpt
  129. +1 −1 ext/standard/tests/array/bug34982.phpt
  130. +1 −2 ext/standard/tests/array/bug35014.phpt
  131. +1 −2 ext/standard/tests/array/bug35014_64bit.phpt
  132. +1 −0 ext/standard/tests/array/bug35821.phpt
  133. +15 −51 ext/standard/tests/array/compact.phpt
  134. +198 −14 ext/standard/tests/array/count_recursive.phpt
  135. +6 −6 ext/standard/tests/array/end.phpt
  136. +0 −1 ext/standard/tests/array/extract_variation6.phpt
  137. +7 −7 ext/standard/tests/array/in_array_errors.phpt
  138. +4 −4 ext/standard/tests/array/in_array_variation3.phpt
  139. +3 −0 ext/standard/tests/array/locale_sort.phpt
  140. +1 −1 ext/standard/tests/array/max_basic.phpt
  141. +2 −2 ext/standard/tests/array/max_error.phpt
  142. +1 −1 ext/standard/tests/array/max_variation1.phpt
  143. +1 −1 ext/standard/tests/array/max_variation2.phpt
  144. +1 −1 ext/standard/tests/array/min_basic.phpt
  145. +2 −2 ext/standard/tests/array/min_error.phpt
  146. +1 −1 ext/standard/tests/array/min_variation1.phpt
  147. +1 −1 ext/standard/tests/array/min_variation2.phpt
  148. +1 −0 ext/standard/tests/array/shuffle_basic1.phpt
  149. +1 −0 ext/standard/tests/array/shuffle_basic2.phpt
  150. +1 −0 ext/standard/tests/array/shuffle_error.phpt
  151. +3 −1 ext/standard/tests/array/shuffle_variation1.phpt
  152. +1 −0 ext/standard/tests/array/shuffle_variation2.phpt
  153. +2 −1 ext/standard/tests/array/shuffle_variation3.phpt
  154. +2 −1 ext/standard/tests/array/shuffle_variation4.phpt
  155. +1 −0 ext/standard/tests/array/shuffle_variation5.phpt
  156. +4 −6 ext/standard/tests/general_functions/bug40398.phpt
  157. BIN ext/standard/tests/general_functions/debug_zval_dump_b.phpt
  158. BIN ext/standard/tests/general_functions/debug_zval_dump_b_64bit.phpt
  159. +78 −78 ext/standard/tests/general_functions/debug_zval_dump_o.phpt
  160. +82 −82 ext/standard/tests/general_functions/print_r.phpt
Sorry, we could not display the entire diff because it was too big.
View
148 README.PARAMETER_PARSING_API
@@ -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;
+}
+
+
+/* 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);
+}
- return;
+
+/* 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
4 Zend/tests/bug31720.phpt
@@ -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
12 Zend/tests/bug32290.phpt
@@ -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
15 Zend/tests/bug36214.phpt
@@ -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
6 Zend/tests/bug37212.phpt
@@ -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
4 Zend/tests/bug37667.phpt
@@ -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
10 ext/dom/tests/dom003.phpt
@@ -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
10 ext/dom/tests/dom_set_attr_node.phpt
@@ -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
72 ext/spl/tests/array_001.phpt
@@ -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
28 ext/spl/tests/array_002.phpt
@@ -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
16 ext/spl/tests/array_003.phpt
@@ -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
2 ext/spl/tests/array_004.phpt
@@ -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
2 ext/spl/tests/array_006.phpt
@@ -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
20 ext/spl/tests/array_007.phpt
@@ -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
2 ext/spl/tests/array_008.phpt
@@ -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
64 ext/spl/tests/array_015.phpt
@@ -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
272 ext/spl/tests/array_017.phpt
@@ -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
10 ext/spl/tests/array_018.phpt
@@ -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
14 ext/spl/tests/array_022.phpt
@@ -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
2 ext/spl/tests/bug31185.phpt
@@ -52,7 +52,7 @@ FooBar::offsetSet(2, 2)
CAUGHT: FAIL
FooBar Object
(
- [array:private] => Array
+ [array:FooBar:private] => Array
(
[0] => 0
[1] => 1
View
14 ext/spl/tests/bug33136.phpt
@@ -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
4 ext/spl/tests/bug36258.phpt
@@ -13,9 +13,9 @@ foreach ($diriter as $key => $file) {
break;
}
-echo "Done\n";
?>
+===DONE===
--EXPECTF--
string(%d) "%s"
string(%d) "%s"
-Done
+===DONE===
View
10 ext/spl/tests/bug36287.phpt
@@ -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
2 ext/spl/tests/bug40872.phpt
@@ -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
54 ext/spl/tests/bug41692.phpt
@@ -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
12 ext/spl/tests/bug42364.phpt
@@ -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
132 ext/spl/tests/bug42654.phpt
@@ -23,10 +23,47 @@ var_dump($copy);
?>
--EXPECTF--
update 1
-object(RecursiveArrayIterator)#%d (3) {
- [1]=>
- string(4) "val1"
- [2]=>
+object(RecursiveArrayIterator)#%d (1) {
+ ["storage":"ArrayIterator":private]=>
+ array(3) {
+ [1]=>
+ string(4) "val1"
+ [2]=>
+ array(2) {
+ [2]=>
+ string(4) "val2"
+ [3]=>
+ array(1) {
+ [3]=>
+ string(4) "val3"
+ }
+ }
+ [4]=>
+ string(4) "val4"
+ }
+}
+object(RecursiveArrayIterator)#%d (1) {
+ ["storage":"ArrayIterator":private]=>
+ array(3) {
+ [1]=>
+ string(5) "alter"
+ [2]=>
+ array(2) {
+ [2]=>
+ string(4) "val2"
+ [3]=>
+ array(1) {
+ [3]=>
+ string(4) "val3"
+ }
+ }
+ [4]=>
+ string(4) "val4"
+ }
+}
+update 2
+object(RecursiveArrayIterator)#%d (1) {
+ ["storage":"ArrayIterator":private]=>
array(2) {
[2]=>
string(4) "val2"
@@ -36,85 +73,72 @@ object(RecursiveArrayIterator)#%d (3) {
string(4) "val3"
}
}
- [4]=>
- string(4) "val4"
}
-object(RecursiveArrayIterator)#%d (3) {
- [1]=>
- string(5) "alter"
- [2]=>
+object(RecursiveArrayIterator)#%d (1) {
+ ["storage":"ArrayIterator":private]=>
array(2) {
[2]=>
- string(4) "val2"
+ string(5) "alter"
[3]=>
array(1) {
[3]=>
string(4) "val3"
}
}
- [4]=>
- string(4) "val4"
}
-update 2
-object(RecursiveArrayIterator)#%d (2) {
- [2]=>
- string(4) "val2"
- [3]=>
+update 3
+object(RecursiveArrayIterator)#%d (1) {
+ ["storage":"ArrayIterator":private]=>
array(1) {
[3]=>
string(4) "val3"
}
}
-object(RecursiveArrayIterator)#%d (2) {
- [2]=>
- string(5) "alter"
- [3]=>
+object(RecursiveArrayIterator)#%d (1) {
+ ["storage":"ArrayIterator":private]=>
array(1) {
[3]=>
- string(4) "val3"
+ string(5) "alter"
}
}
-update 3
-object(RecursiveArrayIterator)#%d (1) {
- [3]=>
- string(4) "val3"
-}
-object(RecursiveArrayIterator)#%d (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
4 ext/spl/tests/dit_001.phpt
@@ -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
42 ext/spl/tests/fileobject_003.phpt
@@ -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
2 ext/spl/tests/iterator_006.phpt
@@ -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
2 ext/spl/tests/iterator_026.phpt
@@ -20,7 +20,7 @@ foreach($it as $k=>$v)
?>
===DONE===
<?php exit(0); ?>
---EXPECT--
+--EXPECTF--
0=>1
hasNext: yes
1=>2
View
77 ext/spl/tests/iterator_042.phpt
@@ -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) {
- [0]=>
- int(1)
- }
- [1]=>
- object(ArrayIterator)#%d (2) {
- [0]=>
- int(21)
- [1]=>
- int(22)
- }
- [2]=>
- object(ArrayIterator)#5 (3) {
+object(ArrayIterator)#%d (1) {
+ %s"storage"%s"ArrayIterator":private]=>
+ array(3) {
[0]=>
- int(31)
+ object(ArrayIterator)#%d (1) {
+ %s"storage"%s"ArrayIterator":private]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+ }
[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
4 ext/spl/tests/iterator_047.phpt
@@ -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
7 ext/spl/tests/iterator_049.phpt
@@ -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) {
[""]=>
View
BIN ext/spl/tests/iterator_049b.phpt
Binary file not shown.
View
65 ext/spl/tests/iterator_050.phpt
@@ -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
33 ext/spl/tests/iterator_051.phpt
@@ -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
43 ext/spl/tests/iterator_052.phpt
@@ -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) {
- }
- [6]=>
- %s(6) "FooBar"
- [7]=>
- %s(1) ","
- [8]=>
- %s(2) ",,"
+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) ",,"
+ }
}
===DONE===
View
41 ext/spl/tests/iterator_053.phpt
@@ -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
41 ext/spl/tests/iterator_054.phpt
@@ -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]=>