Hi!
> Perhaps something for OpCache's optimizer though, if it doesn't already
> do that...
The problem with that is once you start to do conversions, things quicky
go south, as conversions can depend on runtime variables, and people get
really weird bugs when their expressions are not evaluated
On Wed, 2013-08-14 at 12:03 +0100, Derick Rethans wrote:
> On Wed, 14 Aug 2013, Patrick Schaaf wrote:
>
> > Would this allow using constants, too? Class constants?
> >
> > const FOO = 1;
> > const BAR = self::FOO + 1;
> > const BAZ = self::FOO + 2;
> > const BARF = GLOBAL_BARF;
> > const IMPORT =
Am 13.08.2013 um 14:13 schrieb "Anthony Ferrara" :
> Hello all,
>
> I'd like to propose a new RFC for 5.NEXT:
>
> https://wiki.php.net/rfc/const_scalar_expressions
>
> This allows for defining constant expressions which are resolved at compile
> time.
>
> for example:
>
> const FOO = 1 + 1;
>
Super cool, thanks!
Am 13.08.2013 um 18:12 schrieb Anthony Ferrara :
> Hello all,
>
> I'd like to propose a new RFC for 5.NEXT:
>
> https://wiki.php.net/rfc/const_scalar_expressions
>
> This allows for defining constant expressions which are resolved at compile
> time.
>
> for example:
>
> c
On Wed, 14 Aug 2013, Anthony Ferrara wrote:
> Sebastian,
>
>
> On Wed, Aug 14, 2013 at 7:44 AM, Sebastian Krebs wrote:
>
> > Just asking: Does this cover only declarations, or every constant
> > expression, for example
> >
> > $weeks = $secs / (60 * 60 * 24 * 7);
> >
> > becomes to the opcode-
Sebastian,
On Wed, Aug 14, 2013 at 7:44 AM, Sebastian Krebs wrote:
> Hi,
>
> Just asking: Does this cover only declarations, or every constant
> expression, for example
>
> $weeks = $secs / (60 * 60 * 24 * 7);
>
> becomes to the opcode-equivalent of
>
> $weeks = $secs / (604800);
>
> ?
>
Curre
Hi,
Just asking: Does this cover only declarations, or every constant
expression, for example
$weeks = $secs / (60 * 60 * 24 * 7);
becomes to the opcode-equivalent of
$weeks = $secs / (604800);
?
2013/8/14 Anthony Ferrara
> Stas,
>
>
> On Wed, Aug 14, 2013 at 5:01 AM, Stas Malyshev >wrot
Am 14.08.2013 13:03 schrieb "Derick Rethans" :
>
> On Wed, 14 Aug 2013, Patrick Schaaf wrote:
>
> > Would this allow using constants, too? Class constants?
> >
> > const FOO = 1;
> > const BAR = self::FOO + 1;
>
> Those are not constants, but expressions which can't be run during
> compile time.
U
On Wed, 14 Aug 2013, Patrick Schaaf wrote:
> Would this allow using constants, too? Class constants?
>
> const FOO = 1;
> const BAR = self::FOO + 1;
> const BAZ = self::FOO + 2;
> const BARF = GLOBAL_BARF;
> const IMPORT = otherclass::IMPORT; // with autoloading?
>
> In my opinion these would st
On Wed, Aug 14, 2013 at 12:44 PM, Anthony Ferrara wrote:
> Stas,
>
>
> On Wed, Aug 14, 2013 at 5:01 AM, Stas Malyshev wrote:
>
>> Hi!
>>
>> >> https://wiki.php.net/rfc/const_scalar_expressions
>>
>> I like the idea, but absence of constant support makes this thing much
>> less useful, as you can't
Stas,
On Wed, Aug 14, 2013 at 5:01 AM, Stas Malyshev wrote:
> Hi!
>
> >> https://wiki.php.net/rfc/const_scalar_expressions
>
> I like the idea, but absence of constant support makes this thing much
> less useful, as you can't do things like:
>
> public $angle = M_PI/2;
>
> I think this is one of
On 14 August 2013 11:01, Stas Malyshev wrote:
> Hi!
>
>>> https://wiki.php.net/rfc/const_scalar_expressions
>
> I like the idea, but absence of constant support makes this thing much
> less useful, as you can't do things like:
>
> public $angle = M_PI/2;
>
> I think this is one of the reasons this
2013/8/13 Anthony Ferrara :
> Hello all,
>
> I'd like to propose a new RFC for 5.NEXT:
>
> https://wiki.php.net/rfc/const_scalar_expressions
>
> This allows for defining constant expressions which are resolved at compile
> time.
>
> for example:
>
> const FOO = 1 + 1;
> static $bar = 1 << 2;
> func
Hi!
>> https://wiki.php.net/rfc/const_scalar_expressions
I like the idea, but absence of constant support makes this thing much
less useful, as you can't do things like:
public $angle = M_PI/2;
I think this is one of the reasons this idea was never implemented -
because without constant support
Am 13.08.2013 18:12, schrieb Anthony Ferrara:
> Thoughts?
+1 :)
--
Sebastian BergmannCo-Founder and Principal Consultant
http://sebastian-bergmann.de/ http://thePHP.cc/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:
On Tue, Aug 13, 2013 at 6:12 PM, Anthony Ferrara wrote:
> Hello all,
>
> I'd like to propose a new RFC for 5.NEXT:
>
> https://wiki.php.net/rfc/const_scalar_expressions
>
> This allows for defining constant expressions which are resolved at compile
> time.
>
> for example:
>
> const FOO = 1 + 1;
>
On Wed, Aug 14, 2013 at 8:17 AM, Christian Stoller wrote:
>> Hello all,
>>
>> I'd like to propose a new RFC for 5.NEXT:
>>
>> https://wiki.php.net/rfc/const_scalar_expressions
>>
>> This allows for defining constant expressions which are resolved at compile
>> time.
>
> What should that be for?
>
17 matches
Mail list logo