Jump to content

Code not running when comes to class or function


dennislee85

Recommended Posts

Hi all,

 

I am new to php. Currently i have tried some simple coding. I tried to code some simple class and function in php. Yet it does not running. Those print statement before the class coding are shown.

I am using Apache2Triad1.4.4, supporting php 4.4.2, php API version 20020903.

Below is my sample codes, Please advise.

 

<?php

 

class Dog{

 

function Dog(){

 

print "Constructor invoked";

 

}

 

function _bark(){

 

print "Woof!";

}

 

 

}

 

$doggy = new Dog;

$doggy->_bark();

 

?>

 

 

Thanks alot

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.