You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vincent Oliveira edited this page Sep 6, 2016
·
2 revisions
Tiller Test Dev Backend - Test #1
What should I do ?
Write a webservice that compute the sum of the numbers in a given list using a for-loop, foreach-loop, a while-loop, and recursion.
Where should I write my code ?
//src/AppBundle/Controller/Test1Controllerpublicfunctiontest1Action(Request$request)
{
$list = $request->request->get('list');
/** * @TODO: * Write a webservice that compute the sum of the numbers in a given * list using a for-loop, foreach-loop, a while-loop, and recursion. */$result = array(
'forLoop' => $this->forLoopSum($list),
'foreachLoop' => $this->foreachLoopSum($list),
'whileLoop' => $this->whileLoopSum($list),
'recursion' => $this->recursionSum($list),
);
returnnewJsonResponse($result, JsonResponse::HTTP_OK);
}