<?xml version="1.0"?>
<?xml-stylesheet 
 href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rss version="0.91"><channel><title>Planet PHP</title><link>http://planet-php.net</link><description>People blogging about PHP</description><language>en</language><item><title>phpUnderControl 0.4.3 released - Manuel Pichler</title><link>http://www.manuel-pichler.de/archives/37-phpUnderControl-0.4.3-released.html</link><pubDate>Sun, 07 Sep 2008 17:11:00 +0000</pubDate><description><![CDATA[
    <p>
  I currently released a new version of <a href="http://www.manuel-pichler.de/exit.php?url_id=2010&entry_id=37" title="http://www.phpundercontrol.org" >phpUnderControl</a>. Beside some minor fixes this release comes with a new feature to aggregate test results of multiple <a href="http://www.manuel-pichler.de/exit.php?url_id=2011&entry_id=37" title="http://www.phpun.it" >PHPUnit</a> runs.
</p>

<p>
  Use the new cli command <code>merge-phpunit</code> of <a href="http://www.manuel-pichler.de/exit.php?url_id=2010&entry_id=37" title="http://www.phpundercontrol.org" >phpUnderControl</a> to merge multiple log files produced with <a href="http://www.manuel-pichler.de/exit.php?url_id=2011&entry_id=37" title="http://www.phpun.it" >PHPUnit</a>, as shown in the following example build file for ant.
</p>

<div class="xml" style="text-align: left"><br/><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"UTF-8"</span>?<span style="font-weight: bold; color: black;">></span></span><br/><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"phpuc-test"</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">"build"</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">"."</span><span style="font-weight: bold; color: black;">></span></span><br/>  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"build"</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">"clean,p5.3.0,p5.2.5,p5.2.6,merge"</span><span style="font-weight: bold; color: black;">/></span></span><br/><br/>  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"clean"</span><span style="font-weight: bold; color: black;">></span></span><br/>        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;delete<span style="font-weight: bold; color: black;">></span></span></span><br/>          <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">"${basedir}/build/tmp"</span><span style="font-weight: bold; color: black;">></span></span><br/>            <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"*.xml"</span><span style="font-weight: bold; color: black;">/></span></span><br/>          <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/fileset<span style="font-weight: bold; color: black;">></span></span></span><br/>    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/delete<span style="font-weight: bold; color: black;">></span></span></span><br/>  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">></span></span></span><br/><br/>  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"p5.2.5"</span><span style="font-weight: bold; color: black;">></span></span><br/>    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">"/usr/local/bin/php525"</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">"${basedir}"</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">"false"</span><span style="font-weight: bold; color: black;">></span></span><br/>      <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color&lt;/body>"/></span></div><p><i>Truncated by Planet PHP, read more at <a href="http://www.manuel-pichler.de/archives/37-phpUnderControl-0.4.3-released.html">the original</a> (another 7089 bytes)</i></p>]]></description></item><item><title>Time Theft - Sean Coates</title><link>http://seancoates.com/time-theft</link><pubDate>Sun, 07 Sep 2008 17:00:25 +0000</pubDate><description><![CDATA[<p>Last night, we were robbed an hour.<br />My wife was kind enough to let me sleep in. That was nice of her.</p><p>I did, however, awake to find myself a victim of the <a href="http://en.wikipedia.org/wiki/Y2K7">Y2K7 problem</a>, as <a href="http://derickrethans.nl/the_y2k7_problem.php">Derick</a> mentioned.</p><p>Cheat sheet for Debian users:<geshi>sudo apt-get update && sudo apt-get install libc6</geshi></p><p>Which installs new timezone database info...</p><p><geshi>The following extra packages will be installed:<br />  libc6-dev<br />Suggested packages:<br />  locales glibc-doc manpages-dev<br />The following packages will be upgraded:<br />  libc6 libc6-dev</geshi></p><p>And finally gives the proper time:<geshi>Setting up libc6 (2.3.2.ds1-22sarge5) ...<br />Current default timezone: 'Canada/Eastern'.<br />Local time is now:      Sun Mar 11 13:01:51 EDT 2007.<br />Universal Time is now:  Sun Mar 11 17:01:51 UTC 2007.</geshi></p><p>The Wikipedia article linked above gives other cheat sheets if you're not on Debian (my Ubunty Edgy laptop was safe).</p>]]></description></item><item><title>PHP Pie? - Sean Coates</title><link>http://seancoates.com/php-pie</link><pubDate>Sun, 07 Sep 2008 17:00:25 +0000</pubDate><description><![CDATA[<p>I've often had to manipulate large blobs of text—no, make that many files containing large blobs of text.</p><p>Of course, my IDE can usually handle simple search-and-replace operations, I appreciate the simplicity of the command line interface, on most occasions.</p><p>That's one of the reasons I love working in a unixy environment, I think. There's a bunch of utilities that embrace the command line and take simple input and deliver equally simple output. I've employed sed and awk, in the past, and I still use them to perform some very simple parsing. For example, I can often be found doing something like <code>ps auxwww | grep ssh | awk {'print $2'}</code> to get a list of ssh process IDs, for example.</p><p>But almost anyone who's ever been enlightened to perl pie delights in its power. In a nutshell, I can do something like <code>perl -p -i -e 's/foo/oof/g' somefile</code> from the command line, and perl will digest every line of <code>somefile</code> and perform the substitution. Perl is very well suited to this type of operation, what with its contextual variables and all.</p><div class="note">I updated the code a little, below. You now must explicitly set <code>$_</code>.</div><p>Read on for my PHP-based solution (lest planet-php truncate my post).<br />I've often found myself looking for a PHP equivalent. Not to do simple substitutions, of course, but complex ones. And since I'm most comfortable with PHP, and a I have a huge library of snippets that I can dig out to quell a problem that I may have solved years ago, I've been meaning to fill this void for a while.</p><p>Tonight, I had to come home from a dinner party, early, because my daughter was sick. Too bad, it looked like it was going to be an amazing feast, but I digress. The home-on-a-Saturday-night time left me with a bit of free time to solve one of the problems that's been floating around in my head for who-knows-how-long.</p><p>Thus, I'm happy to present my—at least mostly—working PHP pie script.</p><p><geshi>#!/usr/bin/php&lt;?php</p><p>// Change the shebang line above to point at your actual PHP interpreter</p><p>$interpreter = array_shift($_SERVER['argv']);<br />$script = array_shift($_SERVER['argv']);<br />$files = array_filter($_SERVER['argv']);</p><p>if (!$script) {<br />	fwrite(STDERR, "Usage: $interpreter &lt;script> [files]\n");<br />	fwrite(STDERR, "  Iterates script over every line of every file.\n");<br />	fwrite(STDERR, "  \$_ contains data from the current line.\n");<br />	fwrite(STDERR, "  If files are not provided, STDIN/STDOUT will be used.\n");<br />	fwrite(STDERR, "\n");<br />	fwrite(STDERR, "  Example: ./pie.php '$_ = preg_replace(\"/foo/\",\"oof\",\$_);' testfile\n");<br />	fwrite(STDERR, "    Replaces every instance of 'foo' with 'oof' in testfile\n");<br />	fwrite(STDERR, "\n");<br />	exit(1);<br />}</p><p>// set up function<br />$func = create_function('$_', $script .';return $_;');</p><p>if (!$files) {<br />	// no files, use STDIN<br />	$buf = '';<br />	while (!feof(STDIN)) {<br />		$buf .= $func(fgets(STDIN));<br />	}<br />	echo $buf;<br />} else {<br />	foreach ($files as $f) {<br />		<br />		if (!is_dir($f) or !is_writable($f)) {<br />			fwrite(STDERR, "Can't write to $f (or it's not a file)\n");<br />			continue;<br />		}<br />		<br />		$buf = '';<br />		foreach (file($f) as $l) {<br />			$buf .= $func($l);<br />		}<br />		file_put_contents($f, $buf);<br />	}<br />}</p><p>?></geshi></p><p>Hope it helps someone out there.</p><p><b>Update:</b> I've had some people ask me why I'm reinventing the wheel. I <i>did</i> cover this above—I have plenty of existing PHP code snippets, and almost no perl. I also am very comfortable in PHP, but it's been years since I've been comfortable in perl.</p><p>Here's an example of something I hacked up, today. I can (relatively) easily turn this:</p><div class="php">dmesg | tail -n5</div><p>... which returns this:</p><div class="php">[17214721.004000] sdc: assuming drive cache: write through<br />[17214721.004000]  sdc: sdc1<br />[17214721.024000] sd 7:0:0:0: Attached scsi disk sdc<br />[17214721.024000] sd 7:0:0:0: Attached scsi generic sg1 type 0<br />[17214722.464000] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!</div><p>(the first field is the time since boot... useless for my feeble human brain)</p><p>into:</p><div class="php">dmesg | ./pie.php 'static $prev = false; static $boot = false; if (!$boot) {<br />list($boot) = explode(" ", file_get_contents("/proc/uptime"));<br />$boot = time() - (int) $boot;} if (!$_) return; list($ts, $log) = explode(" ", $_, 2);<br />$ts = str_replace(array("[","]"), array("",""), $ts); $_ = date("H:i:s", $boot + $ts);<br />if ($prev && ($diff = round($boot + $ts - $prev, 2))) $_ .= " (+". $diff .")"; <br />$_ .= " ".$log; $prev = $boot + $ts;' | tail -n 5</div><p>(line breaks added for easier reading)<br />... which returns:</p><div class="php">17:07:44 sdc: assuming drive cache: write through<br />17:07:44  sdc: sdc1<br />17:07:44 (+0.02) sd 7:0:0:0: Attached scsi disk sdc<br />17:07:44 sd 7:0:0:0: Attached scsi generic sg1 type 0<br />17:07:45 (+1.44) FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!</div><p>That's the sort of thing I wouldn't be comfortable doing in perl, but I hacked up on the command line in PHP.</p><p>S</p>]]></description></item><item><title>Freedom Fry on GNU's 25th anniversary - Henri Bergius</title><link>http://feeds.feedburner.com/~r/bergie/midgard/~3/385915337/midcom-permalink-1137817c7cfe11dd936cdfa109b68c938c93</link><pubDate>Sun, 07 Sep 2008 16:57:34 +0000</pubDate><description><![CDATA[<p>
The <a href="http://www.fsf.org/">Free Software Foundation's</a> GNU project <a href="http://www.fsf.org/news/freedom-fry/">turned 25 last week</a>, and the English humorist <a href="http://www.gnu.org/fry/">Stephen Fry made a video</a> to commemorate it:
</p>

