1. 3 & 5 is 11 & 101 which is 1;
2. If either of the array is empty, $a & $b === false.
3. ^ = xor. Lots of fun, 3 ^ 5= 11 ^ 101 === 110; Meaning the two compared bits have to be oposites. so 11 ^ 101 is 011 ^ 101 Then you look for non matching bits and you get 110 or 6;
4./5. YOu can easily figure out for youself using php Though they are
1.2345E+14
0.12345
respectively. E just signifies scientific notation N * 10 ^m
6. I believe hte correct syntax is
<script type="php"
Obviously the first one is not the answer as it will throw an error.
8. Push and POP always work off the end of a stack(array). that is why there is array_shift to get the variable off the front of the array.
On Sep 15, 2009, at 10:11 PM, Bruce Razban wrote:
Dear php-139ers!
I am working on getting Php5 Certification.
When I took the test, I was somewhat surprised by the following questions. I know that these only show in test and not in actual coding in the real world. But, here we go with the test:
1. We have $A and $B and their values are: A is 3 and B is 5. Then they ask what is $A & $B? I thought that this is bit-wise "AND" function, but, the answer of 3 did not work. Is there a single & and is it the logical and?
2. On question 1 above, suppose A and B are arrays, then what will A & B be? (I am relying on my memory for this)
3. What if the function of ^ operator? For example A^B? A and B could be variables, of arrays (Ofcourse with the $ in front of them)?
4. What is the value in decimal of number 12345E10?
5. What is the value in decimal of number 12345E -5?
6. Which of the following statements will work on any installation of PHP?
<?
?> or,
<? Language=PHP5.2 ....
?> //Sorry I am not sure about the exact syntax here.
7. For Array A that contains (2, 3, 4, 5, 6, 7) what does shift 2 do? What does shift -3 do?
8. And a general question: On the push and pop instruction for an array how do we know which end (left of right) is to be considered?
I appreciate it if anyone can answer these.
Thanks.
-Bruce
--
Please Note: If you hit "
REPLY", your message will be sent to
everyone on this mailing list ([address removed])
This message was sent by Bruce Razban ([address removed]) from
The San Francisco PHP Meetup Group.
To learn more about Bruce Razban, visit his/her
member profile
To unsubscribe or to update your mailing list settings,
click here
Meetup Support: [address removed]
632 Broadway, New York, NY 10012 USA