## Author Relations | Futility Closet

I've always loved reading Gertrude Stein's writing.

## Surprise!

POP Quiz time! How do these three bits of HTML get parsed?
1. <foo bar=baz/> (no space between the value and the slash
2. <foo bar=baz /> (space after the unquoted value)
3. <foo bar="baz"/> (quoted attribute value)
The value of the bar attribute in the first example is literally “baz/” with the slash, and no errors or warnings are generated. The second and third ones are parsed out as “baz” as most people would probably expect.

## TILs

1. Each Perl module file needs to declare pragmas at the top of the file for them to have any effect. This is irritating. All this time I thought I was coding in modern perl, with strict and warnings enabled. Adding those things back has been a PITA. At least this time I was smart enough to build a test suite.
2. Test::More doesn't handle UTF8 well at all. Because of how it duplicates the standard file handles, you can't easily change STDOUT etc to handle UTF8.

## Backporting from PHP 5.3 to 5.2

I have a code base built for PHP 5.3, but due to circumstances (and morons) beyond my control I've been forced to backport it to PHP 5.2. There are some nasty surprises not documented in the normal places. __DIR__ define('APP_ROOT', dirname(__DIR__)); doesn't work because __DIR__ isn't defined in 5.2.