I am trying to access an element of an array in PHP using the following method:
$test = $this->Student->find('first',array('conditions',array('Student.student_table_id'=>1)))['Student']['student_id'];
It seems to work well on a slightly newer version of XAMPP, but when I try to use that syntax on another machine with an older version of XAMPP for Mac OS X 1.7.3 installation, it throws me to a Server not found
page. I don't know if it something to do with my XAMPP configuration or something else..
Also, this behavior, i.e. redirection to a server not found page, happens whenever there is a syntax error.
Mind you, both machines support the minimum requirements of CakePHP.
From the comment..
the PHP Version on the problematic machine is 5.3.1
That is because you are trying to use a new feature of PHP 5.4 , called the function array dereferencing.
Break down your code like this.
$test = $this->Student->find('first',array('conditions',array('Student.student_table_id'=>1)));
$test1 = $test['Student']['student_id'];