<p>
<img src="http://bergie.iki.fi/midcom-serveattachmentguid-0e732ce87cfe11dd9a59a57a77692ad52ad5/freedom-fry.jpg" height="352" width="400" border="1" hspace="4" vspace="4" alt="Stephen Fry on 25 years of Free Software" title="Stephen Fry on 25 years of Free Software" /></p>

<p>
<a href="http://mako.cc/">Benjamin Mako Hill</a> posted some thoughts on how <a href="http://mako.cc/copyrighteous/20080906-00">the first generation of free software developers</a> has grown:
</p>

<blockquote>
Certainly, GNU has matured and accomplished wonderful things in last quarter-century. More importantly perhaps, it's produced wonderful progeny. It has spawned hundreds of thousands of free software projects, thousands of free or nearly-free operating systems, and an unbelievably vibrant global free and open source software community. Beyond the software realm, the free culture movement, most free licensing projects, and much of the access to knowledge movement can trace a connection back to GNU. We are living, and building, a new generation of the free software movement.
</blockquote>

<p>
As computers are becoming more and more ubiquitous, and affect more and more every aspect of our lives, <a href="http://www.fsfeurope.org/documents/freesoftware.en.html">software freedom</a> becomes a strong necessity. I personally have been <a href="http://www.ohloh.net/accounts/bergie">involved</a> with free software since late 90s. It gives me the <a href="http://www.debian.org/">operating system</a> for our servers, our <a href="http://www.php.net/">programming language</a>, and <a href="http://www.midgard-project.org/">our toolkit</a>. It also gives me an <a href="http://www.midgard-project.org/community/whoswho">amazing</a> <a href="http://www.fsfe.org/en/fellows">community</a> to work and share ideas with. It is hard to imagine working in a world without them.
</p>

