[BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2779
Todo: -

Because PHP function `array_key_exists` is buggy, it works great with native
PHP `ArrayObject` instances, but hand written implementations of `ArrayAccess`
and `Traversable` objects will fail to work with `CollectionValidator`
Add prof-of-concept test, this test will fail without changes in previous commit
[Form] fixed flawed condition
[ClassLoader] Update PSR-0 reference.
merged branch drak/psr0 (PR #3089)

Commits
-------

39f1ecd [ClassLoader] Update PSR-0 reference.

Discussion
----------

[ClassLoader] Update reference to PSR-0

Bug fix: no
Feature addition: n/a
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
merged branch kriswallsmith/form/validator-fix (PR #3082)

Commits
-------

aa58330 [Form] fixed flawed condition

Discussion
----------

[Form] fixed flawed condition

The validate() method always returns an object. The test is whether there are violations in that object.

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```

---------------------------------------------------------------------------

by fabpot at 2012-01-10T21:22:10Z

What about removing the if condition altogether?

---------------------------------------------------------------------------

by kriswallsmith at 2012-01-10T21:23:55Z

This way we avoid creating an `ArrayIterator` for no reason.
fixed some phpdoc
optimized string starts with checks

Doing this with strpos() is slightly faster than substr().
[HttpKernel] removed unnecessary regex

The pattern was also flawed because of the unescaped `.`
merged branch canni/fix_collection_validator (PR #3078)

Commits
-------

7f7c2a7 Add prof-of-concept test, this test will fail without changes in previous commit
253eeba [BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess

Discussion
----------

[BugFix][Validator] Fix for PHP incosistent behaviour of ArrayAccess

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2779
Todo: -

[![Build Status](https://secure.travis-ci.org/canni/symfony.png)](http://travis-ci.org/canni/symfony)

Because PHP function `array_key_exists` is buggy, it works great with native
PHP `ArrayObject` instances, but hand written implementations of `ArrayAccess`
and `Traversable` objects will fail to work with `CollectionValidator`

Tests from second commit are valid use cases, but without this change, they will fail.
merged branch kriswallsmith/kernel/unnecessary-regex (PR #3104)

Commits
-------

7f7f82a [HttpKernel] removed unnecessary regex

Discussion
----------

[HttpKernel] removed unnecessary regex

The pattern was also flawed because of the unescaped `.`

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```
merged branch kriswallsmith/strpos (PR #3097)

Commits
-------

fe62401 optimized string starts with checks

Discussion
----------

optimized string starts with checks

Doing this with strpos() is slightly faster than substr().

```
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```

---------------------------------------------------------------------------

by vicb at 2012-01-11T19:58:27Z

How faster ? even if the string is long and do not contain an occurrence of the sub-string ?
Looks like micro-(not)-optimizations to me.

---------------------------------------------------------------------------

by kriswallsmith at 2012-01-11T20:04:26Z

The difference is about 0.1s when repeated 1M times.

---------------------------------------------------------------------------

by vicb at 2012-01-11T20:08:12Z

% would be better (machine & env independant), what string size, what match offset ?
I personally vote against (`substr` is more meaningful to me and I do not like micro-optims)

---------------------------------------------------------------------------

by kriswallsmith at 2012-01-11T20:12:34Z

I personally consider this a coding standard but don't want to bikeshed here :)

---------------------------------------------------------------------------

by vicb at 2012-01-11T20:28:08Z

I have [tried](https://gist.github.com/1596588) at home.
`strpos ` **is** faster unless you have a very long string, probably because you do not need to create a new string, interesting, thanks for the tip.

---------------------------------------------------------------------------

by Tobion at 2012-01-11T22:40:18Z

I think strpos() is more useful. Say you want to change the string you have to replace 2 variables (the text and the length parameter) when using substr(). It could also introduce bugs when they don't match. With strpos() it's only the text.

---------------------------------------------------------------------------

by robocoder at 2012-01-11T22:43:22Z

alternate micro-optimization that doesn't create a temporary string:
```
strncmp($v, "@", 1) === 0
```

---------------------------------------------------------------------------

by Tobion at 2012-01-11T22:47:12Z

@robocoder probably the fastest solution but needs to be benchmarked
[Yaml][Parser] throw an exception if not readable
[Yaml][Parser] changes according review
[HttpFoundation] added missing trustProxy condition
merged branch kriswallsmith/http/forwarded-port (PR #3111)

Commits
-------

d67d419 [HttpFoundation] added missing trustProxy condition

Discussion
----------

[HttpFoundation] check trust setting in getPort()

Added a missing `self::$trustProxy` check in `Request::getPort()`.

```
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
```
merged branch makasim/yaml-throw-not-readable (PR #3105)

Commits
-------

7961014 [Yaml][Parser] changes according review
efce640 [Yaml][Parser] throw an exception if not readable

Discussion
----------

[Yaml][Parser] throw an exception if service file not readable.

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3077
Todo: -

---------------------------------------------------------------------------

by makasim at 2012-01-13T15:49:49Z

 @fabpot done
added a missing use statement
fix expected return type of MutableAclProvider
[Bugfix][Locale] Fixed incomplete Locale data loading

Sublocales like de_CH returned only incomplete results for
getDisplayCountries(), getDisplayLanguages() and getDisplayLocales(),
consisting only of results specific for this sublocale, but without the
results of their respective parent locale