$a =& $b;
Now $a is an alias for $b. Kinda like *a = \$b; in Perl. And because arrays and objects are copied on assignment
$a = array(5, 6, 7);
$b = $a;
$a[0] = 4;// $a is (4,6,7), $b is (5,6,7)
class Person {
function Person () {// constructor
global $a;
$a[] =& $this;// build array of objs
}
}
$fred = new Person;
$fred->name = "Fred";// $a[0]->name is not set to "Fred"
You have to say
$fred =& new Person;
Yup, you have to change how you call the constructor depending on what the constructor does behind the scenes. PTUI.
--Nat
PHP (Score:2)
And that apparently serves as an excuse for any kind of demented design.
Re:PHP (Score:2)
There's a lesson to be learned from PHP. I'm not sure what it is. It might just be how to market the external face of the technology to newbies (and managers). PHP proves that no amount of dementia will restrict the uptake of the technology, or the ability to attract/create core developers.
Syntax aside, I'm stunned at PHP's popularity, especially when every little extension needs to be compiled into the engine ! Perhaps that's because there are only two extensio
Re:PHP (Score:2)
--Nat
Re:PHP (Score:2)
Either case, that's good news (for next time I need to upgrade a client's PHP install).
Re:PHP (Score:2)
--Nat
Re:PHP (Score:2)
It would be an interesting study to see how user-friendly the PHP model is vs. the other way to do it. Apache seems to have inherited a config file and used it exceedingly well - modules may be compiled in or dynamically loaded, but it's really not a huge concern. (It's compiling and installing modules post-install that needs work...)
I keep trying to find areas where Per
Re:PHP (Score:1)
a) php is lightweight, this is why I (ab)use it.
b) the function names suck (array_*?!)
c) to me it makes a good case against Highlander variables
Just yesterday I really found myself wanting to write
(explode('?', $REQUEST_URI))[0])
and ended up with
array_shift(explode('?', $REQUEST_URI)))
which isn't *too* bad I suppose.
Were that I say, pancakes?