<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>open core</title>
	
	<link>http://blog.rogeriopvl.com</link>
	<description>I like my coffee black, just like my macbook...</description>
	<lastBuildDate>Wed, 10 Jun 2009 20:24:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/rogeriopvl" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Apple keyboard</title>
		<link>http://blog.rogeriopvl.com/archives/apple-keyboard</link>
		<comments>http://blog.rogeriopvl.com/archives/apple-keyboard#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:23:33 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[keyboard]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=630</guid>
		<description><![CDATA[
After of some weeks flirting with the Apple keyboard, today I finally bought it. I&#8217;m writing  this post with it. And I can only say that this is the best keyboard one can have. It&#8217;s very slim and the typing is smooth, actually is pretty much the same as the new macbook keyboard.
I bought [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img src="http://blog.rogeriopvl.com/wp-content/uploads/apple_keyboard.jpg" alt="apple usb keyboard" width="450" /></p>
<p>After of some weeks flirting with the <a href="http://www.apple.com/keyboard">Apple keyboard</a>, today I finally bought it. I&#8217;m writing  this post with it. And I can only say that this is the best keyboard one can have. It&#8217;s very slim and the typing is smooth, actually is pretty much the same as the new macbook keyboard.</p>
<p>I bought it to use at work, mainly because working endless hours in a laptop can injure your back and an external keyboard allows me to vary my posture when sitting in front of the macbook. Another reason, is that in summer time, having my hands resting in a macbook pro, turns out to be a hot and sweaty experience.</p>
<p>I opted for the USB version because I don&#8217;t really like batteries at all, and I wouldn&#8217;t be very tolerant with random bluetooth disconnects. Although the keyboard USB cable is short, Apple was king enough to include an extension for those who need a longer cable.</p>
<p style="text-align: center;"><img src="http://blog.rogeriopvl.com/wp-content/uploads/apple_keyboard_cable.jpg" alt="apple keyboard usb extension" width="450"/></p>
<p>Here&#8217;s the Apple keyboard side by side with my old <a href="http://www.driverheaven.net/reviews/Revoltec%20Lightboard%20XL%202/">Revoltec Lightboard</a>, so you can get an ideia about the size of this thing:</p>
<p style="text-align: center;"><img src="http://blog.rogeriopvl.com/wp-content/uploads/apple_keyboard_vs_revoltec.jpg" alt="The apple keyboard vs revoltec lightboard" width="450"/></p>
<p>Just to end this post, as you can see on the first picture, I bought this keyboard at <a href="http://www.tbstore.pt">TB Store</a> in Colombo. I definitely recommend this store to buy Apple stuff. Great customer service, nice and unusual bags for the shopped products and bonus key chain lanyards.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/apple-keyboard/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding unnecessary risks with your Google account</title>
		<link>http://blog.rogeriopvl.com/archives/avoiding-unnecessary-risks-with-your-google-account</link>
		<comments>http://blog.rogeriopvl.com/archives/avoiding-unnecessary-risks-with-your-google-account#comments</comments>
		<pubDate>Tue, 09 Jun 2009 14:52:14 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[clickjacking]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[gmail]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=608</guid>
		<description><![CDATA[Almost everybody nowadays has a Gmail/Google account. We use it for our email service, to read our feeds, store our bookmarks, edit our documents, and what not. This demands that we constantly log in to these services with our google account user and password. The most &#8220;paranoid&#8221; users, never check the &#8220;keep me logged in&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Almost everybody nowadays has a Gmail/Google account. We use it for our email service, to read our feeds, store our bookmarks, edit our documents, and what not. This demands that we constantly log in to these services with our google account user and password. The most &#8220;paranoid&#8221; users, never check the &#8220;keep me logged in&#8221; checkbox, while the majority just checks it and doesn&#8217;t even bother anymore.</p>
<p>If you &#8220;worship&#8221; your google account, and the idea of losing it sounds catastrophic to you, because all your life is in it. You might just keep on reading this post.</p>
<h2>What&#8217;s the problem?</h2>
<p>The web is mostly an unsafe place, and having your google account logged while browsing &#8220;random&#8221; web sites, might be a russian roulette experience. Because with some recent techniques like <a href="http://en.wikipedia.org/wiki/Clickjacking">clickjacking</a>, an attacker might set up a web page with malicious code that uses your logged in google account session to perform actions on your behalf. And if you don&#8217;t believe this, you can try for your self in the following example.</p>
<p>You can try this using a dummy Gmail account if you feel insecure about it.</p>
<p>Log in to your dummy Gmail account, open a new tab and go to <a href="http://www.sirdarckcat.net/gmailclickjacking.html">this website</a>. Now click the &#8220;send&#8221; button on the page, and go check your dummy Gmail sent messages folder. You will see that you have just sent an email, without even noticing (well you did notice actually if you checked the status bar, but it was too late anyway).</p>
<p>The way to achieve a hack like this is not very complex. Quoting the <a href="http://www.sirdarckcat.net">author</a>:</p>
<blockquote style="font-style: oblique;">
<p>You get a copy of the generated HTML code of the target webpage, then you simply hide everything, except for the button you want to overlay.. you could draw other things using absolute positioning, but this is enough for most scenarios.</p>
<p>You can checkout the &#8220;ghost page&#8221; here: http://www.sirdarckcat.net/dad.html</p>
<p>This attack has it&#8217;s pros and it&#8217;s cons.. the most important pro is that it&#8217;s the best way of doing cross-browser exploits.. since you don&#8217;t depend on the sizes, margins, overflow rules etc.. that different browsers use.</p>
</blockquote>
<h2>Possible solutions?</h2>
<p>The best way to prevent against these attacks, while it may not be the ideal solution, is by simply reducing the time you spend logged in on the browser. Actually, you can even use these services with no logged session on the browser.</p>
<p>The answer is simple: don&#8217;t use these services web interface on your personal computer. For Gmail, use a POP or IMAP client of your choice, for every other, use <a href="http://prism.mozilla.com">Prism</a>. Prism lets you run web applications in a desktop/standalone mode. This way you have all your sessions encapsulated, in a kind of sandbox way. Leaving you free to use the browser in a more relaxed manner.</p>
<p>Why do I say &#8220;on personal computer&#8221; ? Because it&#8217;s in your daily use machine that you are more tempted to save login forms and such, leaving you vulnerable to the type of attacks I described. On other machines you are less tempted to do that, because it&#8217;s not your machine, or it&#8217;s a public computer, and you spend much less time on it.</p>
<p>While I&#8217;ve been talking about Google accounts and Gmail along this post, actually, every other service may be vulnerable to this type of attack, but generally Google services are usually more secured than the rest.</p>
<h2>What can web developers do?</h2>
<p>Not much really. For web developers, the way to prevent that your site gets opened in a <code>iframe</code> is the piece of code known as &#8220;<a href="http://en.wikipedia.org/wiki/Framekiller">the Framekiller</a>&#8220;. This is a javascript code snippet to include in your HTML pages:</p>
<pre class="code">
&lt;script type="text/javascript"&gt;
if (top !== self) top.location.replace(self.location.href);
&lt;/script&gt;
</pre>
<p>This works with the obvious javascript/client side limitations, so it shouldn&#8217;t be regarded as a reliable approach, but it definitely helps.</p>
<h2>More on the subject</h2>
<p>If you wish to know more about other similar techniques, you can check these links below:</p>
<p><a href="http://sirdarckcat.blogspot.com/2008/10/about-css-attacks.html">CSS Attacks</a></p>
<p><a href="http://www.sectheory.com/clickjacking.htm">Clickjacking</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/avoiding-unnecessary-risks-with-your-google-account/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TwitterPHP 0.5 released and lessons learned…</title>
		<link>http://blog.rogeriopvl.com/archives/twitterphp-05-released-and-lessons-learned</link>
		<comments>http://blog.rogeriopvl.com/archives/twitterphp-05-released-and-lessons-learned#comments</comments>
		<pubDate>Sun, 24 May 2009 20:37:54 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitterphp]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=599</guid>
		<description><![CDATA[I&#8217;ve released this Friday a new version of the TwitterPHP library. In this version I&#8217;ve done some code optimization, removed some files and changed to Doxygen for class documentation.
First, all methods were returning a SimpleXML object, which is a mistake in terms of flexibility. I&#8217;ve changed them all to just return a XML string. Now [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve released this Friday a new version of the <a href="http://twitterphp.googlecode.com">TwitterPHP library</a>. In this version I&#8217;ve done some code optimization, removed some files and changed to <a href="http://www.doxygen.org">Doxygen</a> for class documentation.</p>
<p>First, all methods were returning a SimpleXML object, which is a mistake in terms of flexibility. I&#8217;ve changed them all to just return a XML string. Now its up to the user (programmer) to choose the way to access/parse the XML.</p>
<p>Second, TwitterPHP is a class, you can instantiate it several times, for let&#8217;s say, accessing multiple accounts. At least you should be able to do that, but since I was reading the Twitter username and password from a configuration file (naive, I know), multiple instances could only use the same account. Now the problem is solved by simply adding the username and password as arguments of the constructor method and removing the configuration file.</p>
<p>Third and last, I switched from <a href="http://www.phpdoc.org/">PHPDocumentor</a> to Doxygen. This was mainly because I found out that Doxygen is much more flexible, I can use it with any other project with any other language. And the resulting documentation is more fast and clean than PHPDocumentor.</p>
<p>So you can take a look at the new version of TwitterPHP <a href="http://twitterphp.googlecode.com">here</a> and the documentation generated by Doxygen <a href="http://rogeriopvl.com/twitterphp/doc">here</a>.</p>
<p>In future releases I&#8217;m planning to add <a href="http://apiwiki.twitter.com/OAuth-FAQ">OAuth</a> support and implement more Twitter API actions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/twitterphp-05-released-and-lessons-learned/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object Oriented Javascript</title>
		<link>http://blog.rogeriopvl.com/archives/object-oriented-javascript</link>
		<comments>http://blog.rogeriopvl.com/archives/object-oriented-javascript#comments</comments>
		<pubDate>Wed, 13 May 2009 23:12:11 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[oo]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=589</guid>
		<description><![CDATA[Recently, I&#8217;ve been playing with Object Oriented Javascript. This language, besides it&#8217;s chaotic nature, can be very powerful when used with some best practices (humm, that&#8217;s funny, I&#8217;d swear I&#8217;ve heard this before).
One of the most interesting things about Javascript OO is the way to define a Class. Actually there is no keyword &#8220;class&#8221; at [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve been playing with Object Oriented Javascript. This language, besides it&#8217;s chaotic nature, can be very powerful when used with some best practices (humm, that&#8217;s funny, I&#8217;d swear I&#8217;ve heard <a href="http://php.net">this before</a>).</p>
<p>One of the most interesting things about Javascript OO is the way to define a Class. Actually there is no keyword &#8220;class&#8221; at all. So here&#8217;s an example on how to create a class <code>Book</code> in Javascript:</p>
<pre class="bigcode">
/**this will be the constructor method,
that automatically creates the class**/

function Book (isbn, title, author) {
    this.isbn = isbn;
    this.title = title;
    this.author = author;
}

/** And now the getters **/

Book.prototype.getISBN = function () {
    return this.isbn;
}

Book.prototype.getTitle = function () {
    return this.title;
}

Book.prototype.getAuthor = function () {
    return this.author;
}
</pre>
<p>If your class has attributes that are not passed as constructor arguments, you can declare the attribute just like we did for the methods:</p>
<pre class="code">
Book.prototype.numTimesRead = 5;

//a setter
Book.prototype.setNumTimeRead = function (n) {
    this.numTimesRead = n;
}
</pre>
<p>Now if we wish to instantiate our class, it&#8217;s identical to most OO languages:</p>
<pre class="code">
var mybook = new Book("123", "Dive into Python", "Mark Pilgrim");

//I tried to output this the ugliest way possible :P
document.getElementsByTagName("body").innerHTML = "Title: "+mybook.getTitle();
</pre>
<p>This will (<del><a href="http://en.wikipedia.org/wiki/Pwn">pwn</a> your body element</del>) print the Book title, you can add any other info as you wish.</p>
<p>You may find more on object oriented programming with Javascript at the <a href="https://developer.mozilla.org/en/Introduction_to_Object-Oriented_JavaScript">Mozilla&#8217;s Developer site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/object-oriented-javascript/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Extreme Programming</title>
		<link>http://blog.rogeriopvl.com/archives/extreme-programming</link>
		<comments>http://blog.rogeriopvl.com/archives/extreme-programming#comments</comments>
		<pubDate>Sun, 19 Apr 2009 11:52:00 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[extreme programming]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=582</guid>
		<description><![CDATA[Some time ago, I&#8217;ve written a post talking about Agile Software Development methodologies, where I mentioned Extreme Programming (aka XP).
I was thinking about writing a post on Extreme Programming, but I&#8217;ve just found a very good video of a lecture on the subject by Richard Buckland, that explains it the best way possible and with [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I&#8217;ve <a href="http://blog.rogeriopvl.com/archives/agile-software-development-wrong-or-right">written a post</a> talking about Agile Software Development methodologies, where I mentioned Extreme Programming (aka XP).</p>
<p>I was thinking about writing a post on Extreme Programming, but I&#8217;ve just found a very good video of a lecture on the subject by <a href="http://www.cse.unsw.edu.au/~richardb/">Richard Buckland</a>, that explains it the best way possible and with some humor. So here&#8217;s the video:</p>
<p style="text-align: center"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/XP4o0ArkP4s&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XP4o0ArkP4s&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>This is a highly recommended video for those that want to learn about Extreme Programming and Unit Tests.</p>
<p><strong>Video Link: </strong> <a href="http://youtube.com/watch?v=XP4o0ArkP4s">http://youtube.com/watch?v=XP4o0ArkP4s</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/extreme-programming/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TinyURL reversing</title>
		<link>http://blog.rogeriopvl.com/archives/tinyurl-reversing</link>
		<comments>http://blog.rogeriopvl.com/archives/tinyurl-reversing#comments</comments>
		<pubDate>Mon, 13 Apr 2009 08:46:53 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[foresee]]></category>
		<category><![CDATA[tinyurl]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=544</guid>
		<description><![CDATA[TinyURL is a online service that shortens long URL&#8217;s so that they can save space in services like Twitter and others.
This is definitely a tool of great convenience, but like almost everything in life, has a drawback. Actually, two drawbacks. First, spammers, phishers and alike are using this service to mask the URL of their [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tinyurl.com">TinyURL</a> is a online service that shortens long URL&#8217;s so that they can save space in services like <a href="http://www.twitter.com">Twitter</a> and others.</p>
<p>This is definitely a tool of great convenience, but like almost everything in life, has a drawback. Actually, two drawbacks. First, spammers, phishers and alike are using this service to mask the URL of their malicious website so that when someone sees the link, feels comfortable about clicking it, and unaware of what&#8217;s coming. And second, it&#8217;s slowly building a &#8220;broken&#8221; web, because if this kind of services disappear, a good portion of links on the web won&#8217;t work anymore. And this can&#8217;t be good.</p>
<p>Against the first drawback, TinyURL has a feature that allows you to send a preview link instead of an instant redirection one, but it&#8217;s hardly used by anyone.</p>
<p>Some time ago, I developed a <a href="http://rogeriopvl.com/foresee">small online tool</a> that unveils every tinyurl that is sent to it. But its usefulness is almost none, since no one will bother to visit another website just to unveil the tinyurl&#8217;s target. So, to simplify that process, I&#8217;m developing a <a href="http://addons.mozilla.org">Firefox Extension</a> that integrates with the tool, so that when you visit a tinyurl, before that url is loaded, is passed trough the reverser and the target is shown on a confirmation popup or just a tooltip.</p>
<p>While the extension is not ready, I leave you here a small example of how to reverse a tinyurl in PHP. It&#8217;s very simple, and straightforward:</p>
<pre class="code">
function reverse_tinyurl($url){
	$url = explode('.com/', $url);
	$url = 'http://preview.tinyurl.com/'.$url[1];
	$prev = file_get_contents($url);
	preg_match('/redirecturl" href="(.*)">/', $prev, $res);
	return $res[1];
}
</pre>
<p>Well, or maybe if you prefer Ruby:</p>
<pre class="code">
require 'rubygems'
require 'net/http'

def reverse_tinyurl(url)
    url_parts = url.split('.com/')
    preview_url = "http://preview.tinyurl.com/#{url_parts[1]}"
    response = Net::HTTP.get_response(URI.parse(preview_url))
    original_url = response.body.scan(/redirecturl" href="(.*)">/)[0][0]
end
</pre>
<p>Or if you are more of a Python guy/girl: </p>
<pre class="code">
from lxml import etree

def reverse_tinyurl(url):
    hash = url[url.find(".com/")+5:]
    preview_url = "http://preview.tinyurl.com/"+hash
    parser = etree.HTMLParser()
    tree = etree.parse(preview_url, parser)
    elem = tree.findall('.//a[@id="redirecturl"]')
    if len(elem) == 1:
        return elem[0].get("href")
    return None
</pre>
<p>This examples should get you started on developing something around this.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/tinyurl-reversing/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Macbook RAM upgrade</title>
		<link>http://blog.rogeriopvl.com/archives/macbook-ram-upgrade</link>
		<comments>http://blog.rogeriopvl.com/archives/macbook-ram-upgrade#comments</comments>
		<pubDate>Tue, 24 Mar 2009 00:07:04 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=567</guid>
		<description><![CDATA[
I decided to upgrade the ram of my black macbook. I was noticing it getting slower on some more demanding apps, so I upgraded it from 1Gb to 4Gb (2&#215;2Gb) Kingston RAM. Damn it&#8217;s fast now! :D
By the way, I decided to post this on the blog and not on Twitter just for a change [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img src="http://blog.rogeriopvl.com/wp-content/uploads/ram.png" alt="macbook 4Gb of ram" /></p>
<p>I decided to upgrade the ram of my black macbook. I was noticing it getting slower on some more demanding apps, so I upgraded it from 1Gb to 4Gb (2&#215;2Gb) Kingston RAM. Damn it&#8217;s fast now! :D</p>
<p>By the way, I decided to post this on the blog and not on Twitter just for a change :P</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/macbook-ram-upgrade/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP files – Closing the PHP tag or not?</title>
		<link>http://blog.rogeriopvl.com/archives/php-files-closing-the-php-tag-or-not</link>
		<comments>http://blog.rogeriopvl.com/archives/php-files-closing-the-php-tag-or-not#comments</comments>
		<pubDate>Wed, 04 Mar 2009 23:52:58 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=556</guid>
		<description><![CDATA[Allot of people think that a PHP file without a closing tag, is not also strange but wrong and won&#8217;t compile. But that&#8217;s far from the truth. In fact, even Zend (the company behind the PHP language) forbids its use in the Zend Framework.
Here&#8217;s an example:

&#60;?php

function foobar ($foo) {
    echo $foo;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Allot of people think that a PHP file without a closing tag, is not also strange but wrong and won&#8217;t compile. But that&#8217;s far from the truth. In fact, even Zend (the company behind the PHP language) <a href="http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general">forbids its use</a> in the Zend Framework.</p>
<p>Here&#8217;s an example:</p>
<pre class="code">
&lt;?php

function foobar ($foo) {
    echo $foo;
    return 0;
}
</pre>
<p>Most programmers in a file like this, would put a <code>?></code> in the end. It&#8217;s ok. But in PHP-only files, it&#8217;s not recommended.</p>
<p>How come this is a good practice? Well, first of all, the PHP interpreter won&#8217;t complain about a missing closing tag.  And second, the most important, is that leaving the file without a closing tag will avoid accidental injection of trailing whitespace into the response.</p>
<p>Quoting <a href="http://devzone.zend.com/manual/language.basic-syntax.instruction-separation.html">Zend manual</a>: </p>
<blockquote>
<p>The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include() or require(), so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.</p>
</blockquote>
<p>Off course that there are <a href="http://www.galvao.eti.br/wordpress/?p=98">people  radically disagreeing with this</a>. They point out that leaving the PHP tag open is programming lazyness (although I don&#8217;t see how anyone can be lazy about writing two characters) and they also state that it&#8217;s fear, it&#8217;s an &#8220;easy and safe solution&#8221;. Well the &#8220;easy&#8221; part it makes some sense, but the &#8220;safe&#8221; one?! Oh, ok&#8230; let&#8217;s just fire all the security conscious programmers! Who needs security? Security is bad. Not. PHP already has a very bad reputation because of his kind of attitude.</p>
<p>I&#8217;m sure there are better arguments against this, but my opinion is to leave it open, don&#8217;t close the tag, it can bring unnecessary problems. It won&#8217;t harm your PHP code and won&#8217;t make you lose hours trying to debug some invisible white spaces.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/php-files-closing-the-php-tag-or-not/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TwitterPHP</title>
		<link>http://blog.rogeriopvl.com/archives/twitterphp</link>
		<comments>http://blog.rogeriopvl.com/archives/twitterphp#comments</comments>
		<pubDate>Wed, 25 Feb 2009 09:03:34 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=549</guid>
		<description><![CDATA[I&#8217;ve created this project in order to simplify the process of interacting with the Twitter API on a project I&#8217;m working on. So I decided to release it as open-source so that others could use it if they find it useful.
What is TwitterPHP? It&#8217;s an object-oriented and easy to use PHP library to interact with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created this project in order to simplify the process of interacting with the Twitter API on a project I&#8217;m working on. So I decided to release it as open-source so that others could use it if they find it useful.</p>
<p>What is TwitterPHP? It&#8217;s an object-oriented and easy to use PHP library to interact with the Twitter API. It is still in development but it has almost every API feature implemented, which makes it the most complete of it&#8217;s kind (at least from what I&#8217;ve seen out there, please correct me if I&#8217;m wrong). You can do lots of stuff with TwitterPHP, you can write your own client, or bot, or even just use it to display twitter info on your blog or website.</p>
<p>You can check out the <a href="http://twitterphp.googlecode.com">Google Code project page</a> and soon I will <a href="http://rogeriopvl.com/twitterphp">host the phpdoc online</a>, to make it easier (but it&#8217;s already included in the zip file).</p>
<p><strong>Link:</strong> <a href="http://twitterphp.googlecode.com">twitterphp.googlecode.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/twitterphp/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Some days are just like this…</title>
		<link>http://blog.rogeriopvl.com/archives/some-days-are-just-like-this</link>
		<comments>http://blog.rogeriopvl.com/archives/some-days-are-just-like-this#comments</comments>
		<pubDate>Fri, 20 Feb 2009 10:37:30 +0000</pubDate>
		<dc:creator>rogeriopvl</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://blog.rogeriopvl.com/?p=546</guid>
		<description><![CDATA[
Image taken from here
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://blog.rogeriopvl.com/wp-content/uploads/modern-life.jpg" alt="modern life..." /></p>
<p>Image taken from <a href="http://www.ruben-alves.com/index.php?p=blog&#038;id=431">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rogeriopvl.com/archives/some-days-are-just-like-this/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
