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

  • Home
  • SEARCH
  • 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 7443941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:24:42+00:00 2026-05-29T11:24:42+00:00

… public $aSettings = array( ‘BindHost’ => 127.0.0.1, ‘Port’ => 9123, ‘MaxFileSize’ => (5

  • 0
...

public $aSettings = array(
  'BindHost' => "127.0.0.1",
  'Port' => 9123,
  'MaxFileSize' => (5 * (1024 * 1024)), // unexpected "(" here
  'UploadedURL' => "http://localhost",
  'UploadPath' => dirname(__FILE__) . "/upload",
  'UploadMap' => dirname(__FILE__) . "/uploads.object",
  'RegisterMode' => false
);

...

This is my code, straight from a class. The problem I have is the "unexpected ( on line 22", line 22 being MaxFileSize.

I can’t see a problem with it, is this a Zend Engine limitation? Or am I blind.

  • 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-29T11:24:44+00:00Added an answer on May 29, 2026 at 11:24 am

    You cannot use non-constant values while initializing class properties in PHP versions earlier than 5.6.
    These are initialized at compile time, at which PHP will do no calculations or execute any code. (5 * (1024 * 1024)) is an expression that requires evaluation, which you cannot do there. Either replace that with the constant value 5242880 or do the calculation in __construct.

    PHP 5.6, introduced in 2014, allows “constant scalar expressions” wherein a scalar constant or class property can be initialized by an evaluated expression in the class definition rather than the constructor.

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

Sidebar

Related Questions

CGI.escapeHTML is pretty bad, but CGI.unescapeHTML is completely borked. For example: require 'cgi' CGI.unescapeHTML('…')
I have an element like this: <span class=tool_tip title=The full title>The ful&#8230;</span> This seems
I have this xml <entry id=1008 section=articles> <excerpt><p>&#8230; in Richtung „Aus für Tierversuche. Kosmetik-Fertigprodukte
what about this one: I want to format the currentTime displayed by a videoPlayer
I've successfully connected to XMPP server (from android XMPP client), and I can send
English is not my native language. I need a software to spellcheck and correct
(tl;dr: see summary at the bottom.) I am implementing an application that pulls content
I want to sign a message according to the RSA-SHA1 Signature Method in OAuth
I have been making a wordpress template. i got stuck at some place... the
When I use the list function: el_nino_1974_2000_all <- list() for (k in seq_along(el_nino_start_month)){ el_nino_1974_2000_all[[k]]

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.