Created
March 16, 2017 19:58
-
-
Save jens1o/97ba11844cfc7f3c004f1da8232ee84b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Example { | |
public $cool = false; | |
public function setCoolness() { | |
$this->cool = true; | |
return $this; | |
} | |
} | |
function test(Example $example = null) { | |
$e = $example ?: new Example(); | |
var_dump($e); | |
} | |
// test((new Example())->setCoolness()); | |
test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment