Jump to content

does declaration affect performance?


rainielle73

Recommended Posts

Hi! I know that in PHP, I can use any variable I want without worrying if it was previously declared or not. However, I am wondering if declaring a variable before using it uses more resources than using it right away. Like ff:

Code 1:

var $hello;

$hello+=1;

As compared to Code 2:

$hello+=1;

Thanks!
Link to comment
https://forums.phpfreaks.com/topic/34851-does-declaration-affect-performance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.