<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 14:02:51 +0000</lastBuildDate>
    <item>
      <title>(PHP) Speed Test: array_push vs $array[] - mthorn</title>
      <link>https://snipplr.com/view/759/speed-test-arraypush-vs-array</link>
      <description>&lt;p&gt;Took 0.164692 seconds for array[]&#13;
Took 0.395778 seconds for array_push&#13;
&#13;
As you can see array_push is more than twice as slow. Here are the reasons. Array_push is a function call, Function calls are always slower. Array_push takes mixed parameters, parameter checking is always slower. Also array[] just looks cleaner and is less to type.&#13;
&#13;
Tips: Always pre-intialize your variables and don't use mixed types even though you can.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Aug 2006 09:27:46 UTC</pubDate>
      <guid>https://snipplr.com/view/759/speed-test-arraypush-vs-array</guid>
    </item>
    <item>
      <title>(PHP) Speed Test: strcmp vs === - mthorn</title>
      <link>https://snipplr.com/view/758/speed-test-strcmp-vs-</link>
      <description>&lt;p&gt;strcmp with matching strings took 0.207852 seconds&#13;
strcmp with non-matching strings took 0.215276 seconds&#13;
=== with matching strings took 0.067122 seconds&#13;
=== with non-matching strings took 0.057305 seconds&#13;
&#13;
=== is the clear winner. Function calls are always slower than operators. This was with PHP5, may be different for earlier versions. Not sure about the memory impact but I assume it's less since the strings do not have to be copied for the function call.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Aug 2006 09:23:15 UTC</pubDate>
      <guid>https://snipplr.com/view/758/speed-test-strcmp-vs-</guid>
    </item>
    <item>
      <title>(PHP) Compare value _and_ type - mthorn</title>
      <link>https://snipplr.com/view/754/compare-value-and-type</link>
      <description>&lt;p&gt;Since PHP is typeless odd things can happen when a variable is not the type you expected. PHP treats 0, null, '0', false, and '' as false. Sometimes you really want to know if the value is false. The solution is simple, use the triple equal (===) operator.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Aug 2006 05:03:51 UTC</pubDate>
      <guid>https://snipplr.com/view/754/compare-value-and-type</guid>
    </item>
    <item>
      <title>(PHP) Read raw post data, useful for grabbing XML from Flash XmlSocket. - mthorn</title>
      <link>https://snipplr.com/view/755/read-raw-post-data-useful-for-grabbing-xml-from-flash-xmlsocket</link>
      <description>&lt;p&gt;Often PHP can't interpret POST data because it is not form-encoded. This is typical when the post data is XML from API's like Flash's XmlSocket. You can use the following methods to read the POST data directly.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Aug 2006 05:03:51 UTC</pubDate>
      <guid>https://snipplr.com/view/755/read-raw-post-data-useful-for-grabbing-xml-from-flash-xmlsocket</guid>
    </item>
    <item>
      <title>(PHP) Create a thumbnail maintaining aspect ratio using GD - mthorn</title>
      <link>https://snipplr.com/view/753/create-a-thumbnail-maintaining-aspect-ratio-using-gd</link>
      <description>&lt;p&gt;Will create a thumnail no taller or wider than the supplied size. Also contains some tips for reading and writing images using GD.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Aug 2006 04:57:21 UTC</pubDate>
      <guid>https://snipplr.com/view/753/create-a-thumbnail-maintaining-aspect-ratio-using-gd</guid>
    </item>
  </channel>
</rss>
