const definition bug?

Discussion about the open-source Phalanger [?] project.

const definition bug?

Postby pospa » January 2nd, 2013, 8:50 am

Hi,
I have reached my point of desperate...

I am unable to compile this code:

Code: Select all
class cl_xyz implements base_class
{
    /**
     * URI validate pattern
     */
    const URI_VALIDATE_PATTERN = "/^(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,])*$/";


I am still geting error like:
Syntax error: unexpected token '"'

What should be wrong?

Pospa
Jan Pospíšil
-<{Pospa}>-
User avatar
pospa
 
Posts: 2
Joined: November 21st, 2012, 12:35 pm

Re: const definition bug?

Postby Jakub Misek » January 2nd, 2013, 4:24 pm

Hi,

You've found old PHP behaviour - the string contains $ sign, so parser expects a variable and string itself cannot be used as a constant then.

We'll fix this in a future release.

Thanks!
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: const definition bug?

Postby Jakub Misek » January 2nd, 2013, 4:51 pm

BTW you can use single quoted string for now.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: const definition bug?

Postby Jakub Misek » January 2nd, 2013, 8:12 pm

Hi, the issue has been fixed, so it is available for those who compile Phalanger from sources at GitHub

https://github.com/DEVSENSE/Phalanger/c ... 94ad312ac8
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 2 guests

cron

User Control Panel

Login

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 151 on December 6th, 2020, 7:46 am

Users browsing this forum: No registered users and 2 guests