Home Archive Who Photos Talks Projects
  Derick Rethans
 
  CODING AND RANTS   PHOTOGRAPHY  
 

Xdebug moved to a new server [ Friday, 27th of November, 2009 - 14:42 - London, UK ]

Xdebug's CVS server was previously hosted at eZ Systems' office, but as I am leaving soon I needed to move this to a different server. At the same time, I decided to also convert from CVS to SVN. So from now on, there is no more cvs.xdebug.org, but just a svn.xdebug.org. This SVN server doesn't only host Xdebug, but also some of my other projects, such as VLD (opcode dumper to aid PHP engine development), the DBGp specs (debugger protocol as used by Xdebug and ActiveState's debuggers) and my OpenMoko perversions and projects.

Xdebug can now be checked out from SVN with:

svn co svn://svn.xdebug.org/svn/xdebug/xdebug/trunk xdebug

All other Xdebug services (mailinglists, web, e-mail and the bug system) moved to the same server as well. Just be aware that DNS servers might still need updating when you try to access the new services.

permalink | no comments | add comment | syndication policy

.

Xdebug and tracing memory usage [ Friday, 13th of November, 2009 - 11:59 - London, UK ]

Recently people started to ask me how to use Xdebug to figure out which parts of applications use a lot of memory. Traditionally this was part of Xdebug's profiling functionality. Unfortunately the cachegrind format didn't fit this so well, and because it returned incorrect data I removed this functionality from the profiler. However, there is other functionality in Xdebug that does provide the correct data: the function traces.

Function traces log every include, function call and method call to a file. If the xdebug.trace_format setting is set to "1" then the trace file is an easy-to-parse tab separated format. The information that is logged includes the time-index when the function started and ended, and it also contains the amount of memory that was in use when entering the function, as well as when leaving it. With the last two numbers it's rather trivial to write a script to figure out which functions/methods increase the memory usage a lot. Of course, nobody had written a script yet to do anything with this information

As part of my preparations for my Xdebug talk at IPC next week, I now have written such a script. The script parses the tab-separated function trace files and aggregates all the information by function name. You can sort the output on a few different keys: time-own, memory-own, time-inclusive, memory-inclusive and calls. You can also configure how many elements it will show. As an example here is some output from a trace of one of the presentation system's PHP scripts:

$ php tracefile-analyser.php trace.2043925204.xt memory-own 20

parsing... Done. Showing the 20 most costly calls sorted by 'memory-own'. Inclusive Own function #calls time memory time memory ------------------------------------------------------------------------------- require_once 9 0.0541 4595160 0.0277 2548104 {main} 1 0.0600 2906032 0.0034 249744 fread 4 0.0001 33296 0.0001 33296 session_start 1 0.0002 31824 0.0002 31824 XML_Presentation->startHandler 38 0.0073 36360 0.0035 18424 _pres_slide->_pres_slide 27 0.0009 10152 0.0009 10152 _presentation->_presentation 1 0.0001 7912 0.0001 7912 strtolower 67 0.0017 6456 0.0017 6456 compact 1 0.0000 4832 0.0000 4832 each 5 0.0001 4320 0.0001 4320 XML_Presentation->endHandler 38 0.0014 3800 0.0014 3960 _slide->_slide 1 0.0001 3896 0.0001 3896 XML_Slide->startHandler 4 0.0009 10800 0.0004 3736 _image->_image 1 0.0000 3040 0.0000 3040 fopen 2 0.0001 2816 0.0001 2816 getimagesize 1 0.0001 2296 0.0001 2296 display->display 1 0.0001 2120 0.0001 2120 explode 2 0.0001 2120 0.0001 2120 xml_parser_create 2 0.0001 1680 0.0001 1680 XML_Parser->_initHandlers 2 0.0011 1600 0.0005 1360

The script is available from CVS by running:

cvs -d :pserver:cvsread@cvs.xdebug.org:/repository login (pw = srmread) cvs -d :pserver:cvsread@cvs.xdebug.org:/repository co xdebug/contrib

The script to run is then "tracefile-analyser.php" from inside the "xdebug/contrib" directory.

permalink | 5 comments | add comment | syndication policy

johnathan - Friday, 13th of November, 2009; 13:29:10
can you put link to direct download?

Derick - Friday, 13th of November, 2009; 13:31:47
@johnathan: You can get it from the CVS browser:

http://cvs.xdebug.org...

