object-properties

Variable Variables Pointing to Arrays or Nested Objects

Hi, Is it possible to create a variable variable pointing to an array or to nested objects? The php docs specifically say you cannot point to SuperGlobals but its unclear (to me at least) if this applies to arrays in general. Here is my try at the array var var. // Array Example $arrayTest = array('value0', 'value1'); ...

Passing Objects into PHP constructor error

Hello, Is it possible to pass an object into the constructor of a PHP class, and set that object as a global variable that can be used by the rest of the functions in the class? For example: class test { function __construct($arg1, $arg2, $arg3) { global $DB, $ode, $sel; $DB = arg1; $ode = arg2; $sel = $ar...

Is an if with a continue a good pattern to prevent excessive nesting while iterating over properties in Javascript?

I normally use this pattern to iterate over object properties: for(var property in object) { if(object.hasOwnProperty(property)) { ... } } I don't like this excessive indentation and recently it was pointed out to me that I could get rid of it by doing this: for(var property in object) { if(!object.hasOwnProperty(prope...