Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

Trying to access array offset on value of type bool on Response destruction #32

@syl20b

Description

@syl20b

Hello,

I'm using the HTTP (v1.17.01.13) component through the Websocket library (v3.17.01.09), and I've got an issue when the \Hoa\Http\Response\Response::__destruct() method is called :

Trying to access array offset on value of type bool in /XXX/hoa/http/Response/Response.php on line 947

It seems to be because the response is initialized with the parameter $newBuffer = false, and the self::$_stack is empty.

This is the line the error occurred in the __destruct method :

$last = current(self::$_stack);

Change the line above with this seems to fix the bug:

if (false === $last = current(self::$_stack)) {
    return;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions