Object Oriented PHP doesn't work?
Posted by: Mygly (---.dsl.sfldmi.ameritech.net)
Date: May 31, 2006 04:14PM

Hey everyone. I'm not sure if it is a problem i'm having getting OOP to work or if WAMP just doesn't work with it but everytime I try to execute Object Oriented PHP in WAMP it doesn't work and random parts of the script seem to be printed to the screen like "->$object = $ball" and just lots of random parts like that, a lot of times they have the -> in them, so i'm not sure what the problem is. If you need better examples please let me know and i'll find one for you. I just really want to use OOP with WAMP5 because WAMP is a great application for debugging, among many other things. Thanks everyone.

Options: ReplyQuote
Re: Object Oriented PHP doesn't work?
Posted by: CyberSpatium (67.170.181.---)
Date: May 31, 2006 06:18PM

what version of php are you using? both php4 and php5 support OOP, however, php4 support for OPP is very, very, very limited. php5 however ads some killer OOP features that almost bring php up to par with other higher level development languages. Just remember, php code that uses these newer advanced OOP features of php5 do not work with php4. But most code written in php4 should not have any problems using php5.

I am pretty sure you are using short style ASP tags in your code. There are two ways to fix this. The easiest way is to make sure the first line in your php code uses the full php tag, not the ASP style:

# PHP full style tag
<?php

# ASP short style tags
<?

Make sure all your scripts are using the full php style tags.

if you don’t want to change the tag style in your script, then you can allow short ASP style tags in the php.ini file find this line:
asp_tags = Off

Change to:
asp_tags = On

Now save the file, and restart apache for your new settings to take effect.



Post Edited (06-01-06 13:26)

CyberSpatium
----------------------
WAMP Forum Admin

Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote


Sorry, only registered users may post in this forum.