<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bobobobo's Weblog &#187; php</title>
	<atom:link href="http://bobobobo.wordpress.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://bobobobo.wordpress.com</link>
	<description>technology and the internets</description>
	<lastBuildDate>Mon, 30 Nov 2009 16:56:23 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='bobobobo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/0e8d17c68f90a18a1e89a776717e00e2?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Bobobobo's Weblog &#187; php</title>
		<link>http://bobobobo.wordpress.com</link>
	</image>
			<item>
		<title>how do i do an overloaded constructor in PHP?</title>
		<link>http://bobobobo.wordpress.com/2009/07/11/how-do-i-do-an-overloaded-constructor-in-php/</link>
		<comments>http://bobobobo.wordpress.com/2009/07/11/how-do-i-do-an-overloaded-constructor-in-php/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 03:26:32 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[overloaded]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=1250</guid>
		<description><![CDATA[Q:  How do I do an overloaded constructor in PHP?
A:  You don&#8217;t need them
Consider the following


class Foo
{
  var $name ;
  function __construct()
  {
    # if the default ctor is invoked, name
    # this instance "unnamed"
    $this-&#62;name = 'unnamed' ;
  }

 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1250&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h1>Q:  How do I do an overloaded constructor in PHP?</h1>
<h2>A:  You don&#8217;t need them</h2>
<p>Consider the following</p>
<blockquote>
<pre>
class Foo
{
  var $name ;
  function __construct()
  {
    # if the default ctor is invoked, name
    # this instance "unnamed"
    $this-&gt;name = 'unnamed' ;
  }

  # Fine and dandy, but what if
  # we want to supply a name
  # in an overloaded ctor?
  <font color="#a00">
  function __construct( $iname )
  {
    $this-&gt;name = $iname ; #doesn't work
    # because overloaded ctors of this style
    # aren't supported in PHP!!
  }
  </font>
}
</pre>
</blockquote>
<p>OK.  Well I promised in the title of this post that <b><em>you didn&#8217;t need overloaded constructors in php</em></b>  Here&#8217;s why.</p>
<p>Redefine class Foo as follows:</p>
<blockquote>
<pre>

class Foo
{
  var $name ;

  # specify a single ctor, WITH DEFAULT VALUES
  # FOR PARAMETERS.  This is equivalent, and in my
  # opinion <b><em>a better</em></b> syntax
  # for getting overloaded constructors to work.
  function __construct( $iname = 'unnamed' )
  {
    $this-&gt;name = $iname ;
  }
}
</pre>
</blockquote>
<p>There.  Fewer lines of code, less mess, same effect.  This was an excellent design decision by the php group.</p>
Posted in php Tagged: constructor, overloaded, php <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/1250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/1250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/1250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/1250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/1250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/1250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/1250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/1250/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/1250/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/1250/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=1250&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2009/07/11/how-do-i-do-an-overloaded-constructor-in-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
		<item>
		<title>how to install php pear extensions</title>
		<link>http://bobobobo.wordpress.com/2008/12/26/how-to-install-php-pear-extensions/</link>
		<comments>http://bobobobo.wordpress.com/2008/12/26/how-to-install-php-pear-extensions/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 07:36:22 +0000</pubDate>
		<dc:creator>bobobobo</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://bobobobo.wordpress.com/?p=495</guid>
		<description><![CDATA[installing php pear extensions
Well, i always forget how this is done, but its actually really easy.

Navigate to your php install directory.  for me, i go start-&#62; run -&#62; cmd.exe


cd\apache2.2\php


You PHP install dir may be different.  If you used xampp, its probably C:\xampp\php.  The default location of Apache 2.2 if you install it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=495&subd=bobobobo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h1>installing php pear extensions</h1>
<p>Well, i always forget how this is done, but its actually really easy.</p>
<ol>
<li>Navigate to your php install directory.  for me, i go start-&gt; run -&gt; cmd.exe</p>
<blockquote>
<pre>
cd\apache2.2\php
</pre>
</blockquote>
<p>You PHP install dir may be different.  If you used xampp, its probably C:\xampp\php.  The default location of Apache 2.2 if you install it by itself is something like c:\program files\apache software foundation\apache2.2\php
</li>
<li>Then at that command prompt, say I want to add the <a href="http://pear.php.net/package/Math_Numerical_RootFinding/">Math_Numerical_RootFinding</a> PEAR package to my php install:<br />
<blockquote>
<pre>
C:\Apache2.2\php&gt;pear install Math_Numerical_RootFinding
</pre>
</blockquote>
</li>
</ol>
<p>And that&#8217;s it!  PHP automatically resolves the network connection and downloads the latest build of the package.</p>
<p>IF the package you&#8217;re trying to get is still in BETA (as some of the good ones seem to be stuck in a perpetual beta), then you would have to pay attention to the error message that appears when you try to install it.</p>
<p>So for example, I wanted the <a href="">Math_Polynomial</a> package, so I try:</p>
<blockquote>
<pre>
pear install Math_Polynomial
</pre>
</blockquote>
<p>But it comes back at me with</p>
<blockquote><p>
Failed to download pear/Math_Polynomial within preferred state &#8220;stable&#8221;, latest release is version 0.1.0, stability &#8220;beta&#8221;, use &#8220;channel://pear.php.net/Math_Polynomial-0.1.0&#8243; to install<br />
Cannot initialize &#8216;channel://pear.php.net/Math_Polynomial&#8217;, invalid or missing package file<br />
Package &#8220;channel://pear.php.net/Math_Polynomial&#8221; is not valid<br />
install failed
</p></blockquote>
<p>So you have to do:</p>
<blockquote>
<pre>
pear install Math_Polynomial-0.1.0
</pre>
</blockquote>
<p>Which works.</p>
Posted in misc, php  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bobobobo.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bobobobo.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bobobobo.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bobobobo.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bobobobo.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bobobobo.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bobobobo.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bobobobo.wordpress.com/495/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bobobobo.wordpress.com/495/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bobobobo.wordpress.com/495/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bobobobo.wordpress.com&blog=2331964&post=495&subd=bobobobo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://bobobobo.wordpress.com/2008/12/26/how-to-install-php-pear-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4ec51727310397c9e592dd84ae74dc2?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif" medium="image">
			<media:title type="html">bobobobo</media:title>
		</media:content>
	</item>
	</channel>
</rss>