|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-18 23:40 UTC] crrodriguez at suse dot de
[2007-11-23 14:14 UTC] tony2001@php.net
[2007-11-25 10:36 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 02:00:01 2025 UTC |
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