Last active
May 25, 2016 17:26
-
-
Save manchuck/79fa18f05d03767805063ff211b00276 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 Foo { | |
private $bar = 'chuck'; | |
public function __construct($name = 'max') | |
{ | |
$this->bar = $name; | |
} | |
public function __toString() | |
{ | |
return $this->bar; | |
} | |
} | |
$test = new Foo; | |
echo $test; | |
$test = new Foo('adam'); | |
echo $test; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment