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

Pages: 1-

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 16:29

um.  okay.

Name: Anonymous 2009-06-29 17:10

$ php -r "echo 0.15-0.05;"
0.0:

Name: Anonymous 2009-06-29 19:04

Type coercion isn't necessarily a bad thing, but PHP does go overboard.
It combines particularly nicely with the fact that the concatenation operator is . and not + like in every other language. You get hilariously nonsensical errors if you mess them up, e.g. in SQL queries.

But who need prepared statements?

Name: Anonymous 2009-06-29 19:08

Any language that has a string concatenation operator does not deserve respect.

Name: Anonymous 2009-06-29 19:10

>>4
Using + for concatenation is fucking retarded.  It's wrong for an operator to radically change behavior just because you passed it a different type.

Name: Anonymous 2009-06-29 19:23

>>5
This. String concatenation should always be a function so it's clear to the maintainer what's going on.

Name: Anonymous 2009-06-29 20:29

>>7
For template languages that doesn't make sense. I wouldn't be opposed to having ++ as the concatenation operator, but concatenate($string1, $string2) would hurt.
More so than PHP already does.

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

Name: gcc 2009-06-29 21:12

>>9:warning: VB used in comparison with any other languages

Name: Anonymous 2009-06-30 0:13

STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT STRCAT

Name: Anonymous 2009-06-30 0:24

leave string cat alone :(

Name: Anonymous 2009-06-30 0:43

Stray cat, dead dog.

Name: Anonymous 2009-06-30 3:27

>>11
How do you pronounce 'strcat'?

1. ess-tee-ar-see-aye-tee (faggot)
2. stir-cat
3. stor-cat
4. sudder

Name: Anonymous 2009-06-30 3:31

>>14
5. ess-tee-are cat (cool dude)

Name: Anonymous 2009-06-30 3:46

>>14
Stirkit, strinkit, and strilkit

Name: Anonymous 2009-06-30 4:21

>>14
``Stir-cat,'' obviously.

Name: Anonymous 2009-06-30 4:21

>>16
stir cat, stern cat, sterile cat

Name: Anonymous 2009-06-30 4:33

>>14
strur-cat

Name: Anonymous 2009-06-30 4:36


              .-o=o-.
          ,  /=o=o=o=\ .--.
         _|\|=o=O=o=O=|    \
     __.'  a`\=o=o=o=(`\   / 
     '.   a 4/`|.-""'`\ \ ;'`)   .---.
       )   .'  /   .--'  |  /   / .-._)
       '\   _.'   /     /`-;__.' /
         '--.____.\    /--.___.-'
                   `""`

Name: Anonymous 2009-06-30 5:12

Just name your variables with a prefix; $f_, $i_, $s_ etc for float, int, string and so forth.

Name: Anonymous 2009-06-30 10:50

>>21
And also don't forget to include the scope and the purpose of the variable in the name!

All naming conventions are retarded

Name: Anonymous 2009-06-30 12:51

>>22
Did you mean: Retarded naming conventions are retarded

Name: Anonymous 2009-06-30 13:15

>>1
fuck you

>>23
fuck you too

Name: Anonymous 2009-06-30 18:02

>>21
EXPERT SIMONYI NOTATION

Name: Anonymous 2009-07-01 3:04

>>21
PHPDOC

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