One of javascript pitfalls is object constructor: if you forgot to add new before your function, it will not be called as constructor, but as usual function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Функция для одновременной подсветки ссылок с одинаковым href, | |
| на вход принимает: | |
| 1) selector — джеквери-селектор ссылок, чтобы | |
| была возможность включить дублирующую подсветку в определённом фрагменте; | |
| 2) hoverClass — какой класс добавить по ховеру и псевдо-ховеру. | |
| Инициализация для всего документа: | |
| doubleHover('a', 'hover'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ini_set('memory_limit', '8192M'); | |
| $iterations = 10000000; | |
| $data = array(); | |
| for ($i = 0; $i < $iterations; $i++) { | |
| $data['iteration' . $i] = array(); | |
| } | |
| echo sprintf("Memory used: %0.2f MB\n", memory_get_peak_usage(true) / floatval(1024 * 1024)); |