jphp-group / jphp

JPHP - an implementation of PHP on Java VM

Home Page:http://jphp.develnext.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot concatenate in arrays inside of class constants

danog opened this issue · comments

Cannot concatenate or do other basic (arithmetical) operations on constants while defining class constants (but only inside of arrays).

Code:

<?php

class a
{
    private const SENSITIVE_HEADERS = ['a'.'b'];
}

Result:

[daniil@daniil-arch jav]$ jppm start
-> linux
-> app:run 
-> install 

Fatal error: Uncaught Error: Expecting constant value for a::SENSITIVE_HEADERS in res://t.php on line 4, position 13
Stack Trace:
#0 {main}
  thrown in res://t.php on line 4

If using the value directly (private const SENSITIVE_HEADERS = 'a'.'b';, without the array) everything works fine.