<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1043599" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1043599</link>
    <description></description>
    <language>en</language>
          <item>
    <title>greg wrote:

Abhishek Reddy</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-notice-ignore-or-stop-happening#comment-1240534</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;greg&lt;/em&gt; wrote:&lt;/div&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;Abhishek Reddy&lt;/em&gt; wrote:&lt;/div&gt;Sounds like you&#039;re over-optimising, and prematurely.&lt;/div&gt;You were advising me to future proof mysql in another thread, even where I&#039;d said it wasn&#039;t necessary. I would have thought coding PHP to best practice and getting the maximum efficiency is also paramount.&lt;br /&gt;
I don&#039;t really know the efficiency, which is why I asked. &lt;/div&gt;&lt;/p&gt;
&lt;p&gt;What I suggested regarding SQL wasn&#039;t an optimisation; it was good design.  The idea is closer to writing safe and readable code as I suggested here, than it is to squeezing out nanoseconds of speed in a few request cycles.&lt;/p&gt;
&lt;p&gt;Of course, one consequence of good design is typically some performance benefit, which I pointed out in the other thread.  However, that doesn&#039;t mean every technique for improving performance is necessarily due to good design (it rarely is).&lt;/p&gt;
&lt;p&gt;Also, speed (time complexity) is only one dimension.  You have to consider space complexity, structural complexity, readability, safety, and so on, too.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;greg&lt;/em&gt; wrote:&lt;/div&gt;One var is in a header included in all pages, and while I know this one particular instance isn&#039;t going to cause any great upset to resources, when this is done with many variables throughout the site, I presumed it can add up.&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;That is a fine presumption for a hypothesis.  I encourage you to test it experimentally before worrying about the real cost.&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Apr 2009 18:16:14 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1240534 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Hmm, interesting</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-notice-ignore-or-stop-happening#comment-1240528</link>
    <description> &lt;p&gt;Hmm, interesting comments!&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;Abhishek Reddy&lt;/em&gt; wrote:&lt;/div&gt;Sounds like you&#039;re over-optimising, and prematurely.&lt;/div&gt;You were advising me to future proof mysql in another thread, even where I&#039;d said it wasn&#039;t necessary. I would have thought coding PHP to best practice and getting the maximum efficiency is also paramount.&lt;br /&gt;
I don&#039;t really know the efficiency, which is why I asked. &lt;/p&gt;
&lt;p&gt;One var is in a header included in all pages, and while I know this one particular instance isn&#039;t going to cause any great upset to resources, when this is done with many variables throughout the site, I presumed it can add up.&lt;/p&gt;
&lt;p&gt;And I am investigating everything possible in learning to maximise efficiency in all code. I just wondered what sort of impact this may have - especially when multiple instances.&lt;/p&gt;
&lt;p&gt;Using @ sounds like a good option in some cases - of course only when the var is known to only return notices, and not errors or warnings. As suppressing error logs is a bad thing of course.&lt;/p&gt;
&lt;p&gt;Initializing vars is also another good option, but this adds to the discussion really.&lt;br /&gt;
As my particular var in question doesn&#039;t get used unless it is something specific, initialising the var to null means means it is actually been set.&lt;br /&gt;
Again, one var isn&#039;t an issue, but when you need to initialise hundreds of vars throughout the site, it can add up. Especially when a lot of them might not be used, if they are in an if/else, include file etc.&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Apr 2009 15:19:05 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1240528 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I believe that always</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-notice-ignore-or-stop-happening#comment-1240484</link>
    <description> &lt;p&gt;I believe that always initializing your variables is a good habit.  It&#039;s probably a left-over habit from register globals, but there is still the possibility that the same variable was used somewhere else.&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Apr 2009 09:42:45 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1240484 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Why do you think checking if</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-notice-ignore-or-stop-happening#comment-1240464</link>
    <description> &lt;p&gt;Why do you think checking if a variable is set is inefficient, or will be less efficient than suppressing a warning?  Are you checking millions or thousands of variables per cycle, or a dozen, or one?&lt;/p&gt;
&lt;p&gt;Sounds like you&#039;re over-optimising, and prematurely.  I would aim for clarity: explicitly checking if the variable is set documents for readers the fact that the variable is not always expected to be set.  Omitting the else-branch documents the fact that its absence is unimportant.&lt;/p&gt;
&lt;p&gt;Using @ might also work, but it&#039;s a blanket suppression, rather than specifying the single condition you care about.&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Apr 2009 09:02:56 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1240464 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>IMO, it is best to write</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-notice-ignore-or-stop-happening#comment-1240448</link>
    <description> &lt;p&gt;IMO, it is best to write with no notices. however, you could do the following where you KNOW it is not going to cause a problem:&lt;/p&gt;
&lt;p&gt;if (@($variable == &quot;text&quot;))&lt;/p&gt;
&lt;p&gt;The @ tells it to suppress any warnings/notices.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Apr 2009 03:41:29 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1240448 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>In a talk given at</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/php-notice-ignore-or-stop-happening#comment-1240445</link>
    <description> &lt;p&gt;In a &lt;a href=&quot;http://www.archive.org/details/simple_is_hard&quot;&gt;talk given at Drupalcon&lt;/a&gt;, Rasmus Lerdorf briefly mentions that regardless of how the error reporting level is set, PHP still builds the error string. So you will waste a bit of time doing a bunch of string concats. As long as your error reporting level is set low enough, I don&#039;t think PHP pops open the error log.&lt;/p&gt;
&lt;p&gt;It doesn&#039;t bother me, though. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 16 Apr 2009 02:42:37 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1240445 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
