Strict Standards and nonexistent instances.
| From: | Pawel Bernat | Date: | Wed, 09 Feb 2005 15:33:22 +0000 |
| Subject: | Strict Standards and nonexistent instances. | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-14750@lists.php.net to get a copy of this message | ||
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 ...