|
Posted by Rami Elomaa on 04/17/07 20:08
tasteless kirjoitti:
> Hi guys,
>
> I need really hard questions (about 10) about PHP programming (some of
> elements OOP as well, but no MySQL questions - this is different part),
> this questions needs to be very hard, but the experienced senior PHP
> developer should answered on it.
>
> I've already searched in google and google groups archive but without
> any good results. So could anybody help me giving some link or sending
> some stuff to me ?
>
> Thanks and regards - Peter.
>
> PS. It's about the bet with one of my friend :)
>
Well, this might be easy but here we go...
<?php
$i++;
if($i<10) xyz (__FILE__) ;
else echo $i;
?>
Substitute xyz with a standard function or construct so that the output
is 10.
Scroll down for correct answer.
answer: xyz = include, require
Explanation: __FILE__ is included recursively and $i is incremented each
time, until it reaches 10, thus printing 10.
--
Rami.Elomaa@gmail.com
"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
Navigation:
[Reply to this message]
|