ID: 43322 Comment by: crrodriguez at suse dot de Reported By: felipensp at gmail dot com Status: Open Bug Type: Scripting Engine problem PHP Version: 6CVS-2007-11-18 (snap) New Comment:
<?php $this[] = new stdClass; // no error ?> happends as well on 5_3 as is wrong :( maybe dmitry can check this out. Previous Comments: ------------------------------------------------------------------------ [2007-11-18 13:15:38] felipensp at gmail dot com Description: ------------ $this[] outside of class not produces error. Reproduce code: --------------- <?php class foo { public function __construct() { $this[] = 1; } } // Fatal error: Cannot re-assign $this // $this = new foo; // Fatal error: Using $this when not in object context // $this->a = new foo; // Fatal error: Cannot use object of type foo as array // new foo; $this[] = new stdClass; // no error Expected result: ---------------- Fatal error: Using $this when not in object context Actual result: -------------- No error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43322&edit=1