## Friday, 4 August 2017

### php amazing question and logical answer

Question: What is output of 1...1?
Its Output is 10.1
How?
Divide it into three points.
`1.`
`.`
`.1`

1. 1.0 is equal to 1
2. 2nd . is a concatenation operator
3. .1 is equal to 0.1
4. So {1} {.} {0.1} is EQUAL to 10.1

Question: What is final value of \$a, \$b in following?
```\$a = '1';
\$b = &\$a;
\$b = "2\$b";
echo \$a;
echo \$b;
```
output
```21
21
```

Explaination
```\$a = '1'; //1
\$b = &\$a; //both are equal
\$b = "2\$b"; //now \$b=21
echo \$a;  //21
echo \$b; //21
```

Question: What is output of 016/2?
Output is : 7. The leading zero indicates an octal number in PHP, so the decimal number 14 instead to decimal 16;
```echo 016; //14
```
```echo 016/2; //7
```

#### 1 comment :

supreme custom essay writing service said...

Each points which you have explained in this post is true. It is very meaningful and everyone should read this article. I got such an amazing post at custom essay writing service. Thanks a lot for this effort.