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

Pages: 1-4041-

wanting to get into php any pointers???

Name: Anonymous 2011-02-08 8:40

Hey there /prog/!

So here's my story: I'm a java programmer at my friend's dad's coffee shop although I haven't heard from my friend in a while (who I'm very good friends with, it's how I got the job in the first place). I work as a tech support guy for their wifi systems and I also do a few other jobs such as cleaning the shop laptop and just making sure everything runs smoothly, nothing really challenging, your absolute most basic stuff, basically I get paid $11/hr to sit around and do nothing and I've been doing this for 4 years now.

Now my friend went off to college and I haven't spoken to him in quite a while and I'm getting really bad signals from his parents who obviously want me gone. Basically what I want is a job that is both intellectually stimulating and a good place to learn new skills, while I like sitting around doing nothing, I truly feel a person of my intellect and skill would be better suited working for a big company earning higher pay than what I do now.

For example, here's a problem I had to overcome:
I had the customer laptop handed back to me after an middle eastern looking customer left and he'd changed the language to Arabic. Now I Googled about and did the regular checks (Windows Search Bar + looking through Control Panel) and I couldn't find out how to do it and my friend's dad hates arabs (he barely made it through the man's visit without yelling at him to get out!) so I had to hide the laptop for a few days until I finally figured out that I needed to reinstall the Operating Systems onto the laptop. I did this and now the laptop works just fine with the English language pack.

I understand that Google or Microsoft might have the people that would cater to my intellectual needs. Please advise me on what I should do, /prog/!

So I want to get into the php thing because I hear that website programmers make good money but nobody wants to spend the time to learn java on those kinds of systems so I started reading about php and it looks kinda cool here's something I wrote:


<?php
$numberOne = 1;
$numberTwo = 2;

class Addition
{
    function __construct()
    {
        $true = true;
        $false = false;
       
        // make REALLy sure our variables are correct!!!!!
        for( $i = 0; $i < 200; $i++ ) {
            if( $true !== true ) {
                exit( 'OH NO' );
            }
            if( $false !== false ) {
                exit( 'OH NO' );
            }
        }
    }
   
    function addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst( $numberOne, $numberTwo )
    {
       
        $numberOneCheck = new ArrayBuilder();
        $numberTwoCheck = new ArrayBuilder();
       
        if( $numberOneCheck->hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe( $numberOne ) === 'NO IT IS NOT AN INTEGER' )
        { exit( 'IT IS NOT A NUMBER' ); }
       
        if( $numberTwoCheck->hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe( $numberTwo ) === 'NO IT IS NOT AN INTEGER' )
        { exit( 'IT IS NOT A NUMBER' ); }
       
        $numberOne = (int)$numberOne;
        $numberTwo = (int)$numberTwo;
       
        $newResult = $numberOne + $numberTwo;
        $newResult = (int)$newResult;

        if( ((int)$newResult - ((int)$numberOne + (int)$numberTwo)) === (int)0 ) {
            return (string)$newResult;
        }
    }
}

class ArrayBuilder
{
    function __construct()
    {
        $true = true;
        $false = false;
       
        // make REALLy sure our variables are correct!!!!!
        for( $i = 0; $i < 200; $i++ ) {
            if( $true !== true ) {
                exit( 'OH NO' );
            }
            if( $false !== false ) {
                exit( 'OH NO' );
            }
        }
    }
   
    function parseArray( $incoming )
    {
        if( $this->makeReallySureTheThingComingInIsActuallyAnArray( $incoming ) !== true ) {
            exit( 'OH NO IT\'S NOT REALLY AN ARRAY :(' );
        }
       
        // ok let's just make sure it isn't really trying to hdie
        if( $this->makeReallySureTheThingComingInIsActuallyAnArray( $incoming ) !== true ) {
            exit( 'haha you thought you could catch me out you cannot i have found out you are not an array mr. not array!!!' );
        }
       
        $count = count( $incoming );
        $count = ($count + ($count - $count)) + 1; // ok we have added 1.
       
        return reset( $incoming );
    }
   
    function hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe( $incoming )
    {
        if (is_array($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_bool($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_callable($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_float($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_int($incoming)) return "YES IT IS AN INTEGER";
        if (is_null($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_numeric($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_object($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_resource($incoming)) return "NO IT IS NOT AN INTEGER";
        if (is_string($incoming)) return "NO IT IS NOT AN INTEGER";

        exit( 'I DON\'T KNOW WHAT IT IS' );
    }
   
    function makeReallySureTheThingComingInIsActuallyAnArray( $incoming )
    {
        for( $i = 0; $i < 200; $i++ ) {
            if( is_array( $incoming ) === true ) {
                // Hmm it might be! let's make sure!
                if( is_bool( $incoming ) === false ) {
                    if( is_callable( $incoming ) === false ) {
                        if( is_double( $incoming ) === false ) {
                            if( is_float( $incoming ) === false ) {
                                if( is_int( $incoming ) === false ) {
                                    if( is_integer( $incoming ) === false ) {
                                        if( is_long( $incoming ) === false ) {
                                            if( is_null( $incoming ) === false ) {
                                                if( is_numeric( $incoming ) === false ) {
                                                    if( is_object( $incoming ) === false ) {
                                                        if( is_real( $incoming ) === false ) {
                                                            if( is_resource( $incoming ) === false ) {
                                                                if( is_scalar( $incoming ) === false ) {
                                                                    if( is_string( $incoming ) === false ) {
                                                                        // ok we cool
                                                                    } else { exit( 'OH NO' ); }
                                                                } else { exit( 'OH NO' ); }
                                                            } else { exit( 'OH NO' ); }
                                                        } else { exit( 'OH NO' ); }
                                                    } else { exit( 'OH NO' ); }
                                                } else { exit( 'OH NO' ); }
                                            } else { exit( 'OH NO' ); }
                                        } else { exit( 'OH NO' ); }
                                    } else { exit( 'OH NO' ); }
                                } else { exit( 'OH NO' ); }
                            } else { exit( 'OH NO' ); }
                        } else { exit( 'OH NO' ); }
                    } else { exit( 'OH NO' ); }
                } else { exit( 'OH NO' ); }
            } else { exit( 'OH NO' ); }
        }
       
        return true;
    }
}

$num[ 1 ] = new ArrayBuilder();
$num[ 2 ] = new ArrayBuilder();

$theNumber[ 1 ] = $num[ 1 ]->parseArray( array(
    $numberOne
) );
$theNumber[ 2 ] = $num[ 2 ]->parseArray( array(
    $numberTwo
) );

$addition = new Addition();

$addition->addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst( (int)(integer)$theNumber[1], (int)(integer)$theNumber[2] );

// oops i frogt to assign it a value!
$newAddition = new Addition();
$theEndValue = $newAddition->addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst( (int)(integer)$theNumber[1], (int)(integer)$theNumber[2] );


echo $theEndValue . ' IS THE NUMBER YOU WANTED TO FIND BY ADDITION';

exit(1);
?>

Name: sage 2011-02-08 8:42

any pointers? nope, unfortunately PHP doesn't have pointers.  Try a REAL programming language like C

Name: Anonymous 2011-02-08 8:46

real PHP programmers use PERL

Name: Anonymous 2011-02-08 8:49

Real PHP programmers do they even exist?

Name: Anonymous 2011-02-08 8:51

>>1-5
VALID PERL CODE

Name: VIPPER 2011-02-08 8:54

>>1
EXPERT PROGRAMMER QUALITY

Name: Anonymous 2011-02-08 8:56

>>5
$ perl6 < /dev/random
VALID PERL 6 CODE

Name: Anonymous 2011-02-08 9:29


php_t *php = NULL;

Name: Anonymous 2011-02-08 9:32

Name: Anonymous 2011-02-08 9:34

so I had to hide the laptop for a few days until I finally figured out that I needed to reinstall the Operating Systems onto the laptop. I did this and now the laptop works just fine with the English language pack.

I understand that Google or Microsoft might have the people that would cater to my intellectual needs. Please advise me on what I should do, /prog/!

[ridiculous source code]

The read was quite entertaining!

Name: Anonymous 2011-02-08 9:47

PHP is a scripting language. Better use production quality compiled language, like Common Lisp. Its provides access to pointers and assembly.

Name: Anonymous 2011-02-08 9:57

>>11
This.
Use a real. fast language like CL.

Name: Anonymous 2011-02-08 10:10

>>11
+1 for lisssssp yay

Name: Anonymous 2011-02-08 10:59

>>12
fast language like CL.
Ok, I lol'd

Name: Anonymous 2011-02-08 11:00

>>11
Agree. Upboated!

Name: Anonymous 2011-02-08 11:08

>>14
TOO BAD C IS PLATFORM DEPENDENT AS FUCK

Name: Anonymous 2011-02-08 11:17

There are no pointers in PHP.

Name: my anus endian 2011-02-08 11:41

>>16
Ok, I forgot. Why is it bad?

Name: Anonymous 2011-02-08 11:48

>>15
Hi, reddit!

Name: Anonymous 2011-02-08 11:54

>>18
Not everyone uses Gentoo like you.

Name: Anonymous 2011-02-08 11:54

Pointers? Here you go.
0x15782901
0x15738291
0x52869102
0xAAFF1589

Name: Anonymous 2011-02-08 11:55

>>21
XKCD? Go back there.
http://www.xkcd.com/

Name: Anonymous 2011-02-08 12:05

Try using ``&&'' next time. IHBT

Name: Anonymous 2011-02-08 12:16

C/C++/C#, Python, PHP

ALL YOU NEED TO KNOW
This is 3-Dog, owwwwww!

Name: Anonymous 2011-02-08 12:50

>>1
I love that huge arrowhead 2/3rds the way through the code.

Name: Anonymous 2011-02-08 12:51

>>24
C, LISP
FTFY

Name: Anonymous 2011-02-08 13:13

Google uses PHP (and Python) so it must be good!

Name: Anonymous 2011-02-08 13:17

>>24
C/C++/C#, Python, PHP

I think you mean Java.

Name: Anonymous 2011-02-08 13:21

>>27
That's my phrase!

Name: Anonymous 2011-02-08 13:53

GOOGLE SLAVES

Name: Anonymous 2011-02-08 14:12

int * IaMNotAPoiNterIAmAFreeVariable

Name: Anonymous 2011-02-08 14:23

>>30
MicroSerfs

Name: Anonymous 2011-02-08 17:03

function __construct()
__

fuck you

Name: Anonymous 2011-02-08 17:37

>>33



fuck you

Name: ^Troll. 2011-02-08 20:19

>>1
This is wrong on an incomprehensible number of levels. Please kill yourself.

Name: Anonymous 2011-02-08 21:23

>>33
doesn't know about them boilerplate functions

Name: Anonymous 2011-02-08 21:25

>>36
dat boiler plate

Name: Anonymous 2011-02-08 22:02

>>1

for( $i = 0; $i < 200; $i++ ) {           for( $i = 0; $i < 200; $i++ ) {
     if( is_array( $incoming ) === true ) {           if( is_array( $incoming ) === true ) {
      // Hmm it might be! let's make sure!           // Hmm it might be! let's make sure!
      if( is_bool( $incoming ) === false ) {           if( is_bool( $incoming ) === false ) {
           if( is_callable( $incoming ) === false ) {           if( is_callable( $incoming ) === false ) {                         if( is_callable( $incoming ) === false ) {/**/if( is_callable( $incoming ) === false ) {
            if( is_double( $incoming ) === false ) {           if( is_double( $incoming ) === false ) {                           if( is_double( $incoming ) === false ) {/******/if( is_double( $incoming ) === false ) {
             if( is_float( $incoming ) === false ) {           if( is_float( $incoming ) === false ) {                     if( is_float( $incoming ) === false ) {/********/if( is_float( $incoming ) === false ) {
                  if( is_int( $incoming ) === false ) {           if( is_int( $incoming ) === false ) {                    if( is_int( $incoming ) === false ) {/************/if( is_int( $incoming ) === false ) {
                   if( is_integer( $incoming ) === false ) {           if( is_integer( $incoming ) === false ) {       if( is_integer( $incoming ) === false ) {/****/if( is_integer( $incoming ) === false ) {
                    if( is_long( $incoming ) === false ) {           if( is_long( $incoming ) === false ) {
                         if( is_null( $incoming ) === false ) {           if( is_null( $incoming ) === false ) {
                          if( is_numeric( $incoming ) === false ) {           if( is_numeric( $incoming ) === false ) {
                               if( is_object( $incoming ) === false ) {           if( is_object( $incoming ) === false ) {
                                if( is_real( $incoming ) === false ) {           if( is_real( $incoming ) === false ) {
                                 if( is_resource( $incoming ) === false ) {           if( is_resource( $incoming ) === false ) {
                                      if( is_scalar( $incoming ) === false ) {           if( is_scalar( $incoming ) === false ) {
                                       if( is_string( $incoming ) === false ) {           if( is_string( $incoming ) === false ) {
                                             //////////////////////           //////////////////////
                                       } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                      } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                 } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                               } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                          } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                         } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                    } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                   } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
                   } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                       } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
                  } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                                   } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
             } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                                   } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
            } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                                               } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
           } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
      } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
     } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
}           }

Name: Anonymous 2011-02-08 22:04

>>38
Fuck you, shiitchan, learn to handle tabs properly.

for( $i = 0; $i < 200; $i++ ) {           for( $i = 0; $i < 200; $i++ ) {
     if( is_array( $incoming ) === true ) {           if( is_array( $incoming ) === true ) {
          // Hmm it might be! let's make sure!           // Hmm it might be! let's make sure!
          if( is_bool( $incoming ) === false ) {           if( is_bool( $incoming ) === false ) {
               if( is_callable( $incoming ) === false ) {           if( is_callable( $incoming ) === false ) {                         if( is_callable( $incoming ) === false ) {/**/if( is_callable( $incoming ) === false ) {
                    if( is_double( $incoming ) === false ) {           if( is_double( $incoming ) === false ) {                        if( is_double( $incoming ) === false ) {/******/if( is_double( $incoming ) === false ) {
                         if( is_float( $incoming ) === false ) {           if( is_float( $incoming ) === false ) {                     if( is_float( $incoming ) === false ) {/********/if( is_float( $incoming ) === false ) {
                              if( is_int( $incoming ) === false ) {           if( is_int( $incoming ) === false ) {                    if( is_int( $incoming ) === false ) {/************/if( is_int( $incoming ) === false ) {
                                   if( is_integer( $incoming ) === false ) {           if( is_integer( $incoming ) === false ) {       if( is_integer( $incoming ) === false ) {/****/if( is_integer( $incoming ) === false ) {
                                        if( is_long( $incoming ) === false ) {           if( is_long( $incoming ) === false ) {
                                             if( is_null( $incoming ) === false ) {           if( is_null( $incoming ) === false ) {
                                                  if( is_numeric( $incoming ) === false ) {           if( is_numeric( $incoming ) === false ) {
                                                       if( is_object( $incoming ) === false ) {           if( is_object( $incoming ) === false ) {
                                                            if( is_real( $incoming ) === false ) {           if( is_real( $incoming ) === false ) {
                                                                 if( is_resource( $incoming ) === false ) {           if( is_resource( $incoming ) === false ) {
                                                                      if( is_scalar( $incoming ) === false ) {           if( is_scalar( $incoming ) === false ) {
                                                                           if( is_string( $incoming ) === false ) {           if( is_string( $incoming ) === false ) {
                                                                                     //////////////////////           //////////////////////
                                                                           } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                                                      } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                                                 } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                                            } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                                       } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                                  } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                             } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
                                        } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                               } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
                                   } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                                    } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
                              } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                                         } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
                         } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                                              } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
                    } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }                                                   } else { exit( 'OH NO' ); }/********************************/} else { exit( 'OH NO' ); }
               } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
          } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
     } else { exit( 'OH NO' ); }           } else { exit( 'OH NO' ); }
}           }

Name: Anonymous 2011-02-08 22:36

>>1
thank you, OP

Name: HAXUS THE DISBELIEVER 2011-02-09 6:12

WHAT HAVE YOU DONE

Name: Anonymous 2011-02-09 6:19

Name: Anonymous 2011-02-09 9:14

>>42
Gay power metal on MY /prog/?

Name: Anonymous 2011-02-09 9:58

>>43
apparently so.

Name: Anonymous 2011-02-10 6:33

>>41
broken everything

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