"Sözdizimi hatası, beklenmedik ','" hata burada gerçekleşiyor:
$foo1 = ($foo2, true);
Virgül orada olmak herhalde değil mi?