Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
# alias to edit commit messages without using rebase interactive | |
# example: git reword commithash message | |
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f" | |
# edit all commit messages | |
git rebase -i --root | |
# clone all your repos with gh cli tool | |
gh repo list --json name -q '.[].name' | xargs -n1 gh repo clone |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Вы ранее привлекались за хранение данных в глобальных переменных? | |
Вы когда-нибудь делали .Net за деньги? | |
Сформулируйте зависимость времени исправления критического бага от seniority присутствующего менеджера | |
В своём резюме вы указали знание php. вам не стыдно? | |
Перед вами кисть, холст и мольберт. напишите компилятор |
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:
Эта статья является вольным изложением идей из этой замечательной книги JavaScript Spressore (обязательно к прочтению).