Jump to content

jaunty_mellifluous

Members
  • Posts

    15
  • Joined

  • Last visited

About jaunty_mellifluous

  • Birthday 12/11/1983

Contact Methods

  • Website URL
    http://www.roadsout.com

Profile Information

  • Gender
    Male

jaunty_mellifluous's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks. Yea, that's what I thought about the double underscore. They have a single one in the book I'm using. Must be a typo.
  2. echo "bitches" . "<br />"; class classname { function _contruct($param) { echo "Contructor called with parameter ".$param; } } $a = new classname("First"); $b = new classname("Second"); I'm trying to run this code but it's not giving me any output. Output should be very simple, e.g, Constructor called with parameter First. Please help.
  3. No, I'm just talking about the $ sign in ${$my_var_name} earlier in the program when the dynamic function is called as ${"foo"} it's purpose is to increment foo right. But when $my_var_name is made equals to $foo and when it is called to be incremented we add an additional ${$my_var_name} to it inside the parenthesis. While before with foo we did not do that. So that is what I was asking about, why is that so?
  4. Thanks bro. Kinda hard to grasp. But I'll keep it in mind.
  5. <?php $foo = 5; $too = 7; ${"foo"}++; ${"too"}++; echo $foo; echo '<br />' . $too; $my_var_name = "foo"; ${$my_var_name}++; echo $foo; ?> I understand the part that $my_var_name is going to increment $foo. But I don't understand that when we used ${"foo"} we did not add the $ sign with it. But when we use ${$my_var_name} we have to add another $ sign. why is that?
  6. <?php function getglobal() { global $my_global; echo "The value of \$foobar is '$foobar' <br />"; } $my_global = 20; getglobal(); ?> It's supposed to give the result, But instead when I try it, its giving me So I don't really understand what's happening and why it's not working.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.