You are here: Class public function « PHP Programming Language « IT news, forums, messages
Class public function

Posted by Marcel on 12/07/05 10:51

I am running PHP version 4.3.11-dev:

The class as defined below does not work:

<?php

class hello {
public function printHello() {
echo "HELLO";
}
}

$obj = new hello;

$obj->printHello(); // does NOT print hello

?>

When i delete the 'public' keyword then the above works ok!

Is it maybe because 4.3.11-dev probably does not fully support classes?

Marcel

 

Navigation:

[Reply to this 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

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