Nerede çift doları PHP sözdizimi için referans bulmak için?

3 Cevap php

ben burada herkes php 'değişken değişken' sözdizimi biliyorum umuyoruz:

$color = 'red';
$red = 'yes, im red';
echo $$color;
//output: 'yes, im red';

but my problem is: how this syntax is named? i'm trying to find the reference on php.net, with no results (i wanna know if this feature will be kept in php6, the others attributes, etc...)

3 Cevap

Variable Variables

Ve evet bildiğim kadarıyla PHP6 tutulacaktır.

Sadece bazı ipuçlarını paylaşmak.

Karışıklığı önlemek için, kıvırcık parantez kullanmak olabilir.

${$color}

One of my team member removed the double $, thinking of typo error. Perhaps doing so will avoid confusion.

Onunla ilişkili bir gerçek dezavantajlar / sorunlarınız bu işlevler birçok senaryolarda gerçekten kullanışlı geliyor gibi php bu Çıkarma gerçekten anlamsız bir karar olacaktır.