Array - Parse error problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shiningtor
Forum Newbie
Posts: 4
Joined: Fri Sep 21, 2007 11:39 am

Array - Parse error problem

Post by shiningtor »

Hi

I have a 'Parse error' problem that I have no idea of how to solve.

What is wrong with the following? This code is in a file and is
loaded into memory using 'include'. This is part of a larger program for which I've isolated this part.

<?php
class parser
{
private $config = array
(
"open_string" => array("[',']"),
"close_string" => array("[/',']")
);
}
?>

On my development computer there is no problem, but on the server I get this error.

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
in /homepages/.../class/parser_class.php on line 5.

I've tested the class with a function to echo a word on the screen. That worked fine.

What I don't understand is why this code is ok on the development computer, but not on the server.

I'm at a loss. Can anyone help?

ShiningTor
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Array - Parse error problem

Post by Zoxive »

I'm guessing the Server doesn't have php5 and your development computer does.

Check what version of php you have on the server/development computer.
Post Reply