Reply to OOP Newbie - why does this not work?

Your name:

Reply:


Posted by Bob Hartung on 10/21/05 05:35

Hi all,
I'm trying to get started in OOP with PHP. I have the following
short code snipped. I'f I comment out the 'class Test' definition and
the following references to it, it prints
This is outside the php code block

and

Start defining the class here:

If I do not comment out the code as noted, then the page returned is
totally blank. It does this with or without using the constructor.
PHP 5 on apache. Same behavior both on Win32 and FC4.

All help appreciated to get me going.

Code Snippet:

<html>

<head>
<title>PHP Class testing</title>

</head>
<body>
<br>
<P>This is outside the php code block</P>
<br>
<?php
echo "Start defining the class here: <BR>" ;
/* class Test
{

function __constructor()
{
var $saying ;
$saying = "Im in the Test Class" ;
}

function get()
{
return $saying ;

}

var $liveclass ;
$liveclass = new Test ;
echo $liveclass->get() ;
echo "<BR>" ;
echo "This is in the php code block" ;
*/
?>

</body>
</html>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация