Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7655973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:39:07+00:00 2026-05-31T12:39:07+00:00

Our staging server is generating a parse error and I’m wondering if our pre-staging

  • 0

Our staging server is generating a parse error and I’m wondering if our pre-staging server has been letting our dev team get away with incorrect syntax.

Here’s the code causing the ‘parse error’:

       // GLOBALS.PHP
  <?php
       session_start();

      class ItemsFromBronzeAge  {
               static public $ITEMNAMELABEL = "ItemName";
      }

      class Labels {
                   static public $USER_PROMPT_ITEMNAME = "Item name here....";
      }
   ?>

We include the above globals.php into the 2nd file — called index.php — like this:

             // INSIDE OF INDEX.PHP
      <?php
        require_once 'globals.php'; // variables and statics used throughout

             // the next line is line #12 in the 'Parse error' message below
        $_SESSION[ItemsFromBronzeAge::$ITEMNAMELABEL] = Labels::$USER_PROMPT_ITEMNAME;

      ?>

And here’s the parse error when we run index.php on our 1and1.com staging server:

       " Parse error: syntax error, unexpected ']', 
         expecting '(' in index.php on line 12"

Just to drive this home, we changed line #12 in the code in index.php to this and the 1and1.com staging server no longer reports a ‘parse error’:

    // WE CHANGED FROM THIS:
    $_SESSION[ItemsFromBronzeAge::$ITEMNAMELABEL] = Labels::$USER_PROMPT_ITEMNAME;

    // TO THIS AND THE 'PARSE ERROR' GOES AWAY -- THIS CODE WORKS ON THE STAGING SERVER:
    $_SESSION["ItemName"] = "Item name here....";

There is NO WAY our team is going back through all our source code, dropping the use of constants for array indexes and regressing to use string literals as array indexes.

My question is — has our pre-staging dev server been letting us get away with incorrect syntax above, or does 1and1.com have some sort of PHP setting out of whack, or…….?

I mean the use of public static class members as array indexes — is commonplace.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:39:08+00:00Added an answer on May 31, 2026 at 12:39 pm

    What version of PHP are you running on both systems?

    It sounds like it may be related to different versions of PHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The other person on my dev team has been deploying our Django app to
We have been storing our staging database on the production database server with the
Currently our developent enviroment consists of a Dev server, a Staging server and a
In our development environment each developer has their own dev server. Often times they
We have a number of integration tests that fail when our staging server goes
We want to test email functionality on our staging server, but we don't want
While uploading my current project to our staging server I noticed that the Web.config
So, we're using continuous integration in our current Team Foundation Server 2010 setup, and
We have windows authentication set up on our staging server for our clients to
All our developers are able to log in to our staging server via ssh.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.