Req #67019 [Opn->Csd]: Class variable initialization scalar expressions
Edit report at https://bugs.php.net/bug.php?id=67019&edit=1
ID: 67019
Updated by: nikic@php.net
Reported by: flip101 at gmail dot com
Summary: Class variable initialization scalar expressions
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: *General Issues
PHP Version: 5.6.0alpha3
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Not sure what the request here is. Your code sample already works. The const_scalar_exprs RFC
applies to anything that uses a static scalar intializer, which includes properties.
Previous Comments:
------------------------------------------------------------------------
[2014-04-04 08:16:12] flip101 at gmail dot com
Description:
------------
Since the value for class initialization are of a fixed nature, the method for constant scalar
expressions could be used as well. As proposed here: https://wiki.php.net/rfc/const_scalar_exprs
Test script:
---------------
<?php
class TestClass {
protected $testValue = 2 * 2;
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67019&edit=1
Thread (3 messages)