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.
cd /path/php-5.3.9 | |
./configure --enable-embedd | |
ln -s /path/php-5.3.9/libs/libphp5.so /usr/lib/libphp5.so | |
ldconfig | |
g++ -o zmqembed zmqembed.c -I/path/php-5.3.9 -I/path/php-5.3.9/main -I/path/php-5.3.9/Zend -I/path/php-5.3.9/TSRM -L/path/php-5.3.9/libs -lphp5 -lzmq |
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.
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
body { | |
background: white; | |
text-align: center; | |
padding: 20px; | |
font-family: Georgia, serif; |
eXtreme Go Horse (XGH) Process | |
Quelle: http://gohorseprocess.wordpress.com | |
Übersetzung ursprünglich von https://gist.github.com/Neffez/f8d907ba8289f14e23f3855011fa4e2f | |
1. Ich denke, also ist es nicht XGH. | |
In XGH wird nicht gedacht, es wird das erste gemacht, was in den Sinn kommt. Es gibt auch keine zweite Option, die erste ist schneller. | |
2. Es gibt 3 Wege ein Problem zu lösen: den richtigen Weg, den falschen Weg und den XGH Weg, welcher exakt wie der falsche ist, aber schneller. |
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: