Tienes que tener en cuenta que el método te devuelve dos resultados, en un array, el primer resultado con índice cero y el segundo resultado con índice 1:
Así me funciona a mí (tienes que poner el nombre de archivo que estés usando tú):
<?php
include_once 'archivoPrueba.php';
$a = -2;
$b = 1;
$c = 1;
$p = new Operaciones($a, $b, $c);
echo 'Valor de a: '.$a.'<br/>';
echo 'Valor de b: '.$b.'<br/>';
echo 'Valor de c: '.$c.'<br/><br/>';
echo 'Solucion 1: '. $p->Cuadratica()[0].'<br/>';
echo 'Solucion 2: '. $p->Cuadratica()[1];
?>
<?php
class Operaciones{
//put your code here
private $a;
private $b;
private $c;
function __construct($a, $b, $c) {
$this->a = $a;
$this->b = $b;
$this->c = $c;
}
public function getA() {
return $this->a;
}
public function getB() {
return $this->b;
}
public function getC() {
return $this->c;
}
public function setA($a) {
$this->a = $a;
}
public function setB($b) {
$this->b = $b;
}
public function setC($c) {
$this->c = $c;
}
public function cuadratica() {
$d = $this->b*$this->b -4*$this->a*$this->c;
$e = 2*$this->a;
if ($d==0) {
$cuadratica[0] = -$this->b/$e;
$cuadratica[1] = $cuadratica[0];
}
else {
if ($d>0) {
$cuadratica[0] = (-$this->b + sqrt($d))/$e;
$cuadratica[1] = (-$this->b - sqrt($d))/$e;
}
else {
$cuadratica[0] = NAN;
$cuadratica[1] = NAN;
}
}
return $cuadratica;
}
}
?>