Skip to content

Commit

Permalink
Merge branch 'PHP-7.0' of https://github.com/php/php-src into PHP-7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Apr 18, 2016
2 parents 6bb81d2 + 8f35ee4 commit b08bde1
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 9 deletions.
36 changes: 36 additions & 0 deletions Zend/tests/arg_unpack/by_ref_separation.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--TEST--
Array must be separated if unpacking by reference
--FILE--
<?php

function inc(&... $args) {
foreach ($args as &$arg) {
$arg++;
}
}

$arr = [1, 2];
$arr[] = 3;
$arr2 = $arr;
inc(...$arr);
var_dump($arr);
var_dump($arr2);

?>
--EXPECT--
array(3) {
[0]=>
int(2)
[1]=>
int(3)
[2]=>
int(4)
}
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
6 changes: 3 additions & 3 deletions Zend/zend_vm_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -4422,7 +4422,7 @@ ZEND_VM_C_LABEL(send_again):

zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));

if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_REFCOUNT_P(args) > 1) {
uint32_t i;
int separate = 0;

Expand All @@ -4434,7 +4434,7 @@ ZEND_VM_C_LABEL(send_again):
}
}
if (separate) {
zval_copy_ctor(args);
SEPARATE_ARRAY(args);
ht = Z_ARRVAL_P(args);
}
}
Expand All @@ -4448,7 +4448,7 @@ ZEND_VM_C_LABEL(send_again):

top = ZEND_CALL_ARG(EX(call), arg_num);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
if (!Z_IMMUTABLE_P(args)) {
if (Z_REFCOUNT_P(args) == 1) {
ZVAL_MAKE_REF(arg);
Z_ADDREF_P(arg);
ZVAL_REF(top, Z_REF_P(arg));
Expand Down
6 changes: 3 additions & 3 deletions Zend/zend_vm_execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_

zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, zend_hash_num_elements(ht));

if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) {
if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_REFCOUNT_P(args) > 1) {
uint32_t i;
int separate = 0;

Expand All @@ -966,7 +966,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_
}
}
if (separate) {
zval_copy_ctor(args);
SEPARATE_ARRAY(args);
ht = Z_ARRVAL_P(args);
}
}
Expand All @@ -980,7 +980,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_

top = ZEND_CALL_ARG(EX(call), arg_num);
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
if (!Z_IMMUTABLE_P(args)) {
if (Z_REFCOUNT_P(args) == 1) {
ZVAL_MAKE_REF(arg);
Z_ADDREF_P(arg);
ZVAL_REF(top, Z_REF_P(arg));
Expand Down
6 changes: 3 additions & 3 deletions ext/oci8/tests/driver_name.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ function get_attr($conn)
?>
--EXPECT--
**Test 1.1 - Default values for the attribute **************
The value of DRIVER_NAME is PHP OCI8 : 2.1.0
The value of DRIVER_NAME is PHP OCI8 : 2.1.1

***Test 1.2 - Get the values from different connections **************
Testing with oci_pconnect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.0
The value of DRIVER_NAME is PHP OCI8 : 2.1.1
Testing with oci_new_connect()
The value of DRIVER_NAME is PHP OCI8 : 2.1.0
The value of DRIVER_NAME is PHP OCI8 : 2.1.1
Done
6 changes: 6 additions & 0 deletions sapi/fpm/tests/010.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
FPM: Test status page
--SKIPIF--
<?php include "skipif.inc"; ?>
--XFAIL--
randomly intermittently failing all the time in CI, with diff:
017+ active processes: 0
018+ total processes: 1
017- active processes: 1
018- total processes: 2
--FILE--
<?php

Expand Down

0 comments on commit b08bde1

Please sign in to comment.