<p>
To support free software, write <a href="http://github.com/">some code</a>, use a <a href="http://www.ubuntu.com/">free operating system</a>, <a href="http://www.fsfe.org/">join the Fellowship</a>, and celebrate <a href="http://softwarefreedomday.org/">the Software Freedom Day</a> on September 20th!
</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/bergie/midgard?a=X3iBL"><img src="http://feeds.feedburner.com/~f/bergie/midgard?i=X3iBL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/bergie/midgard?a=gmGaL"><img src="http://feeds.feedburner.com/~f/bergie/midgard?i=gmGaL" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/bergie/midgard?a=H2FCl"><img src="http://feeds.feedburner.com/~f/bergie/midgard?i=H2FCl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/bergie/midgard/~4/385915337" height="1" width="1"/>]]></description></item><item><title>php-5.2.5 on Leopard - Sean Coates</title><link>http://seancoates.com/php-5-2-5-on-leopard</link><pubDate>Sun, 07 Sep 2008 16:30:22 +0000</pubDate><description><![CDATA[<p>NOTE: this howto is now pretty outdated. I'll probably be reinstalling Leopard in the near future because <a href="http://blog.phpdoc.info/archives/88-How-to-record-a-podcast-on-OSX-10.5.2.html">Apple hates me</a> so I'll update it when I rebuild.</p><p>Over the past many weeks, I've been tasked at well over 100% completing a not-so-secret project. If I've blown you off in email or on IRC, I'm sorry. I've been too busy to deal with much of anything, and I've let many things slide (as can be witnessed by this Friday night blog post). Do ping me again, if I missed you.</p><p>The not-so-secret project is a complete rewrite of <a href="http://www.phparch.com/">the php|architect site</a> including a brand new codebase for our store, which also hosts <a href="http://pythonmagazine.com/">Python Magazine</a>.</p><p>Anyway, one of the things that happened during development was an upgrade to Mac OS X 10.5 - Leopard. There are a bunch of things wrong with Leopard, but over all I'm pretty happy with it. I did, however, have a bit of a hard time getting my development environment up and running (I did a clean install). After the jump, I'll outline the steps that I took to get a functioning Apache, PHP, MySQL installed. Sure, you could use the leopard-bundled Apache and PHP, but if you're like me, you generally upgrade PHP (and use weird extensions) a lot more often than Apple will upgrade it.</p><p><img src="http://blog.phpdoc.info/uploads/php525-leopard.png" alt="PHP 5.2.5 on Leopard."/>Built on Rasmus' birthday. How appropriate (-:</p><p>First, a couple things should be noted: I'm still without local SSL support on Apache. I've been in touch with the maintainer of apache2 on macports (who, coincidentally, is probably familiar to many of you due to his past work on the PHP project: James Cox), but I still don't have a solution. See <a href="http://trac.macosforge.org/projects/macports/ticket/13182">this bug report</a> for info. The second thing is that my colleague/client/boss/friend (wow.. that sounds like a dangerous combination!) <a href="http://mtabini.blogspot.com/">Marco</a> helped me out quite a bit with the initial leopard-friendly incantations to make things build.</p><p>On with the compiling!</p><p>First things first: you'll need to download/install some packages. You'll need Xcode from the Leopard Install DVD, or from <a href="https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=19897">here</a>. Xcode contains the compiler tools and a bunch of other stuff for Mac OS. Be forewarned: the download is bigger than 1GB!</p><p>Download and install MySQL from <a href="http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.45-osx10.4-i686.dmg/from/pick">here</a>. Yes, it says 10.4, but it works fine with Leopard (for me, anyway). Install it and the startup item that's in the DMG.</p><p>Then, download and install <a href="http://svn.macosforge.org/repository/macports/downloads/MacPorts-1.5.0/MacPorts-1.5.0-10.5.dmg">Macports</a> this is the OS X port of the FreeBSD Ports system, and while I prefer pre-built packages like those offered in Fink (apt-get is nice), when I checked installing Fink on Leopard consisted of weird contortions involving a bootstrap from Tiger. No thanks. Install macports.</p><p>You'll also need a recent version of PHP. I have 5.2.5. Get it <a href="http://www.php.net/get/php-5.2.5.tar.bz2/from/a/mirror">here</a>.</p><p>Now that you have the necessary files, you'll need to fire up Terminal. The beauty of OS X is that when the GUI fails you, there's an underlying unix system that does what you command! (-:</p><p>MySQL installs strangely. Let's fix that. As <i>root</i> do this:<geshi>ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql #needed for PHP, later<br/>mkdir /usr/local/bin #user-installed binaries<br/>ln -s /usr/local/mysql/bin/my* /usr/local/bin #put utils like mysql (client) and mysqldump in your path</geshi></p><p>With MySQL taken care of, we'll move on to <i>ports</i>. Again, as <i>root</i>:<geshi>port selfupdate #makes sure ports is up to date<br/>port sync #syncs with the remote port index (like apt-get update)</geshi></p><p>Now, let's use <i>ports</i> to install the necessary packages. Again as root:<geshi>port install apache2 # install apache 2.2.x<br/>port install apache2 # yes, you need to do it twice, thanks to a bug that doesn't see awk the first time<br/>launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist #startup item (as instructed by the apache port output)<br/>cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf # copy the config file<br/>mv /usr/sbin/apachectl /usr/sbin/apachectl-leopard # move the bundled apachectl out of the regular path<br/>ln -s /opt/local/apache2/bin/apachectl /usr/local/bin/apachectl #and move the port-installed apache2 into the path</geshi></p><p>Congratulations. Apache is (almost) installed (-:</p><p>As root, you'll need to: edit <code>/opt/local/apache2/conf/</code></p><p><i>Truncated by Planet PHP, read more at <a href="http://seancoates.com/php-5-2-5-on-leopard">the original</a> (another 2668 bytes)</i></p>]]></description></item><item><title>PHP Security Camp, 20th - 23rd October 2008, Munich - ThinkPHP /dev/blog - PHP</title><link>http://blog.thinkphp.de/archives/358-PHP-Security-Camp,-20th-23rd-October-2008,-Munich.html</link><pubDate>Sun, 07 Sep 2008 09:29:27 +0000</pubDate><description><![CDATA[
    <p>
