返回Php的eval函数

I need to pass a return $variable; within the eval function, which in turn is going to return a value for a function.

Here is an example:

function something()
{
    $sSomeVar = 'something';
    eval( 'return $sSomeVar = 3;'  );
}

The code above will return 3 for the eval, but the function will not return the value for the variable.

So does anyone know how to return a return within an eval?

This should do the trick:

function something() 
{
  $sSomeVar = 'something';
  return eval( 'return $sSomeVar = 3;' );
}