ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-Dev
php-Dev
#26059 [Ver->Csd]: Call to __set() crashes when setting array element
by other posts by this author
Feb 16 2004 12:07AM messages near this date
#26059 [NEW]: Call to __set() crashes Apache when setting array element! | #26059 [Opn->Ver]: Call to __set() crashes Apache when setting array element!
ID:               26059
 Updated by:       helly@[...].net
 Reported By:      myle34 at hotmail dot com
-Status:           Verified
+Status:           Closed
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5CVS-2004-02-10
 New Comment:

Thie script is no longer possible since it produces a fatal error. The
problem here was accessing an indexed  value through a virtual property
of type array. This is now no longer possible, you may want to use
array overloading instead.


Previous Comments:
------------------------------------------------------------------------

[2003-10-31 12:41:29] myle34 at hotmail dot com

Description:
------------
I am using PHP5-b2 and Apache 2.0.47 with Windows XP. Apache crashes
when the below code is run.

Reproduce code:
---------------
class Foo {
    private $bar = array();
    function __get($var) {
        return(isset($this-> bar[$var]) ? $this->bar[$var] : NULL);

    }
    function __set($var,$val) {
        $this-> bar[$var] = $val;

    }
}

$foo = new Foo();

// Works
// $foo-> test = array('testing'=>'testing, 1...2...3...');


// Doesn't work, crashes Apache
$foo-> test = array();

$foo-> test['testing'] = 'testing, 1...2...3...';


print_r($foo-> test);

Expected result:
----------------
Array
(
    [testing] =>  testing, 1...2...3...

)

Actual result:
--------------
Apache crashes! No output.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26059&edit=1
Thread:
myle34 at hotmail dot com



Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved