PHP

PHP

PHP is a powerful server side programming language that today runs a large portion of the web.  It has evolved over time into a full-fledged Object Oriented Programming language.  Objects allow creation of smaller reusable pieces of code that are far more efficient than procedural style coding.  It will run on virtually any computer and is offered by many hosting providers in some sort of easy to use package often what is called the LAMP stack.  LAMP is an acronym for Linux, Apache, MySQL, PHP.

Learn some PHP basics

This is a very simple class called ball which has a variable of its own called type. Type is declared to be public so this means that other pieces of PHP code will be able to see it.  The function __construct is a standard part of a php object/class and it is used when the object is instantiated (created).  In this case the type of the ball will be passed into the constructor and then it is set as the ball’s type variable.

class ball {
public $type;
function __construct($type) {
$this->type = $type;
}
}