Pratheesh Rajan - Monday, 16th of November, 2009; 07:28:17
Checked out the code from your cvs, but there is a syntax error on the file xdebug/contrib/api/parser.php :-(

Derick - Monday, 16th of November, 2009; 09:34:30
@Pratheesh: The script is PHP 5.3 only, because it uses a closure.

itarato - Sunday, 22nd of November, 2009; 08:27:02
Hi,

A made a small patch that allows to run the code with PHP 5.2: [code] cvs diff: Diffing . cvs diff: Diffing api Index: api/parser.php RCS file: /repository/xdebug/contrib/api/parser.php,v retrieving revision 1.1 diff -u -p -r1.1 parser.php --- api/parser.php 13 Nov 2009 11:06:39 -0000 1.1 +++ api/parser.php 22 Nov 2009 08:24:31 -0000 @@ -115,6 +115,7 @@ class drXdebugTraceFileParser public function getFunctions( $sortKey = null ) { + global $sortKey; $result = array(); foreach ( $this->functions as $name => $function )
{ @@ -132,10 +133,10 @@ class drXdebugTraceFileParser if ( $sortKey !== null ) { uasort( $result, - function( $a, $b ) use ( $sortKey ) - { + create_function('$a, $b', ' + global $sortKey; return ( $a[$sortKey] > $b[$sortKey] ) ? -1 : ( $a[$sortKey] < $b[$sortKey] ? 1 : 0 );
- } + ') ); } [/code]

It works for me.

Regards: Peter


.

Unix Epoch and PHP's calendar system [ Thursday, 12th of November, 2009 - 12:32 - London, UK ]

I just saw a commit flying past as a response to PHP bug #50155. While right now it is proper to define the Unix Epoch at "1970-01-01 00:00:00 UTC", UTC wasn't actually defined until 1972. So it would be more correct to define the Unix Epoch as "the number of seconds elapsed since midnight proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds." (from Wikipedia). What the bit "not counting leap seconds" means, I've already explained before in Leap Seconds and What To Do With Them.

Similarly, PHP's internal calendar is the ISO 8601 calendar. This is a modification of the proleptic Gregorian calendar. The Gregorian calendar implements the current set of leap years every 4 years, but not every 100 years, but again every 400 years (to get to an average year length of 365.2425 days). Obviously this calendar is only in use since 1582 (some countries adopted it as late as the 1900s), so using days like 1066-10-14 in the Gregorian calendar makes little sense because that calendar didn't exist back then. Now, PHP's ISO 8601-based calendar even modifies the Gregorian calendar by including the year 0. The Gregorian calendar goes straight from -1 to 1 which is a pain to do proper date calculations with. Therefore the ISO 8601 calendar uses Astronomical year numbering.

permalink | no comments | add comment | syndication policy

.

Good bye eZ Systems [ Tuesday, 27th of October, 2009 - 10:36 - London, UK ]

During the past 6 years I've been working as a developer for eZ Systems — first as a developer on eZ Publish and later as project lead for eZ Components. Working on a project like eZ Components as lead was challenging and interesting and taught me many things. eZ Systems as a company is changing a lot, and now the time has come for me to move on and find something new and exciting to do. I've recently moved to London to explore life from a different point of view, and that will now also include a search for a new challenge professionally. I will still be with eZ Systems for awhile longer to finish the next eZ Components release. If you think you can provide me with a new challenge, feel free to contact me.

permalink | 21 comments | add comment | syndication policy

Andries Seutens - Tuesday, 27th of October, 2009; 10:52:53
Good luck in your future endeavors, Derick!

Tony Wood - Tuesday, 27th of October, 2009; 11:58:14
Thank you for being such a big driving force in the eZ community Derek. Your thinking and intuition will be greatly missed.

Norman Leutner - Tuesday, 27th of October, 2009; 12:14:34
Sorry to hear that. Good Luck and best wishes from me and the whole all2e Team !

Ivo - Tuesday, 27th of October, 2009; 12:27:21
Good luck with the job search, I'm sure with your stature that won't be a big challenge. (and if you want to talk, you know where to find me ;-)

Serban - Tuesday, 27th of October, 2009; 12:40:46
Hi Derick,

Good luck! May i suggest Drupal? :)

Best wishes

Richard Heyes - Tuesday, 27th of October, 2009; 12:46:07
Best wishes

Paul M. Jones - Tuesday, 27th of October, 2009; 13:15:14
Congrats and good luck!

Matthew turland - Tuesday, 27th of October, 2009; 13:17:16
Good luck in your future endeavors.

sudheer - Tuesday, 27th of October, 2009; 13:34:03
Good luck, Derick. Like another commenter said, it won't be a challenge for you to find a new challenge :)

Wim Rethans - Tuesday, 27th of October, 2009; 14:58:03
Succes bij het zoeken van een nieuwe baan. Ik weet zeker dat het gaat lukken en dat je in een nieuwe uitdaging je geluk kan vinden.

Michelangelo van Dam - Tuesday, 27th of October, 2009; 16:58:32
Sorry to hear you leave Ez Systems and good luck and fortune in your next adventures. Are you concidering going freelance ?

Bradley Holt - Tuesday, 27th of October, 2009; 17:58:07
Best of luck to you!

Steven Van Poeck - Tuesday, 27th of October, 2009; 18:02:08
Best of luck in your future endeavors Derick !

Hoping to meet you again on the Forum PHP in Paris on 12th & 13th november :)

Best, Steven

Ekkehard Dörre - Tuesday, 27th of October, 2009; 18:09:45
Hi Derick,

sorry to hear that, but good luck in your new city and on a new job.

ekke

Maxime THOMAS - Tuesday, 27th of October, 2009; 18:19:15
Good bye Derick ! Take care !

Christian Wenz - Wednesday, 28th of October, 2009; 11:04:35
good luck with your future endavours!

Cyril PIERRE de GEYER - Wednesday, 28th of October, 2009; 12:31:39
Hey tiger you are going to move ;) Enjoy this next few years !

Cheers

Robert Gonzalez - Wednesday, 28th of October, 2009; 15:51:58
Best of luck to you, Derick. Your contributions to the PHP community have been amazing so I am sure what you have brought to eZ is equally amazing. They will surely miss your expertise. I hope you find the challenge you are looking for.

Jeremy Brown (notmessenger) - Wednesday, 28th of October, 2009; 17:53:55
Good luck in all of your future endeavors Derick!

Ammar Ibrahim - Wednesday, 4th of November, 2009; 11:27:26
You have done a great job. For me, ezComponents is the highest quality PHP code I have seen.

Wish you best of luck wherever you go.

Ronald Koerts - Monday, 9th of November, 2009; 11:54:59
Hallo Derick,

Dat is een grote stap om even te doen! Je zal vast weer iets moois op je weg vinden. Succes!

Groet Ronald K.


.

CodeWorks and ZendCon [ Monday, 19th of October, 2009 - 05:46 - London, UK ]

CodeWorks was a blast, I recorded a few talks that I will be publishing through Vimeo. As teaser I have a recording of Scott MacVicar's PECL picks talk. I also have recordings of Brian Moon's Memcached talk, Chris Shiflett's Security-Centered Design talk and Sharon Levy's Web-Based Retrieval Demystified talk. With all the other random video material I am creating a compilation as well, but that will have to wait a bit more.

At the moment I am on my way to San Jose where I will speak on Xdebug and PHP's DateTime support. Xdebug 2.1 is now feature complete, and I will be working on getting all the open bugs resolved. A release before the end of the year seems likely.

permalink | no comments | add comment | syndication policy

.

Autumn Plans [ Monday, 14th of September, 2009 - 13:26 - London, UK ]

I've been missing-in-action on my own blog for some time. Moving to London does that to you. Anyway, I've not been idle in the meanwhile at all, and been working on some cool side-projects. First of all I've been adding some features to Xdebug. Xdebug is now slow reaching beta-status for the 2.1 release. New feature will include proper PHP 5.3 support, variable tracing, "scream" support and other minor features.

Besides Xdebug I've also been hacking on PHP-GTK applications for my phone. The major new thing that I have now is a PHP-GTK twitter client that works like I want it... and I even use it on my desktop instead of all the other stuff that's out there. I will soon be publishing this client in my CVS repository.

Now that the conference season is starting again I'm working on improving several talks, as well as rewriting some parts for them. The first conference that I will be speaking at, are part of "Marco's Crazy PHP Conference Tour" aka CodeWorks. I'll be giving three different talks here, one on "Debugging with Xdebug", one on PHP's DateTime support and one on "Improving your development process" where I'll be talking about Test-Driven Development and other tricks associated by running a project. As CodeWorks is a bit like a rock-star tour, I'll be keeping a video blog of it somewhere on the intertubes.

permalink | 1 comment | add comment | syndication policy

dasher - Friday, 23rd of October, 2009; 12:53:40
hiya,

Any plans to continue with the pecl/dbus extension?

It looks promising and would help open up a whole new side of php apps.


.

Good bye Norway, Hello London [ Sunday, 21st of June, 2009 - 02:32 - Skien, Norway ]

Today, at the longest day of the year at the summer solstice, I am making a bit change to my life. If you're following me on twitter you probably already know what I'm up to. For everybody else, I am going to say good bye to Skien in Norway, and move to London (the one in England, and not the one in Ontario). Norway has been my home for the past five years, and I've had a great time exploring the nature as well as working at our office in Skien. Skien is a nice place, but ... not the most interesting of cities in the world. From today I will be living in London to see what life will bring me there. I am both sad to leave Norway, but I am also excited to live in a cool new place like London. I'll have awesome house mates (Hi, Mr. Þorbjörnsson, Ms. Cherry and Mr. Ray!!), and something new to put my energy in. I will continue to work as project leader for eZ Components for eZ Systems and continue to make great software with Alexandru, Tobias, Kore and Sebastian. If you are about in London, let me know! We could go for a pint or something. See you there!

permalink | 5 comments | add comment | syndication policy

Morgan Tocker - Monday, 22nd of June, 2009; 20:27:49
Any reason you didn't choose the London in Ontario?

Good luck with your move, London is a fun city.

Zilvinas Saltys - Friday, 26th of June, 2009; 09:29:58
As a PHP developer who also moved to live in London I agree with you that this is a very interesting place to live in ;) Good luck!

Almir Neto - Monday, 29th of June, 2009; 21:52:29
I hope I can do the same one day

Franck Cassedanne - Tuesday, 30th of June, 2009; 12:24:09
Good move ;-)

Ronald Koerts - Monday, 6th of July, 2009; 11:27:10
Hey Derick!

Good luck in London!


.

Debugging with multiple users [ Thursday, 11th of June, 2009 - 10:47 - Amsterdam, the Netherlands ]

As author of Xdebug, people ask me often the question how to handle the case in teams when there is one development server and multiple developers working on the same project on that server. Xdebug only allows you to specify one IP address to connect to (through xdebug.remote_host) while doing remote debugging. It does not automatically connect back to the IP address that runs the browser the request the PHP scripts because of security reasons. You don't want everybody on the Internet to be able to run a debugging session against your code for example. There is no problem if all developers are working on a different project, because the xdebug.remote_host setting can be made for each directory (through Apache's .htaccess functionality). However, for the case where multiple developers work on the same code, the .htaccess trick won't work as the directory in which the code lives is the same.

Now, in order to solve the above mentioned issue, you will need to run a DBGp proxy. DBGp is the protocol, designed by ActiveState and myself to facilitate communication between an IDE (such as Komodo, or any of the other listed clients) and PHP+Xdebug. A DBGp proxy is a bit of software that acts as a redirector for DBGp streams. In order to make things work for multiple developers and one source base, you set Xdebug's xdebug.remote_host setting to the machine on which the DBGp proxy runs. This is most likely going to be on the same machine that acts as development server, so that the xdebug.remote_host setting should be set to "127.0.0.1" (i.e. localhost). The proxy server the listens for IDE connections. An IDE needs to register itself with the DBGp proxy by using the proxyinit command. This command requires an "idekey" that is a unique identifier for each client (IDE). Every developer should have its own unique idekey (I usually just pick my name), and this idekey should be configurable in the IDE. For Komodo, it's at Edit->Preferences->Debugger->Connection->"I am running a debugger proxy and Komodo should use it"->"Proxy Key". In Komodo you also need to select "a system-provided free port" in the same configuration panel. When initiating the debugging session from the browser with either XDEBUG_SESSION_START=session_name as GET/POST/COOKIE parameter, or export XDEBUG_CONFIG="idekey=session_name" from the comment line, make sure to change "session_name" to the idekey as configured in your IDE. (See the documentation on how to set this up). The Xdebug Firefox extension also has a setting for this. You have to configure Xdebug's xdebug.remote_host setting to the IP address of the machine that the proxy runs at. Xdebug itself does not see a difference between either the proxy and a normal IDE. But the proxy itself now knows because of the configured idekey on how to forward the requests and responses to the correct client.

You can find the DBGp proxy code as part of the python remote debugging package that ActiveState provides. By default it listens for IDE registrations at port 9001, and for Xdebug connections at port 9000. To run the proxy, do:

tar -xvzf Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64.tar.gz cd Komodo-PythonRemoteDebugging-5.1.3-28369-linux-x86_64 cd bin ./pydbgpproxy

This outputs:

INFO: dbgp.proxy: starting proxy listeners. appid: 30430 INFO: dbgp.proxy: dbgp listener on 127.0.0.1:9000 INFO: dbgp.proxy: IDE listener on 127.0.0.1:9001

Running a DBGp proxy also allows you to avoid NAT issues where (as seen from PHP+Xdebug on the server) all connections seem to come from the same IP (because your internal network is NATted). In this case, you can simple run the dbgp proxy on your NAT machine, configure xdebug.remote_host setting to the IP address of your NAT machine, and configure the IDEs to connect to the proxy running at <NAT-machine>:9001.

As a last note; there is a patch to allow the connect-back-to-requesting-IP-address functionality that is not available directly in Xdebug. This patch, written by Brian Shire and Lucas Nealan of Facebook made its way into Xdebug 2.1. However, great care should be taken by using this functionality. It does not make the NAT situation as outlined above work however.

permalink | 5 comments | add comment | syndication policy

Michael Stucki - Tuesday, 7th of July, 2009; 14:56:13
Hi Derick,

thanks for the nice article, this works pretty well. Just one question: If security is really the only reason for having this overhead, why not add some IP whitelist to the configuration setup? I would find this much easier especially when developing in internal networks, where everyone is trusted.

Anyway, thanks a lot for the great work you've been doing.

Regards, Michael

Gotzon Astondoa - Monday, 7th of September, 2009; 14:55:31
I´m agree with Michael, in Zend Debugger you can put a list of IP (whitelist, instead of unique IP). It´s so simple... You can put: zend_debugger.allow_hosts=172.16.200.1,172.16.200.2,172.16.200.3

Or you can put: zend_debugger.allow_hosts=172.16.200.0/24

Or a combination: zend_debugger.allow_hosts=172.16.200.0/24,92.168.134.32

Roland - Friday, 18th of September, 2009; 22:57:06
Could that be that your info about the debug proxy is outdated? I downloaded this: http://downloads.acti... and I got no bin directory, just a xdebug.so for different (?) PHP versions.

Larry Garfield - Tuesday, 22nd of September, 2009; 20:11:11
+1 on the whitelist approach, if it's possible. My company is in exactly this situation, and we're looking into migrating from Zend Debugger to XDebug. Being able to just whitelist our internal subnet rather than adding extra configuration to everyone's IDE (we don't all use the same IDE) would greatly simplify the process.

Derick - Thursday, 24th of September, 2009; 17:33:19
@Roland: No, you need to download the *python* package (that's the reason why I made it bold in the article ;-) )


.

php|architect's Guide to Date and Time Programming [ Wednesday, 3rd of June, 2009 - 21:06 - Skien, Norway ]

In the past year I've been working on a book, describing PHP's Date and Time functionality in great detail. It's now finally out under the name "php|architect's Guide to Date and Time Programming". Look at the pretty cover! It's actually a picture I took some months ago from the church in Skien, where I am still living (more about that in a later post).

The book is devoted on helping you understanding dates and times, as well as how PHP deals with it. It explains how PHP parsers and reads dates and times in strings including possible pitfalls; timezones, their history, the annoyances and how to deal with them properly; formatting and displaying dates and times; and last but not least, how to handle intervals and iterating over time. There is more information on the website where you can also buy this awesome book. And in case you're wondering "what? dates and times are really simple!", then this book is definitely for you.

Rumour is that all attendees of the Dutch PHP Conference will receive a copy with their tickets, if you're asking nicely I might even sign your copy! I'll be there to give a talk on "PHP on the D-BUS" and will show you how to talk to skype, GSM chips and other desktoppy things!

permalink | 2 comments | add comment | syndication policy

Toby - Thursday, 4th of June, 2009; 07:26:48
Congratulation! Looks really neat! :)

kedwards - Sunday, 7th of June, 2009; 07:25:03
Purchased, and read through the first half in a few days. Well worth it.


.

pfcongrez, P2P Конференция, php|tek, PHP Vikinger, DPC and eZ Conference and Awards [ Friday, 10th of April, 2009 - 01:45 - London, UK ]

The above mentioned conferences all have one thing in common: I'll be speaking. At the first conference, pfcongrez I will be talking on implementing Test Driven Development as a model for software development. A modified version of this talk I will also give at the next conference, P2P Конференция (P2P Conference) in Bulgaria. At this same conference I will be talking on using PHP as development language for GSM based applications on mobile computing platforms running Linux, where I will use the pecl/dbus extension to talk to the interface framework available on the OpenMoko platform. This same talk I will also give at DPC in Amsterdam. In between however I will go to Chicago to speak at php|tek on search technologies in my "Haystacks and Needles" talk and on simple architecture in my KISS talk. Before DPC I will also go to Leuven for PHP Vikinger, an unconference that I'll be organizing for the 3rd time. This year it is no longer in Norway, but instead we moved to Leuven in Belgium. It is also de-coupled from the eZ Conference and Awards which will be in Paris.

permalink | 1 comment | add comment | syndication policy

Vlado - Monday, 27th of April, 2009; 14:43:59
Hi Derick,

I was at the conference and just dropped in here to say Hi. Your presentations were really nice and useful(especially the on about TDD). So, thanks I guess :)

Bye


.

PHP Vikinger 2009 [ Monday, 6th of April, 2009 - 12:36 - London, UK ]

I'll be organizing PHP Vikinger again this year. It will not be in Norway, but instead we'll be moving to Leuven in Belgium. It will be held on May 30th, very close to Leuven's central station at Café Sport (known from the PHP Belgium meetings). For the full invitation, see the website.

permalink | no comments | add comment | syndication policy

.

Variable tracing with Xdebug [ Wednesday, 25th of March, 2009 - 10:34 - Skien, Norway ]

Some time ago Matthew mentioned on IRC that he'd like to see variable modifications in Xdebug's function traces. After I had a quick look at the feasibility of this feature I spend some time on implementing it for Xdebug's HEAD branch that is going to become Xdebug 2.1.

Variable modification tracing can be enabled by setting the php.ini xdebug.collect_assignments setting to 1. Of course this can also be done in either .htaccess or by using ini_set(). This setting requires general execution tracing to be enabled as well and it's only available for human readable trace files (the default format).

If variable modification tracing is turned on, all variable assignments, as well as the update-in-place operators such as += and *=, are being logged to the trace file. Take for example the following script:

1 <?php 2 function multiply( $n, $multiplier ) 3 { 4 $val = $n; 5 $val *= $multiplier; 6 return $val; 7 } 8 9 $a = 3; 10 $a = multiply( $a, 14 ); 11 ?>

There are multiple statements that modify variables (on lines 4, 5, 9 and 10). Those statements generate lines in the execution trace file. Combined with turning on xdebug.collect_params and xdebug.collect_return the trace file then turns out to be:

TRACE START [2009-03-20 19:20:38] 0.0003 119632 -> {main}() /tmp/example1.php:0 => $a = 3 /tmp/example1.php:9 0.0004 120104 -> multiply(3, 14) /tmp/example1.php:10 => $val = 3 /tmp/example1.php:4 => $val *= 14 /tmp/example1.php:5 >=> 42 => $a = 42 /tmp/example1.php:10 >=> 1 0.0007 56360 TRACE END [2009-03-20 19:20:38]

Of course, this feature also works for updating object's properties and array's elements as can be seen with the following script:

1 <?php 2 class Number 3 { 4 private $n; 5 6 public function __construct( $n ) 7 { 8 $this->n = $n; 9 } 10 11 public function multiply( $multiplier ) 12 { 13 $this->n *= $multiplier; 14 } 15 } 16 $a = new Number( 3 ); 17 $a->multiply( 14 ); 18 19 $array['3x14'] = $a; 20 ?>

And this creates the following trace file (without the time and memory columns):

-> {main}() /tmp/example2.php:0 -> Number->__construct(3) /tmp/example2.php:16 => $this->n = 3 /tmp/example2.php:8 >=> NULL => $a = class Number { private $n = 3 } /tmp/example2.php:16 -> Number->multiply(14) /tmp/example2.php:17 => $this->n *= 14 /tmp/example2.php:13 >=> NULL => $array->3x14 = class Number { private $n = 42 } /tmp/example2.php:19 >=> 1

At the moment, array keys and object properties both use the -> syntax in the trace files, but this might change in the future. There are also still issues with syntax like $this->foo['key'].

permalink | 6 comments | add comment | syndication policy

Pierre - Wednesday, 25th of March, 2009; 11:15:58
Very nice featured indeed!

Greg Beaver - Wednesday, 25th of March, 2009; 14:57:07
Does this mean that xdebug will soon display variable values inside method/function calls in PHP 5.3? (/me waits with bated breath...)

:)

troelskn - Thursday, 26th of March, 2009; 12:38:42
Very nice addition. Thanks for your work.

Heu - Friday, 27th of March, 2009; 10:49:59
nice feature! but is there a mechanism for filtering , so we can trace some variables instead of all vars?

Edward Lynn - Wednesday, 29th of April, 2009; 13:52:16
Is there an eta on 2.1 release? I'd LOVE this feature.

Derick - Wednesday, 29th of April, 2009; 13:56:48
@Heu: No, because that'd be really slow.

@Edward: No, no ETA yet. But definitely after PHP 5.3 is released.


.
 

Scotland Holiday [ Friday, 29th of August, 2008 - 21:58 - Scotland, UK ]

Edinburgh, August 9th and 10th, 2008

I had a good flight through Amsterdam to Edinburgh, the real nerves started when my luggage did not appear on the baggage belt. Apparently I had missed it and it had fallen off in the back, out of sight. After being reunited with my bags slightly later and getting the car I made the arduous trip to the "hotel". The "hotel" was the Heriot-Watt campus, which was neither sign-posted or easy to find. After making a few circles through the neighbourhood, I managed to find it. However, finding the campus wasn't the only issue -- 30 minutes later I finally had found the reception in a pitch black night. Sleep commenced very soon after that.

I got up early in the morning for a light breakfast and unhappily discovered that it was raining. Not something you should be surprised about in Scotland. I took the bus into town to meet up with Lorna and after a cup of tea Scott as well. Without any real plan we wandered around the city and taking in the views. This quickly turned into looking for food. While having some drinks over lunch we chatted a bit more, and more walking occurred in the afternoon. We got tired, had some more drinks and by that time Lorna had to leave for home again.

Scott and I dropped of our gear at his room and went looking for a comedy show to go to. The Edinburgh Fringe festival was happening, so the biggest problem was to which of the 640 shows we wanted to go. We settled for "Des Clarke - Desire" at the Pleasance Courtyard. After a cup of tea in a café full of loonies, we left for the show. We had a great time, although his accent was sometimes a bit hard to understand for me. A cab brought me back to the "hotel".

After sleeping in a little bit, I took the bus again to downtown Edinburgh. I took a quick bite to give me strength to visit the Edinburgh castle. I took the long route through Princess Gardens up the hill. The queue for tickets took a little over hand an hour. The tour at the castle itself, was interrupted by the occasional shower, but the weather had improved a lot since the previous day. The castle is a must see. I liked the "prison of war" exhibitions best, and the crown jewels where the anti-climax.

After visiting the castle I was quite hungry and went to have a lunch of stir fried scallops at the Mussels hut. With the new found energy I climbed Caston hill. The last hours in Edinburgh I spend at the various street theaters of the fringe. After a light dinner at "bar One", consisting of swordfish and an apple/carrot salad I left back by bus to the Heriot-Watt campus.

Edinburgh to the Isle of Arran, August 11th, 2008

I started the day with a simple though hearty breakfast at the newly opened Mensa. From the hotel I travelled first slightly south to visit Roslyn's chapel. Unfortunately the chapel is mostly hidden by a roof to protect it from the rain. Inside photography was not allowed, so I didn't manage to take any pictures. In the church I listened to a guide explaining all the interesting art from the chapel. From pagan green men, the apprentice pillar and the Hollywood circle, the church appeared to house much more than I expected. From the church I left for Falkirk, home of the Falkirk Wheel.

The wheel replaces many locks between the Union and Forth and Clyde canals, and is quite an engineering feat. For some time there was even some blue sky which made watching the wheel turn more pleasant. I continued my journey after a quick lunch towards Glasgow and to Ardrossan where I would take the ferry to the Isle of Arran. I was a bit early and wandered about the really windy harbour. They also tried to fool me that my ferry would be two hours later, but that I didn't go for. The trip of the Firth of Clyde was windy, bumpy and slight sunny.

When I got the Brodrick on the other side, I shopped for essential energy suppliers for the upcoming walks around the island. I was staying at the Catacol Bay hotel on the northern point of the island, where I had breaded haddock for lunch. The wine that came with it "forced" me to walk around a bit along the windy coast. The heavy rain that had plummeted down when I arrived was gone. Before I went to bed I prepared a bit for the hikes of the following day.

Isle of Arran, August 12th, 2008

Hiking on an empty stomach doesn't work, but a full Scottish breakfast might be a bit too close to suicide. Way too much artery clogging goodness for me. Of course, the rain had returned but that was not going to stop me from a little hike around the "Cock of Arran". From my "parking place" I spotted a few seals, but they were obviously not sun-bathing. I didn't walk the whole planned tour as there was simply too much rain. In the end I was happy that I didn't continue, as I would have missed some many other things during my really short stay on Arran.

The next stop on my tour around Arran was a short walk to the standing stones and stone circles of Machrie Moor. During the two mile hike it was of course raining still. The last hike of the day was to the King's caves. I was silly and went the wrong way for nearly half an hour, but it finally stopped raining. After some dry period I finally ended up at the caves. There was even some sunshine. The rest of the day I merely drove around the rest of the island thinking I had no water with me. Back at the hotel I found six bottles in the trunk. I had dinner in the hotel's bar and the Hitchhikers Guide to the Galaxy brought and end to the day.

Isle of Arran to Isle of Skye, August 13th, 2008.

A heavy Scottish breakfast started the day. I left quite early to catch the ferry at Brodrick back to the mainland. The day consisted of a lot of driving over narrowish roads. I stopped for a late lunch at a café overlooking Monty Python's castle Stalker. The weather was getting better the close I got to Skye. After the Skye bridge beautiful scenery appeared but I stopped only briefly to take some pictures as it was getting late too quickly. I didn't really settle in at the lovely B&B "Roskhill House" until after dinner at Hotel Dunvegan's bar.

Isle of Skye, August 14th and 15th, 2008

A nice breakfast at the B&B started the day. It was beautiful weather and excellent for my plan to hike to the Quiraing. A quick drive later over surprisingly good roads--although the last part was a one-file road--brought me to the parking place at the start of the hike. From there I walked for ca. 2.5 hours over the maintain range. Very strange rock formations and beautiful vistas. From there I drove on to walk to the Cave of Gold but was met by some bulls in a field that I had to cross. I gave up in fear of my life, and instead drove to Neist's point and enjoyed the view there in the setting sun.

I had dinner at "Old School" restaurant. Actually, I had dinner twice. For some reason my starter--duck--was misunderstood as another main course by the totally cute, but clumsy waitress (it could have been my accent of course as well). Both dinners were excellent; if you want to eat here as well, make sure you book on time, one, if not two days before hand.

The second day I was woken up by a little rain shower, but luckily the rain was gone before I was out of the shower. As the weather on the east coast of the island was supposedly going to be a bit better, I opted for climbing up to the "Old Man of Storr". A really nice walk with excellent views -- which got even better when the sun broke through. From the Storr I traveled up the coast and stopped a few times to enjoy the views and take some pictures. I ended up doing a walk to a lock, which was boring. With threatening rain I aborted the walk -- I got back to the car just before the shower would have soaked me. I had dinner at the Dunvegan hotel as my first choice, the "Loch Bay Seafood Restaurant" had no space for me.

Isle of Skye to Edzell, August 16th, 2008

Lots of driving again this day. I started off after brekkie for Scotland's east coast. I took a few compulsory pictures at Eilean Dohan castle and then drove along the shore of Loch Ness towards Invernness. I made a quick stop at Urquhart and but not manage to spot Nessie. I continued my way south from there through beautiful Aberdeenshire where all the heaths were blossoming. I was staying in a small village, Edzell at the Kelvingrove B&B. I had dinner at the Panmure Arms Hotel, which has an interesting setting. The food however was excellent.

Angus, August 17th, 2008

