Skip to content
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

With? #7

Open
MZAWeb opened this issue Apr 9, 2015 · 2 comments
Open

With? #7

MZAWeb opened this issue Apr 9, 2015 · 2 comments

Comments

@MZAWeb
Copy link

MZAWeb commented Apr 9, 2015

I'm really curious. What's the intended use case for public function with($value) ?

@mcallan83
Copy link

I believe it allows you to pass an object to it and then chain a method call on it in a single line.

class Foo
{
    public function bar() {
        echo "Hello World";
    }
}


with(new Foo())->bar();

@MZAWeb
Copy link
Author

MZAWeb commented Apr 10, 2015

But (new Foo())->bar() is valid since PHP 5.4

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

No branches or pull requests

2 participants