Letter to my MP to urge her to debate the Digital Economy Bill in parliament

The UK House of Lords passed a controversial internet piracy bill that will have great consequences for society. Not only because it wants to disconnect file sharers, but also because of other privacy invading clauses. It is possible (likely even) that this bill will be rushed through parliament without a proper debate. I therefore wrote to my MP to urge her to properly discuss this in parliament. I am copying that letter below:


Dear Sarah Teather,

I've been following the recent developments around the Digital Economy Bill and what I read worries me deeply. This law, spearheaded by the Lord Manderson, is controversial in many ways. Now it seems possible that this bill is going to be rushed to be signed into law without a full Parliamentary debate.

There are several issues with this bill that I would like to address. First of all, the proposed US-DMCA like practices that would allow copyright holders to ask an ISP to take down content. ISPs will have no choice, but to comply with those take-down notices because it would be their legal responsibility. ISPs will have to fight out in court if they want to prove that certain content is not infringing, and obviously they will not have the inclination to do so on their customers' behalf. This makes it relatively easy for anybody to demand content taken off-line, whether they are the copyright holder or not, or even without having to prove the content is in violation.

At the same time, the Digital Economy Bill will allow the use of "orphaned works"—works for which the author is not easy to find. I am a semi-professional photographer with many images published on the Internet in various locations, some that are difficult to link me to as an author. I expect this to be even more the case for people's holiday pictures that they post to sites such as flickr and facebook. I don't want my work to be used commercially without consent, but if the Digital Economy Bill would be signed into law, corporations could use anyone's family pictures without their consent. This is of course in full contrast with other proposed clauses that criminalize copyright infringements where the copyright is owned by large (mostly not even UK) corporations.

As you can see, there are measures in this Bill that concern me, and so I think that it deserves proper scrutiny. Please don't let the government rush it through. I, and many of my peers, think it will damage schools and businesses as well as innocent people who rely on the internet because it will allow the Government to disconnect people it suspects of copyright infringement with any due process.

I am writing to you today to ask you to do all you can to ensure the Government doesn't just rush the bill through and deny us our democratic right to scrutiny and debate. I would be happy to discuss this matter with you further and provide some examples.

Yours sincerely, Derick Rethans


I have not seen a reply yet, but will update this post in case I receive one later. Please also write to your MP in case you are concerned with how this bill will affect your privacy and rights.

Comments

No comments yet

Available for PHP Extension Writing

Slightly more than a month ago I left my job as team-lead of eZ Components at eZ Systems behind, to focus on something new. During the past month I've been contemplating about what to do next and realized that I do not want to take on a new full-time position right away. Instead I will be available to work on (custom) PHP extensions and internals related issues. Extensions are a great way around PHP's limitations and performance issues.

As first project I am working on a "QuickHash" extension for StumbleUpon. This extension circumvents PHP's hefty memory (and performance) overhead by providing more specific data structures. The extension currently implements integer sets and integer to integer hashes. I am now adding integer to string hashes and string to integer hashes. The QuickHash extension will be released under the PHP Licence and I will dedicate another post to it later.

If, like StumbleUpon, you are also interested in having work done on PHP or a specific extensions feel free to contact me. I'd be happy to discuss things with you.

Comments

Hi Derick! Good luck for the new projects!

Hello Dereck,

Converting PHPLinq (www.phplinq.net) into an extension would be a nice thing to have in PHP. Feel free to contact me if this is of interest to you.

Best regards, Maarten

Maybe we ought to get some kind of 'bounty' system going for you :)

Best of luck for your new projects!!

Good luck with your projects, Derick. Ilm glad we had a little time off at #confoo party.

Hi Derick,

Not completely unrelated:

I'm working on a CalDAV implementation for PHP which deals with Dates, Timezones, Recurring events, all that goodness..

I just wanted to say the DateTime extension is the best thing since sliced bread. I dread that I have to support PHP 5.2 and can't use some of the additions made for PHP 5.3.

Hi Derrick,

Sounds like a bit of life-change happening.

I'm curious how you juggle all the various projects - many for no obvious reward and still put dinner on the table.

Maybe a blog to share your thoughts on community software / licensing / workload sharing / contributions / donations etc.

For example it seems you are the only one doing work on xdebug, but then you personally hold the copyright, so I'm a bit confused as this would seem to restrict others' willingness to help?

Xdebug 2.1.0beta3 released

I've just released Xdebug 2.1.0beta3 which includes a few crash bugs as well as the issue that headers sent from PHP scripts are not actually set.

You can find the full changelog here and get the latest version from the download page.

Comments

Thanks for the fix, I was trying to get our sessions to work for a day or 2 last week and didn't figure out what was breaking the cookie stuff until I saw this update. It fixed it for us, the weird thing was though that sessions worked somewhat, e.g. session starting from code seemed to work, session auto starting from php.ini didn't, not sure how to explain that if headers weren't working at all with this xdebug bug...

More source analysis with VLD

VLD is a tool that I started working on years ago to visualise the opcode arrays in PHP. Opcode arrays are what PHP's compiler generates from your source code and can be compared to assembler code that is generated by a C compiler. Instead of it being directly executed by the CPU, it is instead executed by PHP's interpreter.

Over the years I've been adding some functionality, also aided by Ilia and some others, to show more information. For example Ilia has added a more verbose dumping format for opcodes (through the vld.verbosity setting) whereas I have added routines to find out which ops in oparrays can never be reached. A very simple example of the latter is shown here:

<?php
function test()
{
        echo "Hello!\n";
        return true;

        echo "This will not be executed.\n";
}
?>

If we run the above through VLD with php -dvld.active=1 test.php, you'll see the following output (I removed the part about the script body itself):

Function test:
filename:       /tmp/test1.php
function name:  test
number of ops:  9
compiled vars:  none
line     # *  op           fetch  ext  return  operands
---------------------------------------------------------
   2     0  >   EXT_NOP
   4     1      EXT_STMT
         2      ECHO                           'Hello%21%0A'
   5     3      EXT_STMT
         4    > RETURN                         true
   7     5*     EXT_STMT
         6*     ECHO                           'This+will+not+be+executed.%0A'
   8     7*     EXT_STMT
         8*   > RETURN                         null

End of function test.

Every opcode that has a * after the number (like in 5*) is code that can not be reached, and can possibly be eliminated from the oparrays in an optimiser.

The dead code analysis routines have also made their way into Xdebug which uses them for the code coverage functionality to highlight dead code. This mostly makes sense if you are running your code coverage together with unit tests such as you can do with PHPUnit.

Recently I've been working on some new functionality to visualise all the code paths that make up each function. These new routines sit on top of the routines that do dead code analysis. Every branch instruction (such as if, but also for and foreach) is analysed and a list of branches is created. Each branch contains information about the line on which the branch starts, the starting and ending opcode numbers that belong to the branch, as well as to which other branches this branch can jump to. There can be either no linked branches (when for example a return or throw statement is found), one linked branch (for an unconditional jump) or two linked branches (on a branch instruction). However, you need to be aware that internally, PHP's opcode don't always reflect the source code exactly.

Once all the branches and their links are found, another algorithm runs to figure out which paths can be created out of all the branches. It is best to illustrate this with an example. So let us look at the following script:

<?php
function test()
{
        for( $i = 0; $i < 10; $i++ )
        {
                if ( $i < 5 )
                {
                        echo "-";
                }
                else
                {
                        echo "+";
                }
        }
        echo "\n";
}
?>

In this script we have a for-loop with a nested if construct. When we run this script through VLD (with php -dvld.verbosity=0 -dvld.dump_paths=1 -dvld.active=1 test2.php) we get the following output (again, only the test() function and with some white space modifications):

Function test:
filename:       /tmp/test2.php
function name:  test
number of ops:  22
compiled vars:  !0 = $i
line     # *  op             fetch  ext  return  operands
-----------------------------------------------------------
   2     0  >   EXT_NOP
   4     1      EXT_STMT
         2      ASSIGN                             !0, 0
         3  >   IS_SMALLER                 ~1      !0, 10
         4      EXT_STMT
         5    > JMPZNZ                  9          ~1, ->18
         6  >   POST_INC                   ~2      !0
         7      FREE                               ~2
         8    > JMP                                ->3
   6     9  >   EXT_STMT
        10      IS_SMALLER                 ~3      !0, 5
   7    11    > JMPZ                               ~3, ->15
   8    12  >   EXT_STMT
        13      ECHO                               '-'
   9    14    > JMP                                ->17
  12    15  >   EXT_STMT
        16      ECHO                               '%2B'
  14    17  > > JMP                                ->6
  15    18  >   EXT_STMT
        19      ECHO                               '%0A'
  16    20      EXT_STMT
        21    > RETURN                             null

branch: #  0; line:  2- 4; sop:  0; eop:  2; out1:   3
branch: #  3; line:  4- 4; sop:  3; eop:  5; out1:  18; out2:   9
branch: #  6; line:  4- 4; sop:  6; eop:  8; out1:   3
branch: #  9; line:  6- 7; sop:  9; eop: 11; out1:  12; out2:  15
branch: # 12; line:  8- 9; sop: 12; eop: 14; out1:  17
branch: # 15; line: 12-14; sop: 15; eop: 16; out1:  17
branch: # 17; line: 14-14; sop: 17; eop: 17; out1:   6
branch: # 18; line: 15-16; sop: 18; eop: 21
path #1: 0, 3, 18,
path #2: 0, 3, 9, 12, 17, 6, 3, 18,
path #3: 0, 3, 9, 15, 17, 6, 3, 18,
End of function test.

