[ create a new paste ] login | about

Link: http://codepad.org/N4ipew0H    [ raw code | output | fork ]

PHP, pasted on Jan 11:
<?php
class islemler
			{
				public $sayi1 = 20;
				public $sayi2 = 50;
				public $sonuc = 0;
				
				public function topla()
				{
					return $this->sayi1 + $this->sayi2;
				}
				public function fark($a)
				{
					 $this->sonuc -= $a;
					return $this;
				}
				public function carp($a)
				{
					 $this->sonuc *= $a;
					return $this;
				}
				public function son()
				{
					return $this->sonuc;
				}
				
				public function toplam($a)
				{
					if($a>=0)
						return $a + toplam($a-1);
					else
						return 0;
				}
			}
			
			$islem = new islemler();
			echo $islem->fark(5)->son();
			
			//echo $islem -> topla() + 100;
?>


Output:
1
-5


Create a new paste based on this one


Comments: