Archive: object

 

Posts Tagged ‘object’


If you are using netbeans for PHP classes and you have some of your class properties are instances of other objects and you want to get autocomplete working for them, then you might struggle to figure out which PHPDoc syntax to use to get autocomplete working. Here is the answer: PLAIN TEXT PHP: /** * [...]



 

If you are tearing your hair out trying to figure out why empty($object->property) = true when var_dump($object->property) outputs a value - this might be the problem. It arises if you are using the magic __get() method to serve up object properties. Apparently PHP's empty() function actually uses isset() to determine if the property is empty [...]



 

If you are trying to use associative arrays in Javascript, the first thing is to not use the Array type and instead just use objects. The weird and wonderful thing is that if you create your array as an object, you can still use the array style square brackets to access object properties. So for [...]