0

Hello all Community !

My question is very simple:

What is the difference between $_SESSION['id'] and $_SESSION[id] ? Both works the same ! What is better ?

Does anyone know which is faster ?

Thanks all ;) !

Edited by P0lT10n: n/a

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by P0lT10n
0

The first one is the only correct way. Although the second (still) works, it is first parsed as a constant but not found, then parsed as a string (thus slower), but invalid code anyway. It may not work or cause errors in future versions.

0

The first one is the only correct way. Although the second (still) works, it is first parsed as a constant but not found, then parsed as a string (thus slower), but invalid code anyway. It may not work or cause errors in future versions.

Thanks ! I thought the same about the second one !

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.