All pastes #903399 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-14 07:25 UTC
rendered paste body
<?php 
	Class stufftoy
	{
		var $name;
		var $color;
		var $size;
		
		public function setName($name)
		{
			$this->name = $name;
		}
		
		public function getName()
		{
			return $this->name;
		}
		
		public function setColor($color)
		{
			$this->color = $color;
		}
		
		public function getColor()
		{
			return $this->color;
		}
		
		public function setSize($size)
		{
			$this->size = $size;
		}
		
		public function getSize()
		{
			return $this->size;
		}
	}
	
	/**
	You can call Class stufftoy and use it as follow
	**/
	
	$myStufftoy = new stufftoy();
	$myStufftoy->setName('pong-pagong');
	$myStufftoy->setSize('huge');
	$myStufftoy->setColor('green');
	
	/**
	we can get info about my stuff toy
	**/
	
	// my stuffstoy's name is 'pong-pagong'
	print $myStufftoy->getName();
	// my stufftoy's color is 'green'
	print $myStufftoy->getColor();
	// my stufftoy is 'huge'
	print $myStufftoy->getSize();
?>