New to PHP, need helps on Class and Function
Posted: Mon Mar 12, 2007 9:41 pm
Hi all,
I am new to PHP, i tried some simple codes on the class and function. But it is not running, those print statements before a class or function (or codes to invoke a class or function) are working well. I am using Apache2Triad1.4.4 on my standalone pc, supporting PHP4.4.2, PHP api = 20020903. Below is my simple codes, pls advise, thanks.
*** PLEASE USE PHP TAG FOR CODE BLOCKS ***
I am new to PHP, i tried some simple codes on the class and function. But it is not running, those print statements before a class or function (or codes to invoke a class or function) are working well. I am using Apache2Triad1.4.4 on my standalone pc, supporting PHP4.4.2, PHP api = 20020903. Below is my simple codes, pls advise, thanks.
*** PLEASE USE PHP TAG FOR CODE BLOCKS ***
Code: Select all
<?php
class Dog{
function Dog(){
print "Constructor invoked";
}
function _bark(){
print "Woof!";
}
}
$doggy = new Dog;
$doggy->_bark();
?>