Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

god damn it php

Name: Anonymous 2009-06-29 16:16


<?php
$foo = "0";  // $foo is string (ASCII 48)
$foo += 2;   // $foo is now an integer (2)
$foo = $foo + 1.3;  // $foo is now a float (3.3)
$foo = 5 + "10 Tiny Wangs"; // $foo is integer (15)
$foo = 5 + "10 Monstrous Cocks";     // $foo is integer (15)
?>


You cannot do that, that goes against the teachings of dead dogs!

Name: Anonymous 2009-06-29 20:36

>>5
More like any language that doesn't have a dedicated string concatenation operator doesn't deserve respect?

It's easy to understand when there are separate operators for addition and string concatenation, like ++ in Haskell or .. in Lua or & in VB.

Also, using + for string concatenation is ok as long as a language has a sane type system and doesn't implicitly coerce values.

also it's nearly 2 am here and I'm probably not writing proper english but fuck it

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List