Yes, I am wondering too. For mechanism you can refer to the source code,
and can someone explain why we cannot have constant arrays ?
Qiang
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
This must be some strange definition of "constant" I do not understand, then (:
On Mon, Dec 19, 2011 at 7:43 PM, Daniel Convissor
wrote:
> Hi Barbu:
>
>> I wonder why I cannot assign arrays to constants.
>
> Do keep in mind that you can serialize() the array before storing it in
> a constant. Th
Hi Barbu:
> I wonder why I cannot assign arrays to constants.
Do keep in mind that you can serialize() the array before storing it in
a constant. Then use unserialize(CONSTANT) when you need the data.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
da
On 15/12/11 21:17, Pierre Joye wrote:
> On Wed, Dec 14, 2011 at 11:14 PM, Stas Malyshev
> wrote:
>> Hi!
>>
>>
>>> I believe he's referring to sys/time.h, but this introduces
>>> portability issues. If it were just unix, that would be one thing.
>>> But maintaining this and a Windows alternative,
It won't be there for Christmas, but we still have some awesome gifts available!
Whether you are purchasing a new subscription, renewing an old one, or
advertising with us all purchases allow you to choose one of many wonderful
holiday gifts.
It's our way of thanking you for your business.
Visi
2011/12/19 Ángel González :
> On 19/12/11 21:23, Paul Dragoonis wrote:
>> Barbu,
>>
>> This is how constants work in all viable languages such as C/++.
> I disagree. In C you can have:
> const data foo[] = { { "Data1", 2 }, { "Data2", 78 } };
Agreed, i was more thinking of #define (not const), whe
On 19/12/11 21:23, Paul Dragoonis wrote:
> Barbu,
>
> This is how constants work in all viable languages such as C/++.
I disagree. In C you can have:
const data foo[] = { { "Data1", 2 }, { "Data2", 78 } };
It's not unusual in php to have a complex structure that won't change
in a variable. It shou
Barbu,
This is how constants work in all viable languages such as C/++.
They are not 'variables of data', they contain scalar values so that
you can have a maintainable source for your value to refer to later.
http://msdn.microsoft.com/en-us/library/357syhfh(v=vs.80).aspx
I believe constants co
Hello!
I wonder why I cannot assign arrays to constants.
According to the PHP manual:
"only scalar and null values are allowed. Scalar values are integer, float,
string or boolean values."
What is the mechanism behind this?
What's the explanation?
--
Common sense is not so common - Voltaire