Basic PHP and Javascript objects building