This dump consists of a few different parts. First of all we can see some basic information containing the name, the number of ops (22) and the compiled variables. The second part is a dump of all the opcodes that make up this function. The last part contains information about all the branches and the possible paths. This information is a bit hard to visualize in its textual form, so I've also added some code that dumps this information to a file format that the GraphViz tool "dot" can use to create a pretty graph. For this we re-run the previous PHP invocation as php -dvld.dump_paths=1 -dvld.verbosity=0 -dvld.save_paths=1 -dvld.active=1 test2.php. This creates the file /tmp/paths.dot that "dot" can use. If we run dot -Tpng /tmp/paths.dot > /tmp/paths.png we end up with the following picture:

vld-paths.png

If we put this graph next to the code, we can explain how this works. Every branch is named by the number of the first opcode in that branch:

  • op #1 is the assignment of $i in line 4.

  • op #3 is the loop test in line 4. If the condition doesn't match, we jump to op #18 on line 16 that echos the newline.

  • op #9 is the if condition on line 6.

  • op #12 is when the if condition returns true and

  • op #15 is when the if condition returns false.

  • op #17 sits behind both op #12 and op #15 and makes sure there is a jump to the counting expression in #op 6.

  • op #6 is the post increment operation on line 4 which will then again be followed by op #3 to check whether the end of the loop has been reached.

This is of course a very simple example, but it also works for (multiple) classes and functions in a file. You just need to make sure to tell VLD that you don't want the code executed as the output could be very large. You can use the vld.execute=0 php.ini setting for that.

I hope this new functionality can spread some light on how loops etc. work in PHP. In order to play with the code, you need to check-out VLD from my SVN with svn co svn://svn.xdebug.org/svn/php/vld/trunk vld. You can also view the code on-line at http://svn.xdebug.org/cgi-bin/viewvc.cgi/vld/trunk/?root=php. Look out for a new release coming soon!

Comments

Nice nice nice nice nice Derick ! I'm gonna use that ASAP.

When will the code be pushed to pecl to use the pecl command to update vld ?

Seems like a cool idea : )

I wont use in current projects but i can see how that can come in handy! : )

thanks

art

New Xdebug browser extensions

Years ago I wrote about a Firefox extension that allows you to start an Xdebug debugging session by clicking on an icon in Firefox' status bar. For some unexplained reason, this extension is no longer available through Firefox' addon-site. Although I have a copy at http://xdebug.org/files/xdebug_helper-0.3.1-fx.xpi for archival purposes, there are now a few other browser extensions that do the same thing.

easy Xdebug

easy Xdebug is an extension that serves as a replacement for the now unavailable Xdebug helper extension. It's written by Brecht Vanhaesebrouck of eLime. The extension was originally tested with Netbeans but it also seems to work fine with Komodo.

Xdebug enabler

Xdebug enabler is an extension for Google's Chrome browser. It "allows you to enable and disable triggering Xdebug from with in Chrome. Useful if you are a web developer using an IDE that supports Xdebug like Eclipse with PDT." It's written by 'remailednet' and available through the Google Chrome Extensions website.

JavaScript 'enabler'

I also ran across a blog post by 'Caleb G' from HigherVisibility. Instead of making an extension for a specific browser, he outlines two JavaScript bookmarklets that allow you to start and stop an Xdebug debugging session.

Update: The "Xdebug enabler" Chrome Extension seems to have some issues. There is now also an alternative Chrome Extension called Xdebug helper that integrates quite a bit better. You can find it at its Google Chrome Extension page.

Comments

I also put together a bookmarklet some years ago which works by setting the cookie instead of rewriting the URL.

http://pollinimini.net/blog/xdebug-bookmarklet

/imv

easy Xdebug is no alternative to xdebug-helper. I used the MR Tech Toolkit extension to make xdebug-helper compatible with Firefox 3.6. Works.

@Hannes: And why is it no alternative?

Cool!

xdebug-helper just enables the debugger, but does not send a request. easy xdebug resends the current request when debugging is activated.

@Hannes: I just tested it and for me it is not sending a new request. There was a new version released (1.4) yesterday though.

Yes, you are right, easy xdebug version 1.4 is similar to xdebug helper:

Changelog 1.4:

  • Added support for seamonkey (not tested)

  • Made the debug button a toggle button

  • Added a toggle button for profiling

  • Clicking the buttons no longer resubmits the current page

No need for xdebug helper.

Life Line