View Single Post
Old 05-28-2004, 02:36 PM  
Nathan
Confirmed User
 
Industry Role:
Join Date: Jul 2003
Posts: 3,108
Pro and Cons of Object Oriented Programming has been discussed plenty of times. OOP in a non-windows type environment is in my oppinion not at all needed though.

OOP in PHP is actually too slow in my oppinion, and I would NEVER use it.

I usually look at old projects, if the script looks badly written or not well organized I would never higher them because it will be a pain to modify it later.

----
Tempest:
$i=1;
$i=$i++ + ++$i;
echo $i;

neat little trick question I must admit, I am not sure what the answer is of the top of my head in PHP, since I am not sure how it parses this stuff exactly. But $i should be 4.
($i = $i++ + ++$i evaluates to $i = 1 + 3 because $i++ will increase $i to 2, but evalutes to 1 and ++$i will increase it to 3 and evalute to 3, $i is then set to 1 + 3.)

Correct me if I'm wrong Tempest.

----

KidCock.. lemme try your test.. maybe I can be the first getting above 9/15 <g>

1. a)

2. e) (lol) you write a query like this: select article_id, count(*) num from keywords where keyword='MySQL' or keyword='4.0' group by article_id having num=2;
BTW, your table structure of keywords table sucks ;)

3. b)

4. c)

5. e)

6. I login to the db with the mysql client and run repair table <tablename>;
(your table structure isn't the best again btw)

7. b)

8. c)

9. b)

10. c)

11. c)

12. c)

13. is not easy since I am not sure what was replaced by the damn forbidden words thing on GFY. but $x should be a), unless the $a = $b is not a hidden idea to confuse people and is just a bug in your script.

14. uhm, why is that a PHP question? Add the friggin connecting host to your grant tables in mysql.

15. writing php time, gimme a minute for that. next post.
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right."
- Charlie Munger
Nathan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote