All pastes #479891 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-09 23:18 UTC
rendered paste body
<?php
class Blah
{
	
	public function __construct()
	{
		$this->sum = 0;
	}
	
	public function one()
	{
		$a = 5;
		$this->sum = $this->sum + $a;
		return $this;
	}
	
	public function two()
	{
		$a = 6;
		$this->sum = $this->sum + $a;
		return $this;
	}
	
	public function display()
	{
		print $this->sum;
	}
	
}

$blah = new Blah();

$blah->one()->two()->one()->two()->one()->display();