When I use $f = new foo; I can print "bar" in my calling script.
However, I cannot create other functions or methods inside my class, i.e. when I move function hworld from the commented section to the class declaration, "bar" will not print in the calling script, and neither will anything else from the $f = new foo; statement.
My other scripts have multiple functions, no problem. The trouble is when I try more than one method in a class. So far I can't create very useful classes, or even duplicate some of the simple examples I've seen online.
My ISP is running 4.0.4pl1 on a Linux system.
I've searched books, forums, manual, tutorials, etc. Have I gone blind? Help would be GREATLY appreciated. Thanks in advance.
Roy
<?php
class foo {
var $fb;
function foo() {
$this->fb = "bar";
echo ($this->fb);
}
}
/
function hworld() {
$n = "hello world";
echo ($n);
}
/
?>