stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')| <?php | |
| namespace Controllers; | |
| use OAuth\Common\Service\AbstractService; | |
| use OAuth\Common\Storage\Session as OAuthSession; | |
| class AuthController extends ControllerBase { | |
| // everytime we enter the controller, then we check for login, if yes, then we dont have to access here (except logout) |
| <?php | |
| I\see($user)->is('User'); | |
| I\see($string)->equals('hello'); | |
| I\see($user_names)->contains('davert'); | |
| I\see("Hello world")->contains('Hello'); | |
| I\expect(function() { | |
| $user->save(); | |
| })->throwsException('NotAllowedException'); |
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't:
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| <?php | |
| require_once __DIR__ . '/../lib/vendor/Symfony/lib/autoload/sfCoreAutoload.class.php'; | |
| sfCoreAutoload::register(); | |
| /** | |
| * ProjectConfiguration. | |
| * | |
| * @author Marijn Huizendveld <marijn@round84.com> |