Strict Standards and nonexistent instances.

php.internals

Pawel Bernat

21 years ago
Hello, when use of nonexistent object happens, PHP generates E_STRICT message ("Creating default object from empty value") - via make_real_object (zend_execute.c). Unfortunately, it appears only if it's like: $idontexist->someinteger = 1; $idontexist->somestring = 'foo'; $idontexist->somearray = array('bar'); When call is $idontexist->somearray[] = 'bas'; nothing happens, but looks like stdClass instance is spawned. Is it expected behaviour or just a bug? It's really annoying to find typos in instances names without such message, also I found no way to intercept them via __autoload as PHP creates stdClass instance silently (maybe playing around stdClass would help, but well...). Best regards,
-- Paweł Bernat; uselessness' lover; select'<asm'||chr(64)||'asm'||'.'||'flynet'||chr(46)||'pl>'as email; Slowly and surely the unix crept up on the Nintendo user ...