Skip to content

Call to a member function isWritable on resource: possible bug. #3

@samuraya

Description

@samuraya

Hi @dbierer ! I am currently studying your book which I very much enjoy and find it highly practical.
One piece of code I ran into recently makes me raise this issue. In particular, isWritable method from Stream class. This is an implementation of PSR StreamInterface.

The function is trying to call isWritable method from a resource which doesn't have such method in it.
Here is the extract from the book (page 548, green book):

public function isWritable() { return $this->stream->isWritable(); }

as a result it throws an error. Instead of stream resource the method should be calling isWritable from SplFileInfo object , shouldn't it?
Thanks for the cool learning resources and looking forward to hearing from you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions