<?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/"
	>

<channel>
	<title>Internet Strategy Guide &#187; derick rethans</title>
	<atom:link href="http://phpprotip.com/tag/derick-rethans/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpprotip.com</link>
	<description>Together we can defeat the internet</description>
	<lastBuildDate>Sat, 11 Feb 2012 01:39:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>tekx &#8211; xdebug</title>
		<link>http://phpprotip.com/2010/05/tekx-xdebug/</link>
		<comments>http://phpprotip.com/2010/05/tekx-xdebug/#comments</comments>
		<pubDate>Thu, 20 May 2010 16:13:07 +0000</pubDate>
		<dc:creator>chance</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phptek]]></category>
		<category><![CDATA[tekx]]></category>
		<category><![CDATA[Debugger]]></category>
		<category><![CDATA[derick rethans]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://phpprotip.com/?p=264</guid>
		<description><![CDATA[Image via Wikipedia Today's session is given by derick rethans, the author of xdebug so he might know what he's talking about. Xdebug provides protections against things like stack overflow in PHP and infinite recursion. You can set this by setting the nesting level. It also provides a pretty formatted errors but not only is [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 210px;">
<dt class="wp-caption-dt"><a href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9JbWFnZTpYZGVidWctbG9nby5wbmc="><img title="Xdebug" src="http://phpprotip.com/wp-content/uploads/2010/05/Xdebug-logo.png" alt="Xdebug" width="200" height="116" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9JbWFnZTpYZGVidWctbG9nby5wbmc=">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Today's session is given by <a class=\"zem_slink\" title=\"Derick Rethans\" rel=\"blog\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Rlcmlja3JldGhhbnMubmw=">derick rethans</a>, the author of xdebug so he might know what he's talking about. <img src='http://phpprotip.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a class=\"zem_slink freebase/guid/9202a8c04000641f800000000c48ae0b\" title=\"Xdebug\" rel=\"homepage\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy54ZGVidWcub3JnLw==">Xdebug</a> provides protections against things like <a class=\"zem_slink freebase/en/stack_overflow\" title=\"Stack overflow\" rel=\"wikipedia\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9TdGFja19vdmVyZmxvdw==">stack overflow</a> in <a class=\"zem_slink freebase/en/php\" title=\"PHP\" rel=\"homepage\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0Lw==">PHP</a> and <a class=\"zem_slink freebase/en/infinite_loop\" title=\"Infinite loop\" rel=\"wikipedia\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9JbmZpbml0ZV9sb29w">infinite recursion</a>. You can set this by setting the nesting level. It also provides a pretty formatted errors but not only is it pretty but it provides more information such as memory usage, time, function name and location on items in the <a class=\"zem_slink freebase/en/call_stack\" title=\"Call stack\" rel=\"wikipedia\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9DYWxsX3N0YWNr">call stack</a>. It can also collect parameter information which shows the type with options to display the variable name (if possible) or values. It opts to minimal information to prevent crashing html displays with the browsers.</p>
<p>Another hot option is the ability to link to the files. The var_dump is overloaded to create a pretty, color-coded output. You can turn this off by setting the overload vardump option to 0.</p>
<p><span id="more-264"></span></p>
<h2>Function trace</h2>
<p>You have to be careful with this because it can cause you to run out of disk space. What you will see is trace start, memory usage, nesting level. Green lines will show return value. One useful case is for realpath() to determine if the issue is the file doesn't exist. It can show if you change the property of an element as well as modified variables. The trace filename output can be specified which allows you to create files for specific URLs or whatever you require. There is a script in the contributions directory that can help in xdebug output analysis.</p>
<p>You can trace select parts of the application with the xdebug_start_trace() and xdebug_stop_trace() methods.</p>
<h2>Scream</h2>
<p>PHP's @ (shutup) operator hides warnings and errors. Setting xdebug.scream=1 makes PHP ignore @.</p>
<h2>Recording headers</h2>
<p>Xdebug collects all headers being set, implicitly and explicitly. This is awesome for testing and <a class=\"zem_slink freebase/en/unit_test\" title=\"Unit testing\" rel=\"wikipedia\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Vbml0X3Rlc3Rpbmc=">unit-tests</a>. The function is called xdebug_get_headers().</p>
<h2><a class=\"zem_slink freebase/en/code_coverage\" title=\"Code coverage\" rel=\"wikipedia\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Db2RlX2NvdmVyYWdl">Code coverage</a></h2>
<p>If you use xdebug_start_code_coverage(), it will only monitor files parsed after the call. There is a tool called 'phpcov' that will render the output in a better format. Since the tool was written by @<a class=\"zem_slink\" title=\"Sebastian Bergmann\" rel=\"blog\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NlYmFzdGlhbi1iZXJnbWFubi5kZS8=">s_bergmann</a>, the views look similar to phpunit coverage view.</p>
<p>The profiler looks pretty hot, didn't catch the name of it but it gives a visual representation of the program execution (I think...I'm not exactly sure what i'm looking at other than it deals with profiling).</p>
<p>DBGp = common debugging protocol.</p>
<h2>Activating the remote debugger</h2>
<p>You enable the remote ability, need to set the host and port. On the shell, you'll need to export a parameter or set a unique session in your browser. Firefox and Chrome have plugins. easy Xdebug is for firefox and Xdebug Helper is available for Chrome.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class=\"zemanta-pixie-a\" title=\"Reblog this post [with Zemanta]\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlYmxvZy56ZW1hbnRhLmNvbS96ZW1pZmllZC9mNzIyN2JiMy03YTRjLTQyZWYtOTE1ZC0yMWI3NDgxOGQ5ZWUv"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_a.png?x-id=f7227bb3-7a4c-42ef-915d-21b74818d9ee" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
 <img src="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=264" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://phpprotip.com/2010/05/tekx-xdebug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>tekx &#8211; date and time with derick rethans</title>
		<link>http://phpprotip.com/2010/05/tekx-date-and-time-with-derick-rethans/</link>
		<comments>http://phpprotip.com/2010/05/tekx-date-and-time-with-derick-rethans/#comments</comments>
		<pubDate>Wed, 19 May 2010 17:36:41 +0000</pubDate>
		<dc:creator>chance</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[phptek]]></category>
		<category><![CDATA[tekx]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[derick rethans]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timezones]]></category>

		<guid isPermaLink="false">http://phpprotip.com/?p=224</guid>
		<description><![CDATA[Image via Wikipedia We're starting with a map of the world showing the 24 major timezones. Timezone changes (daylight savings times) make things tricky. The abbreviations for timezones aren't enough to determine the user's timezone. EST can mean different things. The 64-bit signed integer used internally provides more than enough time for us to use [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NvbW1vbnMud2lraXBlZGlhLm9yZy93aWtpL0ltYWdlOjIwMDctMDItMjBfdGltZV96b25lcy5zdmc="><img title="This is an SVG version of the Time Zone map fr..." src="http://phpprotip.com/wp-content/uploads/2010/05/300px-2007-02-20_time_zones.svg_.png" alt="This is an SVG version of the Time Zone map fr..." width="300" height="160" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2NvbW1vbnMud2lraXBlZGlhLm9yZy93aWtpL0ltYWdlOjIwMDctMDItMjBfdGltZV96b25lcy5zdmc=">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>We're starting with a map of the world showing the 24 major timezones. <a class=\"zem_slink freebase/en/time_zone\" title=\"Time zone\" rel=\"wikipedia\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9UaW1lX3pvbmU=">Timezone</a> changes (daylight savings times) make things tricky. The abbreviations for timezones aren't enough to determine the user's timezone. EST can mean different things.</p>
<p>The 64-bit signed integer used internally provides more than enough time for us to use (+/- 90 billion years if I heard correctly). strtotime() and functions with timestamps have been replaced with classes (such as new DateTime()).</p>
<p>The bundled timezone database has 564 zones so far that isn't dependent on timezone abbreviations. They have the format Continent/Location or Continent/Location/Sublocation like Europe/Amsterdam. Updated database is released 20 times a year. Some changes are very sudden. Basically, you're timezone database is probably outdated.</p>
<p><span id="more-224"></span></p>
<p>You can set the default timezone with a function or the DateTime object. <a class=\"zem_slink freebase/en/php\" title=\"PHP\" rel=\"homepage\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5waHAubmV0Lw==">PHP</a> guesses it in the following order:</p>
<ul>
<li>date_default_timezone_set()</li>
<li>TZ environment variable</li>
<li>php.ini's date.timezone setting</li>
<li>system's rendering of timezone abbreviation.</li>
</ul>
<p>PHP 5.3 will not guess and will complain.</p>
<p>You can parse strings with the date_parse() function.</p>
<p>The DateTime object seems very powerful. It allows you to modify times and will account for time zone changes for some of its other uses.</p>
<p>I'm thinking I'll have to wait for slides, lots of code examples that I'm having a hard time figuring out how to explain in a post. In regards to relative time, remember that time always moves forward. If the date is Wednesday, asking for Tuesday will get the next Tuesday. Yeah, the code examples and output are probably better but will have to wait until I can link to them.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLmJsb2cud29yZHByZXNzLmNvbS8yMDEwLzAzLzE0L2Jsb2ctaW4tdGhlLXUtcy10aW1lLXRvLXNwcmluZy1mb3J3YXJkLw==">Time to Spring Forward</a> (en.blog.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5ub2ZsdWZmanVzdHN0dWZmLmNvbS9ibG9nL2VyaWNfcHVnaC8yMDEwLzA0L3doZW5fdGFsa2luZ190aW1lX3pvbmVzX2JvZ290YV9fZWFzdGVybl90aW1lX3VzX19jYW5hZGFf">When talking time zones: Bogota != Eastern Time (US &amp; Canada)!</a> (nofluffjuststuff.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class=\"zemanta-pixie-a\" title=\"Reblog this post [with Zemanta]\" href="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JlYmxvZy56ZW1hbnRhLmNvbS96ZW1pZmllZC9jYmJkNmMwZS0zMTc1LTRjZjItOWE4Yi1lMGFjNDQyZjQzNzUv"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_a.png?x-id=cbbd6c0e-3175-4cf2-9a8b-e0ac442f4375" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
 <img src="http://phpprotip.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=224" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://phpprotip.com/2010/05/tekx-date-and-time-with-derick-rethans/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