<a href="http://entwickler-akademie.de/ak/show.php3?id=44&ccid=16"><!-- s9ymdb:229 --><img class="serendipity_image_right" width="147" height="129" style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://blog.thinkphp.de/uploads/php-sc.png" alt="" /></a>
<a href="http://www.sektioneins.de/"><!-- s9ymdb:227 --><img class="serendipity_image_right" width="267" height="75" style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;" src="http://blog.thinkphp.de/uploads/logo-sektioneins.gif" alt="" /></a>
As more and more business critical applications are "web made", there's more and more potential for security flaws inside your application. In order to avoid sensitive data to be stolen from blackhats, you need to know the most important techniques how to avoid some of the critical issues. For this reason, <a href="http://phpmagazin.de/">PHP Magazin</a> and <a href="http://entwickler-akademie.de/">Entwickler Akademie</a> present a German speaking <a href="http://entwickler-akademie.de/ak/show.php3?id=44&ccid=16">"PHP Security Camp"</a> with four of the top notch PHP/Web security specialists (Stefan Esser, Christian Horchert from SektionEins, Sebastian Wolfgarten from the European Central Bank, Arne Blankerts from NonFood Agenturgruppe) for four days. Read on if you speak German ...
</p>
<p> </p>
<p>
If you're not German speaking, <a href="mailto:info@sektioneins.de">send us an e-mail</a> if you're interested in such a on-site English speaking seminar or a public, english speaking webinar.
</p> <br /><a href="http://blog.thinkphp.de/archives/358-PHP-Security-Camp,-20th-23rd-October-2008,-Munich.html#extended">Continue reading "PHP Security Camp, 20th - 23rd October 2008, Munich"</a>
    ]]></description></item><item><title>Type hints are more useful for scalars than objects - PHP in Action</title><link>http://www.reiersol.com/blog/1_php_in_action/archive/160_type_hints_are_more_useful_for_scalars_than_objects.html</link><pubDate>Sun, 07 Sep 2008 06:46:15 +0000</pubDate><description><![CDATA[
    <p>
    <a href="http://www.maxhorvath.com/2008/09/type-hints-for-scalar-values-phptypesafe-10-rc2-released.html">
    Max Horvath has implemented a library for type hinting scalars.
    </a>
