8000 [WIP] Update .travis.yml for PHP 7 by cebe · Pull Request #45 · reactphp/event-loop · GitHub
[go: up one dir, main page]

Skip to content

[WIP] Update .travis.yml for PHP 7 #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix for PHP 7 fatal error on duplicate parameter names in closures
  • Loading branch information
ondrejmirtes authored and cebe committed Mar 4, 2016
commit 913f1507a9c448a320bd60dc5a1da5bd71ff3e8d
2 changes: 1 addition & 1 deletion src/ExtEventLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private function unsubscribeStreamEvent($stream, $flag)
*/
private function createTimerCallback()
{
$this->timerCallback = function ($_, $_, $timer) {
$this->timerCallback = function ($_, $__, $timer) {
call_user_func($timer->getCallback(), $timer);

if (!$timer->isPeriodic() && $this->isTimerActive($timer)) {
Expand Down
2 changes: 1 addition & 1 deletion src/LibEventLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private function unsubscribeStreamEvent($stream, $flag)
*/
private function createTimerCallback()
{
$this->timerCallback = function ($_, $_, $timer) {
$this->timerCallback = function ($_, $__, $timer) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see why we would want this change, but for the reference only: Afaict this line is currently untested because the libevent extension does not (currently) compile under PHP 7, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, right. The code crashes because of this line when you try to include
this class. That's something that static analysis tools can stumble upon.

So this fixes that. But there's not actually a way to run this
implementation on PHP 7.

On Tuesday, 1 March 2016, Christian Lück notifications@github.com wrote:

In src/LibEventLoop.php
#45 (comment):

@@ -298,7 +298,7 @@ private function unsubscribeStreamEvent($stream, $flag)
*/
private function createTimerCallback()
{

  •    $this->timerCallback = function ($_, $_, $timer) {
    
  •    $this->timerCallback = function ($_, $__, $timer) {
    

I see why we would want this change, but for the reference only: Afaict
this line is currently untested because the libevent extension does not
compile under PHP 7, right?


Reply to this email directly or view it on GitHub
https://github.com/reactphp/event-loop/pull/45/files#r54551382.

Ondřej Mirtes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the confirmation, your reasoning makes perfect sense 👍

call_user_func($timer->getCallback(), $timer);

// Timer already cancelled ...
Expand Down
0