Nielsie schreef:-1 voor geen camelcase met de eerste letter lowercase[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$Jokes[/COLOR][COLOR= #007700]->[/COLOR]GetNext[COLOR= #007700]();[/COLOR] ?>
Grappen met code
if($you == "Understand")
{
echo "Get a life";
}
?>
{
echo "Get a life";
}
?>
Dan vind ik:
beter
if(you.understand(this))
{
print "get a life";
} beter
Streedie schreef:[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Understand"[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Get a life"[/COLOR][COLOR= #007700]; }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Ga PHP leren."[/COLOR][COLOR= #007700]; }[/COLOR] ?>

Maar dat is onlogisch. Nu ga je kijken of jij een instantie bent van een string met de waarde van "understand". Mijn code is veel logischer omdat je een methode aanroep van jezelf (de methode understand = begrijp) en vraagt je in de functie af of je "this" (referreert naar de hele code) begrijpt.
Robindesign schreef:Eerdere citaten tonen
Streedie schreef:[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Understand"[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Get a life"[/COLOR][COLOR= #007700]; }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Ga PHP leren."[/COLOR][COLOR= #007700]; }[/COLOR] ?>

That indentation

Kladblok indentation 

<h1>Hoi</h1> Riick schreef:<h1>Hoi</h1>






nee.Wouterr schreef:Eerdere citaten tonen
Riick schreef:<h1>Hoi</h1>






nee.<div id="noob">
<h1>Wouter</h1>
<div id="excuses">
<i>Maar ik hou wel van je</i>
</div>
</div> Grapje hoor wouter.

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/If"]If[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$dittopic[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"closed"[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/Echo"]Echo[/URL] [COLOR= #DD0000]"ohyeah!"[/COLOR][COLOR= #007700];
}[/COLOR]
?> Wacht... Er klopt geen flikkah van

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Know PHP"[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"See somethings missing"[/COLOR]
[COLOR= #007700]}[/COLOR]
?> [COLOR= #0000BB]<?[/COLOR]php
[URL="http://www.php.net/class"]class[/URL] JokeReader [COLOR= #007700]{
...[/COLOR]
[URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$pPost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getPreviousPost[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]makeLaugh[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPost[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]joke[/COLOR][COLOR= #007700]]) ===[/COLOR] false[COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/return"]return[/URL] NULL[COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getCookie[COLOR= #007700]([/COLOR][COLOR= #DD0000]biscuit[/COLOR][COLOR= #007700]);
}
}
...
}[/COLOR]
[COLOR= #0000BB]$jokeReader[/COLOR] [COLOR= #007700]= new[/COLOR] JokeReader[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$jokeReader[/COLOR][COLOR= #007700]->[/COLOR]haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]);[/COLOR] // output NULL Streedie schreef:Puntkomma vergeten, een "==" proberen te gebruiken om een waarde aan iets te geven (wat dus niet kan), en wederom $you vergelijken met een string die een waarde heeft.[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Know PHP"[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"See somethings missing"[/COLOR] [COLOR= #007700]}[/COLOR] ?>
-1 voor deze lutsercode.
Rogier schreef:Kijk, dat is nog eens code.[COLOR= #0000BB]<?[/COLOR]php [URL="http://www.php.net/class"]class[/URL] JokeReader [COLOR= #007700]{ ...[/COLOR] [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$pPost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getPreviousPost[COLOR= #007700]();[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]makeLaught[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPost[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]joke[/COLOR][COLOR= #007700]]) ===[/COLOR] false[COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/return"]return[/URL] NULL[COLOR= #007700]; }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getCookie[COLOR= #007700]([/COLOR][COLOR= #DD0000]biscuit[/COLOR][COLOR= #007700]); } } ... }[/COLOR] [COLOR= #0000BB]$jokeReader[/COLOR] [COLOR= #007700]= new[/COLOR] JokeReader[COLOR= #007700]();[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$jokeReader[/COLOR][COLOR= #007700]->[/COLOR]haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]);[/COLOR] // output NULL

Rik schreef:Puntkomma vergeten, een "==" proberen te gebruiken om een waarde aan iets te geven (wat dus niet kan), en wederom $you vergelijken met een string die een waarde heeft.Eerdere citaten tonen
Streedie schreef:[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"Know PHP"[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$you[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"See somethings missing"[/COLOR] [COLOR= #007700]}[/COLOR] ?>
-1 voor deze lutsercode.
Rogier schreef:Kijk, dat is nog eens code.[COLOR= #0000BB]<?[/COLOR]php [URL="http://www.php.net/class"]class[/URL] JokeReader [COLOR= #007700]{ ...[/COLOR] [URL="http://www.php.net/public"]public[/URL] [URL="http://www.php.net/static"]static[/URL] [COLOR= #007700]function[/COLOR] haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$pPost[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getPreviousPost[COLOR= #007700]();[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]makeLaught[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$pPost[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]joke[/COLOR][COLOR= #007700]]) ===[/COLOR] false[COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/return"]return[/URL] NULL[COLOR= #007700]; }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]getCookie[COLOR= #007700]([/COLOR][COLOR= #DD0000]biscuit[/COLOR][COLOR= #007700]); } } ... }[/COLOR] [COLOR= #0000BB]$jokeReader[/COLOR] [COLOR= #007700]= new[/COLOR] JokeReader[COLOR= #007700]();[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$jokeReader[/COLOR][COLOR= #007700]->[/COLOR]haveAnOpinion[COLOR= #007700]([/COLOR][COLOR= #0000BB]$people[/COLOR][COLOR= #007700]);[/COLOR] // output NULL

Php niet afgesloten
! ?toevoeging op 28 februari 2013, 23:33:40:
