Forum und email

物件

建立物件

用 NEW 指令可以把變數指定為某一物件。

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

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

For a full discussion, please read the section Classes and Objects.