Skip to content

Instantly share code, notes, and snippets.

@pantaovay
Created December 10, 2013 18:12
Show Gist options
  • Select an option

  • Save pantaovay/7895231 to your computer and use it in GitHub Desktop.

Select an option

Save pantaovay/7895231 to your computer and use it in GitHub Desktop.
<?php
class fakeString
{
private $str;
function __construct()
{
$this->str = "";
}
function addA()
{
$this->str .= "a";
return $this;
}
function addB()
{
$this->str .= "b";
return $this;
}
function getStr()
{
return $this->str;
}
}
$a = new fakeString();
echo $a->addA()->addB()->getStr();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment