Page 1 of 1

New to PHP, need helps on Class and Function

Posted: Mon Mar 12, 2007 9:41 pm
by dennislee85
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 ***

Code: Select all

<?php

	class Dog{

		function Dog(){

			print "Constructor invoked";
			
		}
		
		function _bark(){

			print "Woof!";
		}


	}

	$doggy = new Dog;
	$doggy->_bark();

	?>

Posted: Mon Mar 12, 2007 10:53 pm
by Christopher
It is not clear from your post what is not running and what is working well. Perhaps you could post the output.