rainielle73 Posted January 19, 2007 Share Posted January 19, 2007 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 More sharing options...
trq Posted January 19, 2007 Share Posted January 19, 2007 Firstly, you can't declare variables using the [i]var[/i] keyword unless you are within a class. Secondly, this type of question really isn't worth worrying about. Link to comment https://forums.phpfreaks.com/topic/34851-does-declaration-affect-performance/#findComment-164312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.