Created
December 14, 2014 02:40
-
-
Save hikari-no-yume/613b8ec4c629b945f92f to your computer and use it in GitHub Desktop.
stringable (used for the sake of example in demonstrating casts in PHP)
This file contains 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 Stringable { | |
public $string; | |
public function __construct($string) { | |
$this->string = $string; | |
} | |
public function __toString() { | |
return $this->string; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment