<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 24 May 2012 03:51:31 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Reddit.com: How and When do you use Bitwise?]]></title>
      <guid>http://www.phpdeveloper.org/news/17786</guid>
      <link>http://www.phpdeveloper.org/news/17786</link>
      <description><![CDATA[<p>
In <a href="http://www.reddit.com/r/PHP/comments/ruvm8/how_and_when_do_you_use_bitwise/">this new question</a> to Reddit, there's a question about the usage of bitwise operators - when they might come in useful.
</p>
<blockquote>
As I get deeper into PHP I notice some lower level functionality that looks like it could be interesting, maybe even useful. I'm trying (other than switching the hex value of a color) to figure out when Bitwise operators might come in handy. Any real world examples?
</blockquote>
<p>
Responses to the post mention a few cases they'd be useful in - handling permissions, route matching and error reporting. You can find out more about bitwise operators in PHP <a href="http://us3.php.net/manual/en/language.operators.bitwise.php">the PHP manual</a>.
</p>]]></description>
      <pubDate>Fri, 06 Apr 2012 10:30:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stoimen Popov's Blog: PHP Performance: Bitwise Division]]></title>
      <guid>http://www.phpdeveloper.org/news/17357</guid>
      <link>http://www.phpdeveloper.org/news/17357</link>
      <description><![CDATA[<p>
<i>Stoimen Popov</i> has <a href="http://www.stoimen.com/blog/2012/01/05/php-performance-bitwise-division/">a new post</a> to his blog today comparing the performance of bitwise division versus the normal "/" division operator.
</p>
<blockquote>
Recently I wrote about <a href="http://www.stoimen.com/blog/2011/12/26/computer-algorithms-binary-search/">binary search</a> and then I said that in some languages, like PHP, bitwise division by two is not faster than the typical "/" operator. However I decided to make some experiments and here are the results.
</blockquote>
<p>
According to <a href="http://www.stoimen.com/blog/wp-content/uploads/2012/01/bitwise-divide-by-two.png">his results</a> using the bitwise method is slightly faster, but you'd only really notice it when working with large sets of data (like his example using 10,000,000). The code to run his benchmarks is included in the post.
</p>]]></description>
      <pubDate>Fri, 06 Jan 2012 09:26:38 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Disabling the silence @-operator in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/14747</guid>
      <link>http://www.phpdeveloper.org/news/14747</link>
      <description><![CDATA[<p>
As <i>Sameer Borate</i> points out in <a href="http://www.codediesel.com/php/disabling-the-silence-operator-in-php">his latest post</a> to his blog, there's a way to disable that pesky suppression operator (@) in your PHP installation thanks to the <a href="http://pecl.php.net/package/scream">scream extension</a>.
</p>
<blockquote>
PHP supports one error control operator: the at sign (@). When prepended to an expression any error generated by that expression will be ignored. It can also be useful for hiding errors generated by various functions. [...] Although quite useful at some times, using the @-operator can have some annoying side effects. 
</blockquote>
<p>
He shows you how to install the extension on a stock Ubuntu platform (including the PHP packages) and how use the feature in your application by means of a call to <a href="http://php.net/ini_set">ini_set</a> (or, of course, setting it in your php.ini file).
</p>]]></description>
      <pubDate>Tue, 06 Jul 2010 08:42:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schluter's Blog: Class posing and overloading the "new" operator]]></title>
      <guid>http://www.phpdeveloper.org/news/13795</guid>
      <link>http://www.phpdeveloper.org/news/13795</link>
      <description><![CDATA[<p>
In <a href="http://schlueters.de/blog/archives/124-Class-posing-and-overloading-the-new-operator.html">this recent post</a> to his blog <i>Johannes Schluter</i> talks about a method he's suggested for testing objects in unit tests - overriding the "new" operator to replace specific classes with mocks.
</p>
<blockquote>
Two years ago at some conference I had a conversation with Sebastian about the need for a way to overload the new operator in PHP so, probably, bad designed code can be tested more easily by replacing specific classes with mocks.  [...] Sebastian then pushed the code as part of a new test_helpers extension with some documentation <a href="http://github.com/sebastianbergmann/php-test-helpers/">to github</a> and I fixed some bugs in it. The aim of the extension is to collect functionality which might be beneficial for phpUnit and other test scenarios but which should never reach a production environment.
</blockquote>
<p>
He includes some sample code to show it in action - defining the mock class, using the set_new_overload function to define it as what should be called when the "new" operator is used and a dump of the result.
</p>]]></description>
      <pubDate>Thu, 07 Jan 2010 10:24:16 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ThinkPHP Blog: Silence of the LAMPs]]></title>
      <guid>http://www.phpdeveloper.org/news/13231</guid>
      <link>http://www.phpdeveloper.org/news/13231</link>
      <description><![CDATA[<p>
In <a href="http://blog.thinkphp.de/archives/424-Silence-of-the-LAMPs.html">a recent post</a> to the ThinkPHP blog <i>Martin Brotzeller</i> looks at a PHP operator that developers should just not use anymore - the suppression operator (@).
</p>
<blockquote>
The silence operator exists to give programmers an easy way to suppress messages when a command might fail and the code checks for success itself (i.e. in those cases that raise errors instead of throwing exceptions).
</blockquote>
<p>
He points out a popular use (like putting it on an fopen to prevent it from throwing an E_WARNING) but notes that this could cause trouble if the code is several layers deep and seems to fail silently. He gives en example of the Zend_Loader component of the Zend Framework and how, if the suppression operator was used, errors with an include failed without so much as a blip in the error log. While it seems handy, the suppression operator can cause more harm than good in the long run. 
</p>]]></description>
      <pubDate>Wed, 16 Sep 2009 09:13:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mark van der Velden's Blog: PHP Quiz part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/12514</guid>
      <link>http://www.phpdeveloper.org/news/12514</link>
      <description><![CDATA[<p>
<i>Mark van der Velden</i> has posted <a href="http://blog.dynom.nl/archives/PHP-Quiz-part-2_20090514_27.html">another PHP quiz</a> you can used to test your knowledge of the language:
</p>
<blockquote>
A short quiz this time, but that doesn't make it less fun. Do you know the answer to all of them? Get a cup of coffee and kill 10 minutes with round two... As always, think of the answer before you execute the code or look it up. You can find round one <a href="http://blog.dynom.nl/archives/PHP-Quiz-part-1_20080424_23.html">here</a>.
</blockquote>
<p>
This one has questions on arrays, ArrayAccess, references, operator precedence and nesting structures. There's no answer key, so you'll just have to test it out if you want to see the answer.
</p>]]></description>
      <pubDate>Thu, 14 May 2009 12:05:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Loops & Decisions in PHP - The ABC's of PHP Part 8]]></title>
      <guid>http://www.phpdeveloper.org/news/12475</guid>
      <link>http://www.phpdeveloper.org/news/12475</link>
      <description><![CDATA[<p>
PHPBuilder.com has posted <a href="http://www.phpbuilder.com/columns/peter_shaw05062009.php3">the eighth part</a> of their introductory "ABCs of PHP" series today. This time the focus is on looping and decision functionality (like if/while/for/etc).
</p> 
<blockquote>
n any given computer language (PHP is no exception) there has to be a way to allow the running code to decide between doing 2 different things. If there wasn't then software would not be able to adapt based on operating conditions, or it wouldn't be able to decide between two different users. 
</blockquote>
<p>
They look at using: if statements and operators, for loops and while loops. When they look at the operators, they talk about the differences between equals/not equals, grater than/less than and two of the boolean operators - AND and OR.
</p>]]></description>
      <pubDate>Thu, 07 May 2009 10:26:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schluter's Blog: Scream!]]></title>
      <guid>http://www.phpdeveloper.org/news/12037</guid>
      <link>http://www.phpdeveloper.org/news/12037</link>
      <description><![CDATA[<p>
After being tasked with some code that was filled with the suppression character (@) all over, <i>Johannes Schluter</i> decided to take matters into his own hands and write an extension to disable it.
</p>
<blockquote>
That's annoying. So I wrote a simple extension disabling this operator. That helped. I then proposed that extension to <A href="http://pecl.php.net/">pecl</a>, while doing that I found out that <a href="http://t3.dotgnu.info/blog/php/breaking-the-silence.html">Gopal has written a similar extension</a> before. After short discussions we added that extension, using the name <a href="http://pecl.php.net/scream">scream</a> to pecl and released the extension there.
</blockquote>
<p>
Documentation for the extension has <a href="http://php.net/scream">already been added</a> to the PHP manual for the "Break the Silence" operator. By enabling the setting (either in your php.ini or via an <a href="http://php.net/ini_set">ini_set</a>) turning on "scream_enabled", any use of the suppression operator (@) will be nulled out and all according error messages will be displayed. 
</p>]]></description>
      <pubDate>Fri, 27 Feb 2009 11:14:50 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: XPath Explained (by Tobias Schlitt and Jacob Westhoff)]]></title>
      <guid>http://www.phpdeveloper.org/news/11937</guid>
      <link>http://www.phpdeveloper.org/news/11937</link>
      <description><![CDATA[<p>
<i>Tobias Schlitt</i> and <i>Jacob Westhoff</i> have written up and article (and posted it <a href="http://schlitt.info/opensource/blog/0704_xpath.html">over on Tobias' blog</a>) that wants to help you understand XPath better - whether you're a novice or have been using it for a while.
</p>
<blockquote>
This paper will give an overview on XPath an addressing language for XML documents. XPath is a W3C recommendation currently in version 1.0. XPath was created in relation to the XSL recommendation and is intended to be used with XSLT and XPointer. Beside that, XPath can be used in a variety of programming languages, commonly in combination with a DOM API.
</blockquote>
<p>
The article starts with an <a href="http://schlitt.info/opensource/blog/0704_xpath.html#introduction">introduction to the concept</a> of XPath, moves on to <a href="http://schlitt.info/opensource/blog/0704_xpath.html#addressing">addressing</a>, talks about <a href="http://schlitt.info/opensource/blog/0704_xpath.html#xpath-axes">XPath axes</a>, mentions <a href="http://schlitt.info/opensource/blog/0704_xpath.html#functions-operators-and-conditions">functions/operators/conditions</a> and looks at <a href="http://schlitt.info/opensource/blog/0704_xpath.html#xpath-and-xslt">styling XML with XPath and XSLT</a>.
</p>]]></description>
      <pubDate>Thu, 12 Feb 2009 10:28:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Debuggable Blog: Supressing Errors in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11848</guid>
      <link>http://www.phpdeveloper.org/news/11848</link>
      <description><![CDATA[<p>
<i>Felix Geisendorfer</i> has posted two new items to the Debuggable blog looking at suppressing errors in your applications - and no, that doesn't mean <a href="http://www.phpdeveloper.org/news/11672">using the @ operator</a> either.
</p>
<blockquote>
As of late I am getting sick of some best practices I have taught myself. Never using the @-error suppressing operator quickly moving to the top of the list. Before you start crying out loud (I know you will), let me say this: I do not mean to encourage anybody to use the @-operator. Applying the practice herein introduced may result in permanent damage to your coding habits and could serve as a gateway behavior to writing shitty code.
</blockquote>
<p>
He gives an example in the <a href="http://debuggable.com/posts/suppressing-php-errors-for-fun-and-profit">first post</a> of a place where he failed to properly check to ensure an element existed before checking a element of it. The <a href="http://debuggable.com/posts/suppressing-suppressing-php-errors-with-emptiness">second post</a> provides an interesting solution to the same problem - using <a href="http://php.net/empty">empty</a> on the element/subelement to check its existence.
</p>]]></description>
      <pubDate>Fri, 30 Jan 2009 11:14:58 -0600</pubDate>
    </item>
  </channel>
</rss>

