Okay, I'm a relative newcomer to object-oriented PHP, but no stranger to OOP
in general. I've spent the last three hours trying to figure out why this
code snipped doesn't do what I expect it to:
---snip---
<?php
$myTest = new Test;
echo $myTest->GetClassName ; // Nada
class Test
{
// Class constructor
function Test()
{
// Empty on purpose...
}
// Returns class name
function GetClassName()
{
return "Test";
}
}
?>
---snip---
I would expect the "echo ..." line to display "Test", but it doesn't. I
swear I must be missing something really simple and really stupid, but I
can't find it for the life of me. Little help? Oh, PHP Version 4.3.4 if it
makes a difference.
Thanks in advance,
'Mutt
in general. I've spent the last three hours trying to figure out why this
code snipped doesn't do what I expect it to:
---snip---
<?php
$myTest = new Test;
echo $myTest->GetClassName ; // Nada
class Test
{
// Class constructor
function Test()
{
// Empty on purpose...
}
// Returns class name
function GetClassName()
{
return "Test";
}
}
?>
---snip---
I would expect the "echo ..." line to display "Test", but it doesn't. I
swear I must be missing something really simple and really stupid, but I
can't find it for the life of me. Little help? Oh, PHP Version 4.3.4 if it
makes a difference.
Thanks in advance,
'Mutt
Comment