Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$a = 10;
$b = 4;
$c = fun(10,4);
function fun($a,$b)
{
    $b = 3;
    return $a - $b + $b - $a; 
}
echo $a;
echo $b;
echo $c;
?>

A. 104

B. 410

C. 1400

D. 4100

Answer: Option C

Solution(By Examveda Team)

The value returned from the function is 0, and value of a is 10, value of b is 4 and c is 0.

This Question Belongs to PHP >> Operators And Expressions In Php

Join The Discussion

Comments ( 2 )

  1. عبووود الأسطا
    عبووود الأسطا :
    2 years ago

    the Correct Answer is 1040

  2. Walid Ezzeddine
    Walid Ezzeddine :
    3 years ago

    The right answer is 1040

Related Questions on Operators and Expressions in php