--- /dev/null
+--TEST--
+Bug #35393 (changing static protected members from outside the class)
+--INI--
+error_reporting=4095
+--FILE--
+<?php
+class ObjectPath
+{
+ static protected $type = array(0=>'main');
+
+ static function getType()
+ {
+ return self::$type;
+ }
+}
+print_r(ObjectPath::getType());
+$object_type = array_pop((ObjectPath::getType()));
+print_r(ObjectPath::getType());
+?>
+--EXPECTF--
+Array
+(
+ [0] => main
+)
+
+Strict Standards: Only variables should be passed by reference in %sbug35393.php on line 12
+Array
+(
+ [0] => main
+)
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) {
+ (PZVAL_IS_REF(varptr) ||
+ (varptr->refcount == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
zend_ptr_stack_push(&EG(argument_stack), varptr);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) {
+ (PZVAL_IS_REF(varptr) ||
+ (varptr->refcount == 1 && (IS_VAR == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
zend_ptr_stack_push(&EG(argument_stack), varptr);
static int ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+ zend_free_op free_op1;
zval *varptr;
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) {
+ (PZVAL_IS_REF(varptr) ||
+ (varptr->refcount == 1 && (IS_CV == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
zend_ptr_stack_push(&EG(argument_stack), varptr);
break;
}
$read_fds = array($pipes[1]);
- $retval = stream_select($read_fds, $write_fds = NULL, $exp_fds = NULL, 1);
+ $write_fds = NULL;
+ $exp_fds = NULL;
+ $retval = stream_select($read_fds, $write_fds, $exp_fds, 1);
if ($retval === false) {
print "select() failed\n";
break;