From: Adam Williams on
I'm looking at someone's code to learn and I'm relatively new to
programming. In the code I see commands like:

$code->do_command();

I'm not really sure what that means. How would that look in procedural
style programming? do_command($code); or something else?

From: Joshua Kehn on
Adam-

That is a function call. In Java:

class Code
{
public static void function do_command(){ }
}

Code.do_command();

Regards,

-Josh
____________________________________
Joshua Kehn | Josh.Kehn(a)gmail.com
http://joshuakehn.com

On Sep 10, 2010, at 2:27 PM, Adam Williams wrote:

> I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like:
>
> $code->do_command();
>
> I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

From: "Bob McConnell" on
Did you mean to say "That is a method call."?

Bob McConnell

-------------------------
From: Joshua Kehn

That is a function call. In Java:

class Code
{
public static void function do_command(){ }
}

Code.do_command();

Regards,

-Josh
____________________________________
Joshua Kehn | Josh.Kehn(a)gmail.com
http://joshuakehn.com

On Sep 10, 2010, at 2:27 PM, Adam Williams wrote:

> I'm looking at someone's code to learn and I'm relatively new to
programming. In the code I see commands like:
>
> $code->do_command();
>
> I'm not really sure what that means. How would that look in
procedural style programming? do_command($code); or something else?
>
From: Joshua Kehn on
Bob-

Yes, yes I did.

And note that my Java code is incorrect, that should simply be public static void, no function.

This is what I get for taking a week to code everything in Node.js.

Regards,

-Josh
____________________________________
Joshua Kehn | Josh.Kehn(a)gmail.com
http://joshuakehn.com

On Sep 10, 2010, at 2:32 PM, Bob McConnell wrote:

> Did you mean to say "That is a method call."?
>
> Bob McConnell
>
> -------------------------
> From: Joshua Kehn
>
> That is a function call. In Java:
>
> class Code
> {
> public static void function do_command(){ }
> }
>
> Code.do_command();
>
> Regards,
>
> -Josh
> ____________________________________
> Joshua Kehn | Josh.Kehn(a)gmail.com
> http://joshuakehn.com
>
> On Sep 10, 2010, at 2:27 PM, Adam Williams wrote:
>
>> I'm looking at someone's code to learn and I'm relatively new to
> programming. In the code I see commands like:
>>
>> $code->do_command();
>>
>> I'm not really sure what that means. How would that look in
> procedural style programming? do_command($code); or something else?
>>

From: "=?utf-8?B?YXNoQGFzaGxleXNoZXJpZGFuLmNvLnVr?=" on
It's object oriented code. $code is an instance of class, and do_command() is a method if that class. I'd advise reading up on oop php.

Thanks,
Ash
http://www.ashleysheridan.co.uk

----- Reply message -----
From: "Adam Williams" <adam_williams(a)bellsouth.net>
Date: Fri, Sep 10, 2010 19:27
Subject: [PHP] newbie question about code
To: "PHP General list" <php-general(a)lists.php.net>

I'm looking at someone's code to learn and I'm relatively new to
programming. In the code I see commands like:

$code->do_command();

I'm not really sure what that means. How would that look in procedural
style programming? do_command($code); or something else?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 |  Next  |  Last
Pages: 1 2
Prev: php cli question
Next: Standalone WebServer for PHP