Interpret Order


Posted on 16th Feb 2014 07:03 pm by admin

Hello all,

I'm wondering if I have this:

Code: $switch = array(
'one' => $this->RenderOne()
,'two' => $this->RenderTwo()
);

Would php call the function $this->RenderOne() on assignment of $switch or does it call the function when $switch['one'] is used?

I'd like it if the function is called when $switch['one'] is used.

I know I can easily use a switch statement to get the desired behaviour. I was just curious as to how it got interpreted in this case.

Thanks in advance

No comments posted yet

Your Answer:

Login to answer
82 Like 21 Dislike
Previous forums Next forums
Other forums

php slowing my site?
Hi all,

I think that one of the reasons that my site doesn't work fast is that the code is ve

Passing PHP variables from one page to another
Hello-

I'm having trouble figuring out how to transport a variable from one php file to anoth

php unable to sent email
Hi, guys, I try to send a email through php but unfortunately the mail unable to sent. Here is my co

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

All possible combinations of String in PL/SQL
Hi All,

Could you please explain the logic of getting all possible combinations of String

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

DB2 for z/OS, LUW, iSeries
Hello, In this forum a lot of threads related to other members of the DB2 family than DB2 for z/OS

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

Problem with HTML form
Hello,

I made a HTML form with some fields and check box.
Everything works fine except whe

webpage with (simple) login & mysql-db
Hi all,

What I was looking for before was a multi-user password manager, web-based! The offer

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash