Find tag "PHP"
18 views | +0 today
Your new post is loading...
Your new post is loading...
Rescooped by chris from Bonnes Pratiques Web

Maitrise de la gestion des variables en PHP

Maitrise de la gestion des variables en PHP | highTech | Scoop.it
Maitrise de la gestion des variables en PHP du feu de dieu !

Via Shaker technologies
chris's insight:

why not...

Shaker technologies's curator insight, October 11, 2013 5:49 AM
Les pièges pas faciles des références en PHP <?php $a = array(1, 2, 3); foreach ($a as &$v) { } foreach ($a as $v) { } // $a vaut array(1, 2, 2) ici

Que s'est-il passé dans l'exemple ci-dessus ?
C'est en fait assez simple : lorsque le premier foreach utilisant une référence sur les valeurs du tableau termine, en mémoire, $v est une référence sur la dernière case du tableau $a (la boucle foreach ayant terminé l'itération).

Autrement dit: entre les deux foreach, $v est liée à la dernière case du tableau (son index 2) et toute modification future de la variable $v changera la valeur de la dernière case du tableau.


Eh bien, cette modification a lieu ! C'est le deuxième foreach qui itère sur le tableau depuis le début et remplit à chaque itération $v (donc aussi la dernière case du tableau) respectivement des valeurs 1, 2... puis 2.

Rescooped by chris from JavaScript for Line of Business Applications

Node.js vs. PHP

Node.js vs. PHP | highTech | Scoop.it

PHP is not going to disappear soon, but its position is being undermined even further by the nascent Node.js. When the Internet exploded in the 2000′s, PHP was the thing ”all the cool kids” did.

Over the years, PHP and its apps became vulnerable to security threats (e.g., SQL injections), lacked a centralized packaging registry (was Composer inspired by Node Package Manager?), had an inconsistent API and suffered from subpar performance. It’s easy to argue that there are better alternatives to PHP, for example Ruby on Rails and Django, however nothing is as approachable as Node.js.

For those of you who aren’t familiar with Node.js, or who have heard of it but can’t quite grasp the concept, I like to say that it is functionally similar to the PHP + Apache or ASP + IIS stacks. Nowadays, it is also gaining momentum.

Many people, whether software engineers or entrepreneurs, are often faced with the decision: “What tech stack should I use?” In this article, I’ll try to compare PHP and Node.js using an apples-to-apples approach, looking at the question from different angles including:

* Syntax

* Context switch

* Modules
* Ecosystem
* Frameworks
* Real-time apps
* Database apps
* Third-party services apps
* Web servers
* Hosting
* Performance


Via Jan Hesse
Entropic-Synergies's curator insight, September 19, 2013 4:06 AM

Seems an objective comparison

Agtunn Naymin's curator insight, October 8, 2013 3:45 AM

should try appserver.io is multithread PHP Server