That interests me, since I find that type hinting for objects has limited usefulness.
    </p>
    <p>
    I tried using type hints extensively from an early beta version of PHP 5. I mostly gave up on them for three reasons:
    <ol>
      <li>They make refactoring harder since you get lots of dependecies on a particular class name.</li>
      <li>Making sure an object is the right class has limited usefulness. If you pass an object of the wrong class to a method without type hinting, you're still alerted to the error the
      moment you try to call a non-existent method (one belonging to the class it was supposed to be as opposed to the class it actually is). This
      typically happens early.
      </li>
      <li>My experience is I hardly ever see actual bugs in practice that would have been caught earlier if there had
      been a type hint. I (nearly) always have good unit test coverage. It may be different if you don't, but that's not an
      advisable way to live.</li>
    </ol>
    <p>
    I admit that these jugdments are hard to make. I could be wrong, more or less. Type
    hints are probably useful when code becomes stable enough and at the
    boundaries between modules. But I still tend to avoid using them until I get an 
    actual bug that might have been prevented by a type hint. Their usefulness
    is and has to be an empirical question. The purpose of using them has to be catching errors earlier, so
    if they don't have that effect, there's no point.
    </p>
    <p>
    For the purposes of this blog post, reason 2 is the important one. The idea is that type hints are
    more useful for arrays and scalars than for objects. Why? Because they have the potential to catch errors
    that would otherwise be hard to find or escape unnoticesd. As I said, if you pass an object of the wrong class, you will usually get a "non-existent method"
    error quickly. The same thing happens if you try to pass an array or scalar instead of an object. But if you
    try to pass an object instead of an array, an array instead of a scalar or vice versa, you can keep
    using the passed array or scalar for some time before it blows up. The problem becomes harder to track down.
    I've used type hints for arrays, and found them more meaningful and less troublesome than object type hints.
    </p>
    <p>
    One case I've seen in which scalar type hinting would be useful is a simple
    homegrown date and time object that is initialized by passing a Unix
    timestamp as an argument to the constructor.  A couple of times I've made
    the mistake of passing an object instead. The ensuing error can be hard to
    figure out. If I could type hint to make sure it's an integer, that would
    be helpful.
    </p>
   ]]></description></item><item><title>Why do you use PHP? - blog.phpdeveloper.org &#xC2;&#xBB; PHP</title><link>http://blog.phpdeveloper.org/?p=107</link><pubDate>Sat, 06 Sep 2008 14:46:43 +0000</pubDate><description><![CDATA[<p>A little while back I asked this question on Twitter. I was interested in how other people’s first experiences with PHP compared with my own. I got some great responses - from funny to completely honest. Here’s the list:
<ul>
<li><b>Skoop:</b>  	I didn’t choose PHP, PHP chose me (nice, very zen.)
</li>
<li><b>Andriess:</b> 	low entry barrier, and the AWESOME community
</li>
<li><b>Felixdv:</b> 	great community, open-source spirit and low barrier but powerful if needed (as of PHP5 <img src='http://blog.phpdeveloper.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )
</li>
<li><b>DragonBe:</b>	in PHP I found my likings, where as Perl left me hanging about..
</li>
<li><b>Rmehner:</b>	Mainly because of deployment issues in the beginning. PHP was everywhere available. (In the beginning I had often web projects)
</li>
<li><b>lvtrll:</b>		The options at the time were PHP or ASP… which would you choose? =P
</li>
<li><b>ijansch:</b>	it was the logical choice (or, to be more precise: it gets the thing done, and quickly.)
</li>
<li><b>njames:</b>		its “FREE” no need for mucking about with licences for VS or IIS or W2K or MSSQLSRVR etc etc #php
</li>
<li><b>weierophinney:</b> out of necessity.
</li>
<li><b>padraicb:</b>	At the time (1999) PHP happened to coincide with the activities of friends online - seemed natural I’d help them cut and paste <img src='http://blog.phpdeveloper.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li><b>iephp:</b>		I used to do Java and Perl and a friend of mind told me PHP was easy and fun. I tried it out, turned out well <img src='http://blog.phpdeveloper.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li><b>akrabat:</b>	Wasn’t that much choice back in PHP3 days. Perl / CGI didn’t appeal and the only other choice on my host was PHP…
</li>
<li><b>jlleblanc:</b>	someone suggested it in college and it was easy/inexpensive to get into.
</li>
<li><b>sweatje:</b>	My Unix admin pointed me towards LAMP when I was looking for a free alternative to IIS/ASP for a home business accounting system
</li>
<li><b>chartjes:</b>	My first job out of college needed a web site and had no money to pay for licenses for Windows server (this is 1998)
</li>
<li><b>ramsey:</b>		Switched from ASP to PHP b/c I didn’t want to learn ASP.NET, Tomcat was a bitch, & PHP had everything we needed built in (& more)
</li>
<li><b>calevans:</b>	because upgrading from NT to Server 2000 was going to cost me $15,000 + hardware.
</li>
</ul>
<p>I think I got them all, but if you didn’t get to contribute, definitely leave a comment with your first introductions to this great language of ours!</p>
]]></description></item><item><title>No longer on Planet PHP - Jacob Santos</title><link>http://www.santosj.name/php/no-longer-on-planet-php/</link><pubDate>Sat, 06 Sep 2008 02:02:19 +0000</pubDate><description><![CDATA[<p>I’m not quite sure when I was dropped from <a href="http://planet-php.net">Planet PHP</a>. I haven’t been there in a long time and certainly haven’t posted on there for a long time, so it is no surprise. I think it is nice actually. I said what I wanted to say and I don’t think I have anything else to say about PHP, well at least not for a while.</p>
<p>The reason I joined in the first place was that there weren’t that many posts that I wanted to read. Now, there are more than enough posts that I want to read and also need to read. Many and better bloggers on PHP have joined the Planet PHP site, so I am not needed. It was fun and I’m glad they allowed me to join the community, but I’m happy being pushed aside and replaced by far better people.</p>
<p>I started visiting the site again and well, I enjoy it once more. I’m visiting the site more and more, so my addiction to PHP news is coming back. It is a safe drug I can get used to. I’m still addicted to WordPress news, but a little bit of PHP here and there couldn’t hurt.</p>
<p>I plan on retiring the Planet PHP category and moving the posts over to the “PHP” tag.</p>
]]></description></item><item><title>Who is using namespaces in PHP already? - Lukas Smith</title><link>http://pooteeweet.org/blog/0/1288</link><pubDate>Fri, 05 Sep 2008 19:41:09 +0000</pubDate><description><![CDATA[<p>As I said in my <a href="http://pooteeweet.org/blog/1287">last post</a> we are not yet sure if we need to make some changes to namespaces before we can move from alpha to beta in the current 5.3.0 release cycle. What I did not ask for explicitly is feedback from people that have already started developing code with namespaces. These people are likely the best source of feedback on the current state of namespaces and if the <a href="http://wiki.php.net/rfc/namespacecurlies">proposed changes</a> to namespaces would be useful or not. As you can see in the thread on internals around this RFC <a href="http://marc.info/?l=php-internals&m=122034228323300&w=2">Stas does not feel its necessary</a>, while <a href="http://marc.info/?l=php-internals&m=122035711315842&w=2">Marcus still feels its a good idea</a>.</p>

<p>I know that the <a href="http://www.doctrine-project.org/">Doctrine</a> guys are already playing with namespaces and are preparing to move to requiring 5.3.0 in trunk (which will eventually become Doctrine 2.0). Speaking of which, <a href="http://www.doctrine-project.org/blog/doctrine-1-0-released">Doctrine has gone 1.0</a> as planned on September 1st. Very good news in its own right of course.</p>

<p>Anyways, those of you who have dipped their feet in using the current namespace implementation in PHP please let us know what your view point is (even if its just a thumbs up all is well)! Either post a comment here or even better yet post to the <a href="mailto:internals@lists.php.net">internals</a> mailinglist.</p>

]]></description></item></channel></rss>
