- Fixed bug with $HTTP_RAW_POST_DATA not getting set. (Brian)
- Fixed bug in mysql::client_version(). (Georg)
- Fixed ZTS destruction. (Marcus)
+- Fixed bug #32993 (implemented Iterator function current() don't throw
+ exception). (Dmitry)
- Fixed bug #32924 (file included with "auto_prepend_file" can be included
with require_once() or include_once()). (Stas)
- Fixed bug #32833 (Invalid opcode). (Dmitry)
--- /dev/null
+--TEST--
+Bug #32993 (implemented Iterator function current() don't throw exception)
+--FILE--
+<?php
+class Test implements Iterator {
+
+ public $arr = array();
+
+ public function rewind() { return reset($this->arr); }
+ public function current() { throw new Exception(); }
+ public function key() { return key($this->arr); }
+ public function next() { return next($this->arr); }
+ public function valid() { return (current($this->arr) !== false); }
+}
+
+$t = new Test();
+$t->arr = array(1, 2, 3);
+
+try {
+ foreach ($t as $v) {
+ echo "$v\n";
+ }
+} catch (Exception $e) {
+ ; // handle exception
+}
+echo "ok\n";
+?>
+--EXPECT--
+ok
ZEND_VM_CONTINUE_JMP();
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
+ if (EG(exception)) {
+ array->refcount--;
+ zval_ptr_dtor(&array);
+ ZEND_VM_NEXT_OPCODE();
+ }
if (!value) {
/* failure in get_current_data */
- if (EG(exception)) {
- array->refcount--;
- zval_ptr_dtor(&array);
- ZEND_VM_NEXT_OPCODE();
- }
ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num);
ZEND_VM_CONTINUE_JMP();
}
ZEND_VM_CONTINUE_JMP();
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
+ if (EG(exception)) {
+ array->refcount--;
+ zval_ptr_dtor(&array);
+ ZEND_VM_NEXT_OPCODE();
+ }
if (!value) {
/* failure in get_current_data */
- if (EG(exception)) {
- array->refcount--;
- zval_ptr_dtor(&array);
- ZEND_VM_NEXT_OPCODE();
- }
ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num);
ZEND_VM_CONTINUE_JMP();
}
ZEND_VM_CONTINUE_JMP();
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
+ if (EG(exception)) {
+ array->refcount--;
+ zval_ptr_dtor(&array);
+ ZEND_VM_NEXT_OPCODE();
+ }
if (!value) {
/* failure in get_current_data */
- if (EG(exception)) {
- array->refcount--;
- zval_ptr_dtor(&array);
- ZEND_VM_NEXT_OPCODE();
- }
ZEND_VM_SET_OPCODE(EX(op_array)->opcodes+opline->op2.u.opline_num);
ZEND_VM_CONTINUE_JMP();
}