Skip to content

Remove reset to avoid passing by reference#18

Merged
clue merged 1 commit intoclue:masterfrom
masakielastic:master
Oct 28, 2014
Merged

Remove reset to avoid passing by reference#18
clue merged 1 commit intoclue:masterfrom
masakielastic:master

Conversation

@masakielastic
Copy link
Copy Markdown
Contributor

I got the following warning when running examples/google.php.

PHP Strict Standards:  Only variables should be passed by reference 
in /Users/masakielastic/test/php-buzz-react/src/Message/Headers.php on line 39

I confirmed the bahavior of reset.

function test()
{
    return array('a', 'b', 'c');
}

var_dump(
    reset(test()),
    array_shift(test())
);

http://3v4l.org/CZi6i

@clue clue merged commit 593f618 into clue:master Oct 28, 2014
@clue
Copy link
Copy Markdown
Owner

clue commented Oct 28, 2014

Awesome, thanks for spotting and providing the scripts to reproduce this! 👍

Interestingly, this wasn't reported by PHPUnit initially, despite using the convertNoticesToExceptions="true" configuration.

I've raised the default error reporting in tests/bootstrap.php and updated the test suite to cover this in the future (fdc9f31).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants