object: Object Initialization

Object Initialization

<?php
class foo
{
    function do_foo()
    {
        echo "Doing foo."; 
    }
}

$bar = new foo;
$bar->do_foo();
?>

To create a new object, use the new statement to instantiate a class.

Related concepts

Object Initialization

object: Object Initialization — Structure map

Clickable & Draggable!

object: Object Initialization — Related pages: