If the variable $a is equal to 5 and variable $b is equal to
character a, what’s the value of $$b?

Can anyone explain how's the value of $$b=100

Answers were Sorted based on User's Feedback



If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / rajkumar

<?php

//If the variable $a is equal to 5 and variable $b is equal
to character a, what’s the value of $$b?

$a =5;
$b=$a;
$c= $$b;
print_r($c);


?>


it will not display any answer so answer is wrong

Is This Answer Correct ?    3 Yes 4 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / nickle

$a = 5
$b = 'a'
$$b=100
bcoz $$b is a reference to existing variable.as $b=100 by
ascii...it is true.........!!!!

Is This Answer Correct ?    2 Yes 5 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / modi[achir communication]

<?
$a=5;
$b='a';
$$b=100;
$b is a simple variable and $$b is a reference variable that
means in memory $$b will be refer to $b. Suppose in memory
$b variable is in address 100 then $$b will be refer $b at
address 100 that means $$b will contain 100.
?>

Is This Answer Correct ?    11 Yes 15 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / annonymus

<?php
$a=5;
echo $b='a'."<br/>";
echo $$b;

?>
output is neither 5 or 100,
it displays
a



but if you try this...
<?php
$user = 'bob';
$holder = 'user';
echo $$holder;
?>
answer becomes like this..
bob


try it....this really really confusing..anyone can give the
exact solution to this????

Is This Answer Correct ?    1 Yes 6 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / mr.kishore

<?php
$a=5;
$b='a';
$$b=100; // at this point $b='a' and when we use $ after
that '$$b becomes $a and we asign this value = 100 so $a
becomes 100;
echo $a;

Is This Answer Correct ?    6 Yes 37 No

Post New Answer

More PHP Interview Questions

Do you know how to declare an array in php?

0 Answers  


How to Retrieve the Session ID of the Current Session?

0 Answers  


What is a php trait?

0 Answers  


What does the scope of variables mean?

0 Answers  


How does php serialize work?

0 Answers  






Explain how is it possible to set an infinite execution time for php script?

0 Answers  


How would you open a directory for reading in php?

0 Answers  


What is the difference between laravel and php?

0 Answers  


What are the php functions?

0 Answers  


List out some tools through which we can draw E-R diagrams for mysql?

6 Answers  


How is a session id generated?

0 Answers  


What is the ioncube php loader?

0 Answers  


Categories