Instantiates a new object.
The new operator makes a new instance of a class. An instance of a class is called an object.
<?php
class MyClass
{
var $s = "Hello World";
function getProperty() {
return $this->s;
}
}
$a = new MyClass;
$a->s = "Have a nice day";
print $a->getProperty();
?> Have a nice day An object is instantiated with the new operator.