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 7782835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:39:53+00:00 2026-06-01T19:39:53+00:00

i am blocked by an incomprehensible syntax error that makes me crazy :/ The

  • 0

i am blocked by an incomprehensible syntax error that makes me crazy :/

The error displayed is Parse error: syntax error, unexpected '.', expecting ',' or ';'

This is the code that makes that:

class FamillePieceControllerCore extends FrontController
{
    public $php_self = 'famille-piece.php';

    private $webservice_url = _CICERONE_CONNECT_BASE_URL_ . 'WSC003&P2=0';
}

Where _CICERONE_CONNECT_BASE_URL_ is defined in a other file.

If i delete . 'WSC003&P2=0' the code works fine.

I don’t understand :/ Thanks for helping

ps: I use php 5.3.8

  • 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-06-01T19:39:54+00:00Added an answer on June 1, 2026 at 7:39 pm

    You cannot initialize a class property with an expression (like concatenation). Instead you must do it in the constructor:

    class FamillePieceControllerCore extends FrontController
    {
        public $php_self = 'famille-piece.php';
    
        private $webservice_url;
        public function __construct() {
          $this->webservice_url = _CICERONE_CONNECT_BASE_URL_ . 'WSC003&P2=0';
        }
    }
    

    From the documentation:

    Class member variables are called "properties". You may also see them referred to using other terms such as "attributes" or "fields", but for the purposes of this reference we will use "properties". They are defined by using one of the keywords public, protected, or private, followed by a normal variable declaration. 

    This declaration may include an initialization, but this initialization must be a constant value–that is, it must be able to be evaluated at compile time and must not depend on run-time information in order to be evaluated.

    Constants defined with define() are defined at runtime, so the value of _CICERONE_CONNECT_BASE_URL_ isn’t known at compile time when the property is initialized.

    Update for later PHP versions:

    Beginning with PHP 5.6, simple expressions are permitted in class property declarations as long as they can still be evaluated at compile time. So the original posted code would compile and execute correctly in PHP 5.6+. Anything requiring runtime evaluation, such as a function call or variable interpolation is still not permitted.

    // This is okay in PHP 5.6+
    public $property = SOME_CONST . " other stuff";
    
    // This is still not possible since
    public $property = strlen(SOME_CONST);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm totally blocked on this. See this code: # user.rb class User < ActiveRecord::Base
when a thread is being blocked is it necessary that this thread blocks any
Sockets on Linux question I have a worker thread that is blocked on an
In iOS browser (safari) sounds that are triggered by events are blocked (on ​​click
Turkish government have blocked some IPs including Google Analytics. This caused all the web
I've blocked, and then waited for a signal via the following code: sigset_t set;
The problem is that I am trying to make certain tiles blocked so the
I have a managed thread which is waiting, blocked, in an unmanaged code (specifically,
If so, that would imply that the blocked thread can enter when another thread
I'm blocked with a very simple Query that it's not working as I think

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.