Breakfast was early at the B&B which meant that I had some time to kill before all the attractions opened -- it was a Sunday after all. So I decided to drive into Glen Clova, the supposedly nicest of the Angus glens. Unfortunately there was not much too see in the mist. I then proceeded to Glamis castle, said to have been the set for Shakespeare's MacBeth. It is very nice, with gardens all around. I found it a bit too commercial. From there on I visited the Pictavia museum in Brechin followed by a quick visit to Aberlemno to see a few of those Pictish stones. It was a bit of a bummer and lame. As last activity of the day I wanted to walk a little bit along the coast. But at the moment I started to walk, the rain started to pour down as well. So I aborted and went back to the B&B to eat, pack and watch a movie. The following day I was going home again.

Final notes

I should definitely have spend more time on Arran and Skye - both beautiful places of which I've not even seen half.

The food is mostly great in Scotland, as long as you stay away from Haggis.

My best accommodation was Roskhill House, there were also lots of other hikers there, which added to the atmosphere.

I had the least amount of fun in the last day in Angus.

It always rains in Scotland, so bring waterproof gear.

My pictures from the trip are on flickr.

permalink | 3 comments | add comment | syndication policy

Stuart Herbert - Friday, 29th of August, 2008; 23:31:34
You were saved by the rain, there. Despite what the map probably told you, one doesn't walk around the Cock of Arran unless the tide is out. It's quite a climb over the cliff face :)

Thijs - Saturday, 30th of August, 2008; 10:59:32
I made the trip to Scotland as well this summer, although the weather was better I spent more time visiting the festival venues, so spent the major part of the time inside. Actually I took exactly the same picture of the Assembly-festival venue as you did: http://flickr.com/pho...

Great post, fun to read.

Les - Sunday, 21st of December, 2008; 01:31:00
I'm glad you decided to visit and travel around Scotland but a shame you didn't try some haggis...

You havnae bin tae Scotland until you've tried tha haggis...

Could hiv bin the English recipe though...


.

Nacreous Clouds - take 2 [ Saturday, 19th of January, 2008 - 18:16 - Skien, Norway ]

Finally another sighting of those rare nacreous clouds. More on flickr.

permalink | 2 comments | add comment | syndication policy

Ivo - Sunday, 20th of January, 2008; 09:02:10
Is this related to the northern light effect?

Derick - Sunday, 20th of January, 2008; 19:24:50
No, not linked at all. Northern lights are caused by particles from the Sun, while this type of clouds is still unclear what it actually is. NASA just launched a mission to found out more about it (http://en.wikipedia.o...).


.

Finally a sunset after so much rain. [ Tuesday, 21st of August, 2007 - 21:41 - Skien, Norway ]

permalink | no comments | add comment | syndication policy

.

Snowy Sunset [ Saturday, 3rd of February, 2007 - 17:55 - Skien, Norway ]

permalink | 2 comments | add comment | syndication policy

Jakob - Saturday, 3rd of February, 2007; 17:22:01
Nice. Austria is currently just the opposite: no snow, no sun ... just bad weather.

Cheers, Jay

Nico - Sunday, 4th of February, 2007; 18:47:24
Beautiful picture. Seems like snow is reluctant to fall though ( saw Skien with more snow than this !). France is also very poorly "served" this winter. Skåll !


.

Brasil Conference Wrap-up [ Tuesday, 19th of December, 2006 - 16:42 - Foz do Iguaçu, Brasil ]

In the beginning of this month I attended the PHP Conference Brasil. Besides speaking on Xdebug and the eZ Components I also spend a few extra days as holiday there.

During those extra days I flew to Foz do Iguaçu to have a look at the Itaipu dam on the border with Paraguay and Iguaçu falls.

Besides the falls there are many other things to see in the park, such as butterflies and very big ants.

After visiting the park I travelled further south to visit one of my colleagues, Melissa. Together we travelled to Gramado, a very German looking city.

For the rest of the pictures check my gallery. There are also a few panoramas available.

permalink | no comments | add comment | syndication policy

.

Just too late for sunset [ Sunday, 19th of November, 2006 - 23:46 - Helgeroa, Norway ]

I usually try to get out in the weekend a bit instead of staying inside the house. The weather was great yesterday so I invited Sebastian for a little trip to Mølen to take pictures at sunset. Unfortunately, we were two minutes too late to see the sun set. Luckily that did not stop us from taking pictures - just after sunset there is still some sunlight that hits the clouds turning them red. Here you see Sebastian taking a picture of just those red clouds:

After the sun sets the light decreases which allows you to play a little bit with longer exposures. You can get very nice effects such as in this four second exposure of waves breaking on the (rocky) shore:

If you instead of a close up take a bit wider image of the shore it gives an eery feeling just like this shot of the waves and water flowing inbetween the rocks that were deposited here by a glacier a long time ago:

The rest of the images in this serie can be found in my gallery.

permalink | no comments | add comment | syndication policy

.
 
 
This site and all of its contents are Copyright © 2002-2009 by Derick Rethans.
All rights reserved.
Syndication Policy