Is there any limit on how much data can be stored in variables in php ?
From the manual
As for strings (and I think that also applies to arrays) the limit would be the memory limit of the PHP process AFAIK.
*the SUM limit of all variables and resources would be the memory limit of the PHP process.
Generally speaking though, if you hit the memory allocation limit, you're doing something wrong.
And how would i know if i am hitting the limit and what will be the consequences ?
out of memory errorThe amount of memory PHP will/can consume can be set in php.ini (e.g memory_limit = 128M)