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 -a
session shows that it's totally meaningless:
php > $value = 'something'|'something'; php > echo $value; something php > $arr = array('abc' => 1, 'def' => 2); php > echo $arr['abc'|'abc']; 1 php > echo $arr['def'|'def']; 2
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With