--- /dev/null
+--TEST--
+Yield from non-iterable
+--FILE--
+<?php
+
+function gen() {
+ yield from new stdClass;
+}
+
+try {
+ gen()->current();
+} catch (Error $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+--EXPECT--
+Can use "yield from" only with arrays and Traversables
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
+
UNDEF_RESULT();
HANDLE_EXCEPTION();
}
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
+ zval_ptr_dtor_nogc(free_op1);
UNDEF_RESULT();
HANDLE_EXCEPTION();
}
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
+ zval_ptr_dtor_nogc(free_op1);
UNDEF_RESULT();
HANDLE_EXCEPTION();
}
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
+
UNDEF_RESULT();
HANDLE_EXCEPTION();
}