Can someone explain to me what this means?? I have never seen this construct – taken from the Prestashop doc
foreach ( $languages as $language )
{
echo '<div id="test_' . $language['id_lang'|'id_lang'] .... // <-- What the??
// ...
}
$language contains the following keys:
Array
(
[id_lang] => 1
[name] => English (English)
// and others...
)
The result is that it takes the value of $language[“id_lang”] – 1. But I don’t understand the syntax and can’t find any documentation about it.
This
php -asession shows that it’s totally meaningless:Basically, if you “bitwise or” anything by itself, you get the original value. This property is called idempotence in mathematics. For further info, read:
Honestly, the original author of that code had no idea what they were doing.