Created
March 16, 2014 02:38
-
-
Save trq/9577779 to your computer and use it in GitHub Desktop.
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 Foo | |
{ | |
public $bar = 'bob'; | |
} | |
class Whatever | |
{ | |
public function __construct(Foo $foo) | |
{ | |
$foo->bar = 'boo'; | |
} | |
} | |
$f = new Foo; | |
$w = new Whatever($f); | |
// echo "boo" as expected. | |
echo $f->bar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment