Vebers Posted December 21, 2005 Report Share Posted December 21, 2005 Izmantoju šādu kodu (autors: des) <? class HelloWorld { var $message; //konstruktors function HelloWorld(){ $this->message='Hello World!'; } function say(){ echo $this->message; } } $hw=new HelloWorld(); $hw->say(); //rezultaads buus "Hello World!" browzerii :) ?> Bet kad palaižu viņu man nekas netiek izvadīts.. kāpēc tā? P.S. tikko sāku mācīties k-ko par OOP Link to comment Share on other sites More sharing options...
v3rb0 Posted December 21, 2005 Report Share Posted December 21, 2005 izskatās ka tur vis pareizi, vaina kaut kur citur - php izpildās vispār? Link to comment Share on other sites More sharing options...
Vebers Posted December 21, 2005 Author Report Share Posted December 21, 2005 njā. bija php.ini vainīgs short_open_tag = Off Link to comment Share on other sites More sharing options...
[Ya] Posted December 21, 2005 Report Share Posted December 21, 2005 ja tev ir PHP 5, tad Contruct funkcija saucas __construct() bet 4ajaa PHP vajadzeeja straadaat Link to comment Share on other sites More sharing options...
hmnc Posted December 21, 2005 Report Share Posted December 21, 2005 YA - tu pats saprati, ko uzrakstīji?! :D Link to comment Share on other sites More sharing options...
[Ya] Posted December 21, 2005 Report Share Posted December 21, 2005 YA - tu pats saprati, ko uzrakstīji?! :D protams! Link to comment Share on other sites More sharing options...
bubu Posted December 21, 2005 Report Share Posted December 21, 2005 php5 atļauj arī php4 veida konstruktorus. Link to comment Share on other sites More sharing options...
[Ya] Posted December 21, 2005 Report Share Posted December 21, 2005 php5 atļauj arī php4 veida konstruktorus. hmm, to gan nezināju, bet nu tagad vismaz zināšu ;) Link to comment Share on other sites More sharing options...
Recommended Posts