mirror of
https://github.com/php/php-src.git
synced 2026-04-03 22:22:18 +02:00
Merge branch 'master' of https://github.com/php/php-src
This commit is contained in:
17
Zend/tests/generators/yield_from_iterator_agregate.phpt
Normal file
17
Zend/tests/generators/yield_from_iterator_agregate.phpt
Normal file
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
yield from with an IteratorAggregate
|
||||
--FILE--
|
||||
<?php
|
||||
class foo implements \IteratorAggregate {
|
||||
public $prop = 1;
|
||||
function getIterator() {
|
||||
var_dump($this->prop);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
(function(){
|
||||
yield from new foo;
|
||||
})()->next();
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
@@ -334,8 +334,9 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
|
||||
|
||||
object_init_ex(return_value, zend_ce_generator);
|
||||
|
||||
if (ZEND_CALL_INFO(call) & ZEND_CALL_RELEASE_THIS) {
|
||||
Z_ADDREF(call->This);
|
||||
if (Z_TYPE(EX(This)) == IS_OBJECT && !(EX_CALL_INFO() & ZEND_CALL_CLOSURE)) {
|
||||
ZEND_ADD_CALL_FLAG(execute_data, ZEND_CALL_RELEASE_THIS);
|
||||
Z_ADDREF(EX(This));
|
||||
}
|
||||
|
||||
/* Save execution context in generator object. */
|
||||
|
||||
@@ -3443,6 +3443,10 @@ PHP_FUNCTION(mb_list_encodings)
|
||||
const mbfl_encoding *encoding;
|
||||
int i;
|
||||
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
i = 0;
|
||||
encodings = mbfl_get_supported_encodings();
|
||||
|
||||
@@ -1028,7 +1028,7 @@ MYSQLND_METHOD(mysqlnd_stmt, use_result)(MYSQLND_STMT * s)
|
||||
|
||||
/* {{{ mysqlnd_fetch_row_cursor */
|
||||
enum_func_status
|
||||
mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, unsigned int flags, zend_bool * fetched_anything)
|
||||
mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, void * param, const unsigned int flags, zend_bool * fetched_anything)
|
||||
{
|
||||
enum_func_status ret;
|
||||
MYSQLND_STMT * s = (MYSQLND_STMT *) param;
|
||||
|
||||
@@ -1475,7 +1475,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result,
|
||||
} else if (flags & MYSQLND_STORE_COPY) {
|
||||
MYSQLND_RES_BUFFERED_C * set = (MYSQLND_RES_BUFFERED_C *) result->stored_data;
|
||||
set->current_row = 0;
|
||||
set->initialized = mnd_pecalloc((set->row_count / 8) + 1, sizeof(zend_uchar), set->persistent); /* +1 for safety */
|
||||
set->initialized = mnd_pecalloc((unsigned int) ((set->row_count / 8) + 1), sizeof(zend_uchar), set->persistent); /* +1 for safety */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ typedef struct st_mysqlnd_packet_sha256_pk_request_response {
|
||||
|
||||
|
||||
zend_ulong php_mysqlnd_net_field_length(const zend_uchar **packet);
|
||||
zend_uchar * php_mysqlnd_net_store_length(zend_uchar *packet, uint64_t length);
|
||||
zend_uchar * php_mysqlnd_net_store_length(zend_uchar *packet, const uint64_t length);
|
||||
size_t php_mysqlnd_net_store_length_size(uint64_t length);
|
||||
|
||||
PHPAPI const extern char * const mysqlnd_empty_string;
|
||||
|
||||
Reference in New Issue
Block a user