$to_exec holds this value:
echo "test";
how can i evaluate the contents of $to_exec?
try eval($to_exec);