Are PHP references C/C++ pointers?

To the C/C++ coder, PHP references are bit challenging to understand. Are they pointers?
Regardless of the way references do truly work, what confuses the C/C++ coder is that it seems that PHP references are not like pointers because of the syntax:
int i, *p;
i = 0;
p = &i;
std::cout << *p;	// In PHP, you would write p and not *p
As in :
$i = 0;
$p = &$i;
echo ($p);	// See: that's $p as if it was like $i
So, how should the C/C++ coder understand how references do work in PHP ? The purpose of this article is to cast some light on this. More broadly speaking, anyone who intends to use references in PHP should find something interesting here - most notably to clarify the relationship between reference and unset ().
Ciquez ici pour lire cet article en français.
Continue reading "Are PHP references C/C++ pointers?"
Are PHP references C/C++ pointers?

How settings do work in PhpStorm 2017

PhpStorm 2017 is eminently configurable. You can adjust more or less any aspect of the IDE. In particular, the user interface (UI) can be very finely tuned to fit your needs.
Configuring the code syle for PHP in PhpStorm 2017.3
Sadly, the way settings work can turn you crazy. The are no less than three ways to tune the settings at any time :
  • at the welcome screen, the Configuration button, then Settings ;
  • if a project is opened, the File menu, then Settings ;
  • if a project is opened, the File menu, then Default Settings.
Moreover, in some cases, a setting may be tuned by telling PhpStorm that its value should be related to a “profile” ou a “scheme”…
The main problem with settings in PhpStorm is that the entry point for tuning settings does not talk to the user. How to tune a setting and apply the new value to a set of projects ? How to tune a setting so that the new value should only apply to projects to come ? The user has to work it by himself to find answers to such basic questions.
Since nobody ever published a good in-depth explanation about how settings do work in PhpStorm 2017, let’s explore the possibilities of PhpStorm 2017.3 to understand how all of this may be achieved.
Ciquez ici pour lire cet article en français.
Continue reading “How settings do work in PhpStorm 2017”
How settings do work in PhpStorm 2017