<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.2" -->
<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/"
	>

<channel>
	<title>Scatterism</title>
	<link>http://ramikayyali.com</link>
	<description>Unfocused, Opinionated.</description>
	<pubDate>Thu, 10 Apr 2008 13:28:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.2</generator>
	<language>en</language>
			<item>
		<title>Although PHP Eats Rails For Breakfast</title>
		<link>http://ramikayyali.com/archives/2007/06/23/php_vs_ruby</link>
		<comments>http://ramikayyali.com/archives/2007/06/23/php_vs_ruby#comments</comments>
		<pubDate>Sat, 23 Jun 2007 03:16:04 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject>
	<dc:subject>Ruby</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/archives/2007/06/23/php_vs_ruby</guid>
		<description><![CDATA[Ohloh is a stalker for open source projects. These guys can discern tremendous amounts of data about any code that has public version control. Pretty nifty.

Now according to Robin Luckey&#8217;s report, PHP has seen 20% growth in terms of LoC; code written in Ruby simply dwarfs in comparison. Though I have a strange feeling about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ohloh.com" title="Ohloh Open Source Directory">Ohloh</a> is a stalker for open source projects. These guys can discern tremendous amounts of data about any code that has public version control. Pretty nifty.</p>

<p>Now according to <a href="http://www.ohloh.net/articles/php_eats_rails" title="PHP Eats Rails For Breakfast">Robin Luckey&#8217;s report</a>, <acronym title="Hypertext PreProcessing">PHP</acronym> has seen 20% growth in terms of <a href="http://en.wikipedia.org/wiki/Lines_of_code" title="Source lines of code">LoC</a>; code written in Ruby simply dwarfs in comparison. Though I have a strange feeling about this.</p>

<p>I believe that this year, and the one to follow will put Ruby (and especially Rails) where PHP was back in 2002-03; in a sense Ruby will enjoy the growth in popularity and adoption the same way PHP did. But putting aside technological merits, I think that there&#8217;s a categorical difference between <em>most</em> code written in PHP and that in Ruby&#8230; in a Apple vs. Microsoft kind of way.</p>

<p>For starters, Ruby (and especially Rails) tend to spoil developers. The minimalistic approach of both the language and the framework affects the developers&#8217; mindset, and makes them, even forces them to write more concise code. PHP has a history of ugly code, amateur software and &#8220;failed&#8221; frameworks. So the code produced by most PHP&#8217;ers would have a much larger LoC value than similar code produced by Ruby&#8217;ists.</p>

<p>In addition to that, most projects written in Rails are service-oriented: not open source, no public code repository, and no way Ohloh can analyze them. Most of the Ruby code that Ohloh <em>can</em> analyze comes from <a href="http://rubyforge.com">RubyForge</a>, which accounts for most projects written in Ruby, and none of those, relatively speaking, have a large code base.</p>

<p>I neglect the effect of 37signals&#8217; product design and marketing approach, though I know it&#8217;s in the back of every Rails developer&#8217;s mind. Most sites built with Rails are usually simplistic, and don&#8217;t require much code in the first place. And even if Ohloh had access to these sites&#8217; code, they wouldn&#8217;t see much growth anyway, because once a service-oriented site is complete, feature-additions will only account for a thin slice of its growth.</p>

<p>Remember, the numbers on Robin&#8217;s report are those of <em>growth</em> not of total LoC. That is, PHP has grown by 20% <em>even</em> with Rails&#8217; influence over web developers. I can only find two reasons for that:</p>

<ul>
<li>PHP code is inherently more verbose, thus generates more lines of code.</li>
<li>Developers prefer switching frameworks than switching languages.</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2007/06/23/php_vs_ruby/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LAMP&#8217;s Standing Still</title>
		<link>http://ramikayyali.com/archives/2006/06/25/lamp</link>
		<comments>http://ramikayyali.com/archives/2006/06/25/lamp#comments</comments>
		<pubDate>Sun, 25 Jun 2006 00:49:10 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>General</dc:subject>
	<dc:subject>PHP</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/archives/2006/06/25/lamp</guid>
		<description><![CDATA[These guys seem really serious about losing LAMP. I don&#8217;t think we&#8217;ll lose LAMP as a platform, but it&#8217;s probably stagnating. That is, not lost but not going anywhere.

Three or four years ago I used to get excited about PHP releases, I remember how big was the jump from 4.0.6 (read buggy) to 4.1 (read [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hades.phparch.com/ceres/public/article/index.php/art::columns::exit0::june" title="Are We Losing LAMP?">These</a> <a href="http://blog.develix.com/frog/user/cliff/article/2006-06-04/9" title="Why the light has gone out on LAMP">guys</a> seem really serious about losing LAMP. I don&#8217;t think we&#8217;ll lose LAMP as a platform, but it&#8217;s probably stagnating. That is, not lost but not going anywhere.</p>

<p>Three or four years ago I used to get excited about <acronym title="Hypertext PreProcessing">PHP</acronym> releases, I remember how big was the jump from 4.0.6 (read buggy) to 4.1 (read cool). We all know it was the 4.x tree that caused everybody to hail. We compared it to 3.x, we liked it a lot. Not because 4 became object-oriented, not because 4 introduced tons of features, but because 4 made it much easier to do what we do best: make stuff.</p>

<p>I would argue that PHP&#8217;s next major tree was the 4.3, but then things stated getting out of hand. Everybody started getting touchy feely about the &#8220;enterprise&#8221;, we wanted to prove that PHP can make, that Java&#8217;s no better. Remember the PHP vs. Java, PHP vs. ASP.NET, PHP vs. Fluffy Puppies debates? Benchmarks? Micro-scrutinizing? <code>strstr</code> vs. <code>str_str</code>? I do, and I couldn&#8217;t bare it. I couldn&#8217;t care less whether PHP was enterprisey or not, I just wanted to make stuff, I wanted a sharp tool, a single tool, not a swiss-army knife, and I&#8217;m sure many PHP developers would agree.</p>

<p>PHP5 couldn&#8217;t make up for it. Admit it. Deal with it.</p>

<p>PHP5 introduced all sorts of bells and whistles, a whole new OO model, SimpleXML, SQLite and whatnot. How many of us felt these are crucial? These features where important, cool, but not crucial, they weren&#8217;t enough of a reason for ISPs to upgrade, they weren&#8217;t good enough for the &#8220;ignorant&#8221; 90% user base. Web applications are simple, and that&#8217;s what the language, platform and tools are supposed to be. Take a look at Rail&#8217;s success then tell me otherwise.</p>

<p>I&#8217;m sorry if I sound too harsh, but it is only because I really like PHP and I don&#8217;t want it to lose focus. I loved reading <a href="http://phplens.com/phpeverywhere/" title="PHP Everywhere">this guy</a> and <a href="http://www.sebastian-bergmann.de/en/index.php" title="Sebastian Bergmann">this guy</a>, I used to keep up with [this site]http://www.dotgeek.org and <a href="http://phpkitchen.com">this site</a>, I used to like <a href="http://www.phpbb.org">this board</a> and <a href="http://www.phpnuke.org">this thing</a>. I used to do have no doubts about PHP, I don&#8217;t want to be disappointed now.</p>

<p>The PHP community is shrinking by the day, at least that&#8217;s how I feel. I consider the community to consist of the extremely enthusiastic evangelists, those who make stuff instead of benchmarking them. We have a growing base of young developers who only need a small portion of PHP&#8217;s capabilities and a shrinking base of developers who want to make things happen. We need chaos, not community rules. We need a CPAN, not a PEAR, a Smarty or a Zend Framework; these projects give me a feeling of being the &#8220;chosen&#8221; ones.</p>

<p>However, along with chaos we need an educated community, one that can automatically filter crap. Let a thousand frameworks flourish because with a filtering community only the best of the best will survive, and not because Zend or PHP.net chose that.</p>

<p>Winning company&#8217;s acceptance is not an advantage per se. That&#8217;s starting at the top of the pyramid, which the opposite of how Perl and Ruby grew. Hackers used to like Perl, I personally love Perl, I use it everyday for tons of mini tasks, and I think that&#8217;s how Perl got into big corporates; Larry had nothing much to do with it.</p>

<p>PHP has limited itself to web applications, and that was good. But later on, PHP started to market itself as both an enterprise and a scripting (as in <acronym title="Common Language Interpreter">CLI</acronym>) language. Of course there&#8217;s no way it can fit both, because &#8220;scripting&#8221; and &#8220;enterprise&#8221; can&#8217;t be crammed into the same sentence without horrible consequences. This marketing expansion didn&#8217;t come naturally, it felt like it was forced upon PHP and that we&#8217;re shoving PHP somewhere it doesn&#8217;t belong, and that it was now obliged to compete with two well-backed platforms.</p>

<p>Few have noticed that PHP wasn&#8217;t a platform by itself, and that it can&#8217;t compete with Java or .NET because it wasn&#8217;t complete without LAM. We should be pushing PHP away from that stiff competition and try to convert it to a leader in its own category. I think Marco&#8217;s pointing in the right direction with his suggestion to make PHP a foundation. It&#8217;ll hand over the steering wheel back to where it belongs.</p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2006/06/25/lamp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Aspect-Oriented Programming</title>
		<link>http://ramikayyali.com/archives/2005/11/15/aop</link>
		<comments>http://ramikayyali.com/archives/2005/11/15/aop#comments</comments>
		<pubDate>Tue, 15 Nov 2005 15:58:41 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject><dc:subject>AOP</dc:subject><dc:subject>PHP</dc:subject><dc:subject>Programming</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2005/11/15/aop</guid>
		<description><![CDATA[I found this on PHC&#8217;s website, must 
be the cleanest explanation I&#8217;ve seen of aspect-orient programming:

Aspect oriented programming is a relatively new programming paradigm. The 
standard example to explain what AOP does for you is the following. Suppose you 
have a script with a series of functions. Say you want to start and end every [...]]]></description>
			<content:encoded><![CDATA[<p>I found this on <a href="http://www.phpcompiler.org/spinoffs/index.html">PHC&#8217;s website</a>, must 
be the cleanest explanation I&#8217;ve seen of aspect-orient programming:</p>

<blockquote><p>Aspect oriented programming is a relatively new programming paradigm. The 
standard example to explain what AOP does for you is the following. Suppose you 
have a script with a series of functions. Say you want to start and end every 
function with a call to some logging function:</p>

<pre>
&lt;?php
   function some_function
   {
      log("some_function: begin");

      /* do whatever the function should do */

      log("some_function: end");
   }
?&gt;
</pre>

<p>And say you want to do that in each and every function, for example for 
debugging purposes. It&#8217;s a lot of work to do that manually for every function. 
And when you no longer need it, it is a lot of work to remove it again. This is 
what&#8217;s known as a cross-cutting concern: something you need to implement (in 
this example, logging), that &#8220;cross-cuts&#8221; (affects) a lot of code. With AOP, 
you can write this concern as a single &#8220;aspect&#8221;. You then run your program 
through an &#8220;aspect weaver&#8221;, which will insert the necessary code at the start 
and end of each function, thus saving you a lot of work.</p></blockquote>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2005/11/15/aop/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Iterators in PHP5</title>
		<link>http://ramikayyali.com/archives/2005/02/25/iterators</link>
		<comments>http://ramikayyali.com/archives/2005/02/25/iterators#comments</comments>
		<pubDate>Fri, 25 Feb 2005 11:11:58 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2005/02/25/iterators</guid>
		<description><![CDATA[Marco Tabini, head of 
PHP&#124;architecture magazine, was 
kind enough to allow me to publish my article from the January 
issue, although the contract buys all publishing rights. 
The article is about iterators in PHP5, I thought it&#8217;s a topic 
that should be discussed in a little more detail, since first I like 
SPL so much, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.phparch.com/mt/">Marco Tabini</a>, head of 
<a href="http://www.phparch.com"><acronym title="Hypertext PreProcessing">PHP</acronym>|architecture</a> magazine, was 
kind enough to allow me to publish my article from the January 
issue, although the contract buys all publishing rights. 
The article is about iterators in PHP5, I thought it&#8217;s a topic 
that should be discussed in a little more detail, since first I like 
SPL so much, second, I get a lot of questions about it. Oh, and 
by the way, if you haven&#8217;t subscribed to php|a yet, you should 
put it on your top-priority list.</p>

<p>Well, after proof-reading the article, and (hopefully) getting rid 
of all the typos and grammatical mistakes, here&#8217;s my latest and greatest 
article; I hope you find it useful.</p>

<h3>Blurb (as seen on php|a)</h3>

<p>When PHP5 came out, a buzz started about 
Design Patterns and their application, how to use them, what exactly are 
&ldquo;patterns&rdquo;, and why they are so important. Today, we take a 
look at one of the famous patterns, the Iterator.</p>

<p><a href="http://ramikayyali.com/archives/2005/02/25/iterators#more-83" class="more-link">(more&#8230;)</a></p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2005/02/25/iterators/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP and Apache</title>
		<link>http://ramikayyali.com/archives/2004/12/25/php_apache</link>
		<comments>http://ramikayyali.com/archives/2004/12/25/php_apache#comments</comments>
		<pubDate>Sat, 25 Dec 2004 08:31:22 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject><dc:subject>Apache</dc:subject><dc:subject>PHP</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2004/12/25/php_apache</guid>
		<description><![CDATA[Following the latest discussions on PHP vs. Apache, I felt 
I had to say something about it. John Coggeshall 
doesn&#8217;t really think there&#8217;s a real reason to switch 
and actually consider Apache2; but guess what? That&#8217;s wrong!

Some people at the Apache community are pretty pissed off 
at how PHP pushes people away from Apache2 although [...]]]></description>
			<content:encoded><![CDATA[<p>Following the latest discussions on <acronym title="Hypertext PreProcessing">PHP</acronym> vs. Apache, I felt 
I had to say something about it. <a href="http://blog.coggeshall.org//archives/174_Apache_20_My_Two_Cents.html">John Coggeshall</a> 
doesn&#8217;t really think there&#8217;s a <em>real</em> reason to switch 
and actually consider Apache2; but guess what? That&#8217;s wrong!</p>

<p>Some people at the Apache community are pretty pissed off 
at how PHP pushes people away from Apache2 although 
it&#8217;s literally the next best thing after 1.3. The reason is 
obvious, Apache guys want people to use Apache2, PHP guys 
say don&#8217;t. Of course you can say that in thousands of pretty 
ways, but the fact remains that PHP people (and especially 
module writers) aren&#8217;t paying much attention to Apache2.</p>

<p>But why? Apache2 has all sorts of great features, like threading, 
filtering, module <acronym title="Application Programming Interface">API</acronym>, etc. Why not make use of it? I hear you say 
&#8220;If it ain&#8217;t broken, don&#8217;t fix it&#8221;. Well duh, Windows 3.11 wasn&#8217;t 
broken (sort of), OS/2 seemed like a solid system too, heck 
PHP4 wasn&#8217;t broken, it worked, didn&#8217;t it? But weren&#8217;t 
they &#8220;fixed&#8221;?</p>

<p><a href="http://ramikayyali.com/archives/2004/12/25/php_apache#more-69" class="more-link">(more&#8230;)</a></p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2004/12/25/php_apache/feed/</wfw:commentRss>
		</item>
		<item>
		<title>That&#8217;s What They Think</title>
		<link>http://ramikayyali.com/archives/2004/10/23/j2se5</link>
		<comments>http://ramikayyali.com/archives/2004/10/23/j2se5#comments</comments>
		<pubDate>Fri, 22 Oct 2004 22:18:33 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject><dc:subject>Java</dc:subject><dc:subject>PHP</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2004/10/23/j2se5</guid>
		<description><![CDATA[Just downloaded J2SE 5.0, and turns out here&#8217;s the reason why they think PHP isn&#8217;t enterprise-ready:

]]></description>
			<content:encoded><![CDATA[<p>Just downloaded J2SE 5.0, and turns out here&#8217;s the reason why they think <acronym title="Hypertext PreProcessing">PHP</acronym> isn&#8217;t enterprise-ready:</p>

<p><img src="http://www.ramikayyali.com/files/2004/10/j2se5.gif" alt="J2SE 5.0" width="626" height="396" /></p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2004/10/23/j2se5/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP, Enterprised!</title>
		<link>http://ramikayyali.com/archives/2004/10/18/php_enterprised</link>
		<comments>http://ramikayyali.com/archives/2004/10/18/php_enterprised#comments</comments>
		<pubDate>Sun, 17 Oct 2004 23:45:56 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject><dc:subject>PHP</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2004/10/18/php_enterprised</guid>
		<description><![CDATA[I&#8217;m sure we&#8217;re all bored with 
all 
these 
discussions 
about PHP being ready (or not) for enterprise computing; I know I am.

I think we&#8217;re all missing the point here, like Marco Tabini said, it doesn&#8217;t 
really matter if PHP is enterprise-ready or not, an enterprise-level company 
doesn&#8217;t care if you&#8217;re using PHP or mashed potatoes [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure we&#8217;re all bored with 
<a href="http://phplens.com/phpeverywhere/?q=node/view/120" title="Enterprise PHP again">all</a> 
<a href="http://www.procata.com/blog/archives/2004/10/12/enterprise-php/" title="Enterprise PHP">these</a> 
<a href="http://blogs.phparch.com/mt/index.php?p=29" title="PHP and the enterprise myth">discussions</a> 
about <acronym title="Hypertext PreProcessing">PHP</acronym> being ready (or not) for enterprise computing; I know I am.</p>

<p>I think we&#8217;re all missing the point here, like Marco Tabini said, it doesn&#8217;t 
really matter if PHP is enterprise-ready or not, an enterprise-level company 
doesn&#8217;t care if you&#8217;re using PHP or mashed potatoes to get the job done, if the 
budget allows it then by all means use whatever you want. Nobody&#8217;s interested in 
hearing three-letter buzzword-like acronyms, nobody cares what you&#8217;re doing 
underneath, just as long as you make sure a patient&#8217;s heart doesn&#8217;t stop, or 
tons of money aren&#8217;t transferred by mistake to Nuke-The-World organization.</p>

<p>Yes, PHP <em>is</em> enterprise-ready, if you want it to be. It can do 
whatever you want it to do, from messaging, to <acronym title="Remote Procedure Call">RPC</acronym>, to persistence, but are you 
willing to invest?! Are you willing to develop modules, extensions, APIs and 
standards? PHP is a monolithic monster, it&#8217;s not easily extended, but it still 
has lots of advantages, lots of potential, but are you willing to invest?!</p>

<p>Developing any project with PHP implies many costs, this includes the 
learning curve, integration, interoperability, deployment and obviously speed of 
execution. Each comes with a certain cost, each impacts a project in a different 
way, and each contributes to moving PHP further into the enterprise market.</p>

<p><a href="http://ramikayyali.com/archives/2004/10/18/php_enterprised#more-51" class="more-link">(more&#8230;)</a></p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2004/10/18/php_enterprised/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Can PHP be owned by Sun?</title>
		<link>http://ramikayyali.com/archives/2004/08/07/php_owned_by_sun</link>
		<comments>http://ramikayyali.com/archives/2004/08/07/php_owned_by_sun#comments</comments>
		<pubDate>Sat, 07 Aug 2004 13:24:04 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject><dc:subject>PHP</dc:subject><dc:subject>Sun</dc:subject><dc:subject>Zend</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2004/08/07/php_owned_by_sun</guid>
		<description><![CDATA[Just spotted an interesting 
 article speculating on how the new changes in PHP5 can be a sign that it might 
be owned by Sun in the near future.

Well, the new changes in PHP5 are tremendous, and they do bring PHP5 
much closer to Java in terms of OO design, except PHP5 isn&#8217;t Java, and [...]]]></description>
			<content:encoded><![CDATA[<p>Just spotted an <a href="http://www.devshed.com/c/a/PHP/PHP-5-A-Sign-that-PHP-Could-Soon-be-Owned-by-Sun/" title="A Sign that PHP Could Soon be Owned by Sun">interesting 
 article</a> speculating on how the new changes in PHP5 can be a sign that it <em>might</em> 
be owned by Sun in the near future.</p>

<p>Well, the new changes in PHP5 <em>are</em> tremendous, and they do bring PHP5 
much closer to Java in terms of OO design, except PHP5 isn&#8217;t Java, and probably 
it&#8217;ll never be!</p>

<p>What makes <acronym title="Hypertext PreProcessing">PHP</acronym> compelling to new comers isn&#8217;t how it handles OO, it isn&#8217;t <a href="http://pear.php.net" title="PHP Extension and Application 
Repository">PEAR</a>, and it certainly isn&#8217;t that it can be mixed with <acronym title="HyperText Markup Language">HTML</acronym> 
code, barely anyone uses that; it&#8217;s that it&#8217;s easy to pick up compared to other 
languages, like Perl for instance. If PHP loses this, it won&#8217;t be as appealing 
as it is now, so it&#8217;s not in anyone&#8217;s benefit for PHP to become, God forbid, 
Java; we already have one.</p>

<p>PHP is an open-source project, probably not in a way that <acronym title="Free Software Foundation">FSF</acronym> would define it, 
but still, you can have the source code, play with it, even compile it and sell 
it, it&#8217;s nobody&#8217;s business. This is to PHP&#8217;s advantage, and a lot of develops feel 
somehow secure knowing that even if a company like Sun acquires Zend, they can 
still fork the whole project and go in separate ways. That doesn&#8217;t mean that if 
Sun does acquire Zend is a necessarily bad thing, it might for PHP&#8217;s own good. But 
the fact that Sun is considered a not-so-open-source by many pro-open source 
develops, can be disturbing.</p>

<p>I personally agree more with 
<a href="http://www.technetra.com/Writings/recent/interview_lerdorf_html/view" title="Rasmus Lerdorf, PHP Guru">Rasmus&#8217;s view</a> on where should PHP 
go from here, namely to Parrot. It runs better, it&#8217;s interoperability with other 
languages running on Parrot reduces code rewrite, and can easily compete 
in Java&#8217;s market, and probably .NET&#8217;s too. I don&#8217;t think there&#8217;s any there&#8217;s any 
real reason for developers to worry about PHP&#8217;s future, we&#8217;ll still be able 
to write scripts and applications in PHP without having to put any 
commercial threat into much consideration.</p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2004/08/07/php_owned_by_sun/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Some PHP5 Gotchas</title>
		<link>http://ramikayyali.com/archives/2004/08/04/php5_gotchas</link>
		<comments>http://ramikayyali.com/archives/2004/08/04/php5_gotchas#comments</comments>
		<pubDate>Wed, 04 Aug 2004 16:19:01 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject><dc:subject>PHP</dc:subject><dc:subject>PHP5</dc:subject><dc:subject>Tips</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2004/08/04/php5_gotchas</guid>
		<description><![CDATA[Fiddling around with PHP5, I&#8217;ve stumbled upon some interesting gotchas, some
of them might be too obvious to mention, but sometimes the obvious is only too 
obvious that we don&#8217;t even notice.

Static variables and functions

PHP5 supports both static variables and functions (i.e. do not 
need an instance to be called), but for some reason, PHP5 doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Fiddling around with PHP5, I&#8217;ve stumbled upon some interesting gotchas, some
of them might be too obvious to mention, but sometimes the obvious is only too 
obvious that we don&#8217;t even notice.</p>

<h3>Static variables and functions</h3>

<p>PHP5 supports both <code>static</code> variables and functions (i.e. do not 
need an instance to be called), but for some reason, PHP5 doesn&#8217;t allow 
overriding static variables in a subclass:</p>

<p><code>
<br />&lt;?php<br />
class Base<br />
{<br />&nbsp;&nbsp;&nbsp;&nbsp;static 
$var = 
4;<br />}<br /><br />
class Sub 
extends Base<br />
{<br />&nbsp;&nbsp;&nbsp;&nbsp;static 
$var = 
5;<br />}<br />
?&gt;<br />
</code></p>

<p><em><b>Fatal error</b>: Cannot redeclare property static public Base::$var in 
class Sub in <b>/path/to/script.php</b> on line <b>13</b></em></p>

<p>Interestingly enough, static functions <em>can</em> can be overridden, so the 
following code would run without any errors:</p>

<p><code>
<br />&lt;?php<br />
class Base<br />
{<br />&nbsp;&nbsp;&nbsp;&nbsp;static function 
func()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
echo &#8220;Called from Base\n&#8221;
;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br />
<br />class Sub 
extends 
Base<br />
{<br />&nbsp;&nbsp;&nbsp;&nbsp;static function 
func()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
echo &#8220;Called from Sub\n&#8221;
;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br />
Base::func(); 
// outputs &#8220;Called from Base&#8221;<br />
Sub::func(); 
// outputs &#8220;Called from Sub&#8221;<br />
?&gt;<br />
</code></p>

<h3>Variable class names</h3>

<p>Methods cannot be called statically if the class name is stored in a variable, 
I&#8217;m not very sure why, but I&#8217;d guess it was too much of a headache to implement.
For example:</p>

<p><code>
<br />&lt;?php<br />
class Base<br />
{<br />&nbsp;&nbsp;&nbsp;&nbsp;static function 
func()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
echo &#8220;Called from Base\n&#8221;
;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br />
$class = 
&#8216;Base&#8217;;<br />
$class::func(); 
// WRONG!<br />?&gt;
<br /></code></p>

<p>Would generate:</p>

<p><em><b>Parse error</b>: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM in 
<b>/path/to/script.php</b> on line <b>52</b></em></p>

<p>The only way to do it is to use <code>call_user_func()</code> or 
<code>call_user_func_array()</code>. Using the above <code>Base</code> class, this is 
how <code>func()</code> should be called:</p>

<p><code>
<br />&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;call_user_func(array($class, &#8216;func&#8217;));<br />?&gt;<br /></code></p>

<p> Same applies to calling class constants, there&#8217;s no way to get a class 
constant with a variable class name without using <code>constant()</code>.</p>

<p><code>
<br />&lt;?php<br />
class Base<br />
{<br />&nbsp;&nbsp;&nbsp;&nbsp;const 
BASE_CONST = 
&#8216;CONST_VALUE&#8217;;<br />}
<br /><br />$class 
= &#8216;Base&#8217;
;<br />echo $class::BASE_CONST; // WRONG!<br />
echo constant(&#8221;$class::BASE_CONST&#8221;); // RIGHT<br />
?&gt;<br /></code></p>

<p>&nbsp;</p>

<p>I know that these are some picky stuff, but I still would like <acronym title="Hypertext PreProcessing">PHP</acronym> to support these, 
because at the very least, the code would look better.</p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2004/08/04/php5_gotchas/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP5 Released!</title>
		<link>http://ramikayyali.com/archives/2004/07/15/php5</link>
		<comments>http://ramikayyali.com/archives/2004/07/15/php5#comments</comments>
		<pubDate>Thu, 15 Jul 2004 16:54:12 +0000</pubDate>
		<dc:creator>Rami Kayyali</dc:creator>
		
	<dc:subject>PHP</dc:subject><dc:subject>PHP5</dc:subject>
		<guid isPermaLink="false">http://ramikayyali.com/wordpress/archives/2004/07/15/php5</guid>
		<description><![CDATA[Congratulations, finally PHP5 is released, grab yourself a fresh copy now.

Now all is left is to actually make use of it, for some weird reason I feel
that PHP4 will stick around for a while. Still, expect pains and sleepless
upgrade nights, you never know what your boss might say.]]></description>
			<content:encoded><![CDATA[<p>Congratulations, finally PHP5 is released, grab yourself <a href="http://php.net/downloads.php#v5">a fresh copy now</a>.</p>

<p>Now all is left is to actually make use of it, for some weird reason I feel
that PHP4 will stick around for a while. Still, expect pains and sleepless
upgrade nights, you never know what your boss might say.</p>]]></content:encoded>
			<wfw:commentRss>http://ramikayyali.com/archives/2004/07/15/php5/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
