<?php
class foo {
function foo() {
// implements some logic
}
function name() {
echo "My name is " , get_class($this) , "\n";
}
}
// create an object
$bar = new foo();
// external call
echo "Its name is " , get_class($bar) , "\n";
// internal call
$bar_>name();
?> |