Req #67019 [Opn->Csd]: Class variable initialization scalar expressions

From: Date: Fri, 04 Apr 2014 13:54:24 +0000
Subject: Req #67019 [Opn->Csd]: Class variable initialization scalar expressions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185086@lists.php.net to get a copy of this message
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)

« previous php.bugs (#185086) next »