Skip to content

Instantly share code, notes, and snippets.

@trq
Created March 16, 2014 02:38
Show Gist options
  • Save trq/9577779 to your computer and use it in GitHub Desktop.
Save trq/9577779 to your computer and use it in GitHub Desktop.
<?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