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

Pages: 1-

Weak typing

Name: Anonymous 2008-06-11 23:35

Name: Anonymous 2008-06-12 0:09

PHP is awesome!

Name: Anonymous 2008-06-12 0:24

When you make a lambda in PHP it actually creates a function named "\0lambda_N" that persists a short while.  THAT IS AWESOME

Name: Anonymous 2008-06-12 3:27

>>3
Sounds like PHP is just one giant hack, to me.

Name: Anonymous 2008-06-12 3:46

>>4
It is. IIRC the lambdas don't actually support lexical scoping (that is, capturing the variables around them). It really is just creating a function. Lame.

Name: Anonymous 2008-06-12 5:16

You have to train your finger muscles to be stronger.

Name: Anonymous 2008-06-12 6:02

>>6
LIEK GOKU FROM DBZ

Name: Anonymous 2008-06-12 11:51

>>5
Correct; no lexical scoping and you have to store the functions in variables (which are strings) to access them, this works because...
>>4
It is a giant hack... observe this fully working PHP code!
<code>
<?php

function sum($term, $a, $next, $b)
{
        if (function_exists($term) && function_exists($next))
        {
                var_dump($next);
                $sum = 0;
                for ($c = $a; $c <= $b; $c = $next($c))
                {
                        $sum += $term($c);
                }
        }
        else
        {
                return (-1);
        }
        return ($sum);
}

function identity($x) { return ($x); }
function increment($x) { return (++$x); }

function outp($contents)
{
        echo('<p>'.$contents.'</p>');
}

echo('<html><head><title>SICPHP</title></head><body>');
outp('Sum of 1..5 = '.sum(identity, 1, increment, 5));
outp('Sum of 1"OOPS"5 = '.sum("identity", 1, "OOPS", 5));
outp('Ahem');
outp('Sum of increment(1, 3, 5) = '.sum("increment", 1, create_function('$x', 'return ($x + 2);'), 5));

$anon = "\0lambda_1";
outp('Anon is: '.$anon.'(2) = '.$anon(2));
?></code>

Name: Anonymous 2008-06-12 19:13

>>8
I CAN'T SCRAPE OUT MY EYES QUICKLY ENOUGH, HELP ME BROTHERS! USE YOUR NAILS!!!1

Name: Anonymous 2008-06-12 19:36

>>8
SICPHP
No, please god no.

Name: Anonymous 2008-06-12 19:54

>>8
It's [code], not <code>, WAHa.

Name: Anonymous 2008-06-12 21:28

<woops>Stupid wikifagging</woops>

Name: Anonymous 2008-06-12 21:44

>>8
you need quotes around the function names

sum( 'identity', 1, 'increment', 5 )

Name: Anonymous 2008-06-12 21:49

>>13
Without the quote PHP will interpret them as constants. If those constants haven't been defined, it will assume they are strings with values equal to their names.
It generates a warning, but by default it isn't even shown.

Welcome to the wonderful world of PHP.

Name: Anonymous 2008-06-12 21:52

Fuck, this thread made me hate PHP even more. I didn't think it was possible.

Name: Anonymous 2008-06-12 22:02

>>14
yea php is awesome in that it does everything it possibly can to keep the program running regardless of shitty code but those quotes should still be there.

Name: Anonymous 2008-06-13 1:09

FUCKING PHH

Name: Anonymous 2008-06-13 2:45

PHP is great. Everything it tries to be, it fails at.

I can't understand how so many websites use the shit that is PHP.

If I am writing back end code for a website, I should be writing it in something that can handle all aspects of the site. PHP never can. It has to piggy back on libraries made in better languages.

Name: Anonymous 2008-06-13 4:08

>>18
I can't understand how so many websites use the shit that is PHP.
It goes out of its way to run even in the face of horrific code. The one thing it manages to be is intuitive to total morons.
That, and it's free.

Name: Anonymous 2009-03-06 10:52


That just your way   way of saying   i havent read.

Name: Anonymous 2009-08-16 22:36

Lain.

Name: Anonymous 2010-12-06 9:49

Back to /b/, ``GNAA Faggot''

Name: Anonymous 2010-12-20 17:05

Name: Sgt.Kabukiman걆揫 2012-05-24 6:10

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: bampu pantsu 2012-05-29 3:48

bampu pantsu

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