php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72059 ?? is not allowed on constant expressions
Submitted: 2016-04-19 17:01 UTC Modified: 2016-04-21 00:35 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: marcio@php.net Assigned: marcio (profile)
Status: Closed Package: *General Issues
PHP Version: 7.0.6RC1 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marcio@php.net
New email:
PHP Version: OS:

 

 [2016-04-19 17:01 UTC] marcio@php.net
Description:
------------
The null coalescing operator (??) is not supported on constant expressions https://3v4l.org/ANcaQ

Test script:
---------------
<?php new class { private $x = null ?? 'foo'; };

Expected result:
----------------
No errors.

Actual result:
--------------
Fatal error: Constant expression contains invalid operations in {file} on line {line}
Process exited with code 255.

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-21 00:35 UTC] marcio@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: marcio
 [2016-04-21 00:48 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5053fc078d2ae8ac57f1d3ff84eb31a4b2e05108
Log: Fixed bug #72059 - Reference the bug id directly in NEWS
 [2016-04-21 00:50 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5053fc078d2ae8ac57f1d3ff84eb31a4b2e05108
Log: Fixed bug #72059 - Reference the bug id directly in NEWS
 [2016-07-20 11:31 UTC] davey@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5053fc078d2ae8ac57f1d3ff84eb31a4b2e05108
Log: Fixed bug #72059 - Reference the bug id directly in NEWS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC