Professional Documents
Culture Documents
PHP Question For Interview
PHP Question For Interview
//30 mins
//python 3.4
<?
Q1 ->
$input = [ 1 , 2 , 3 , 4 , 5 , 6 ….. n ];
$output = [ [0] => [1 , 2] , [1] => [3,4], [2] => [5,6] ...n ]; //dynamic
Answer :
Q2 ->
//list
input = [ 5 , 6 , 8 , 3 , a , z , c , ! , @ , # ];output = [ @ , # , ! , a , c , z , 3 , 5 , 6 , 8 ];
Answer :
Q3 ->
Use output of the solution 1.
$output = [ 2 , 4 , 6 ];
Answer:
Q4->
Convert output of solution 2 in to an object. With the object name of its value.
Eg :- all the values in output , must be accessed by their value.
$output->@ = @;
Q5->
create an anonymous class inside an anonymous function and extend it to another class
inside the closure of an anonymous function.