PHP » Operators » new

Syntax:
new Class
Class
Class of the object to create.

Instantiates a new object.

The new operator makes a new instance of a class. An instance of a class is called an object.

Examples

Code:
<?php

class MyClass
{
   var $s = "Hello World";

    function getProperty() {
        return $this->s;
    }
}

$a = new MyClass;

$a->s = "Have a nice day";
print $a->getProperty();

?>
Output:
Have a nice day
Explanation:

An object is instantiated with the new operator.