Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

This Won’t Execute

<?php

$a = &&$b;

$a = & & $b;

This won’t Execute, but it actually compiles. PHP reports no error when writing this expression. Yet, it fails executing, as it should.

This could have been a reference on a reference on a variable: this does not make much sense, and probably should be forbidden by the engine. Yet, this passes.

On the other hand, adding a space between the two & operators, to create a reference on a reference, does yield a linting error, as expected.

In the end, it is probably a typo, but the behavior is quite strange.

See Also

PHP Features

Last updated: 09 November 2026