php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31083 Fatal error on assigning reference to class variable in overloaded class
Submitted: 2004-12-14 08:59 UTC Modified: 2004-12-17 19:27 UTC
From: olgo at city dot ee Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.3.9 OS: windows XP SP2
Private report: No CVE-ID: None
 [2004-12-14 08:59 UTC] olgo at city dot ee
Description:
------------
standard windows php 4.3.9 
apache 2 handler
globals off.

Assigning reference to class variable in overloaded class constructor/any method.


Reproduce code:
---------------
<?php
# php 4.3.9 , apache 2.0.52
class containerClass {
  var $data;
  function containerClass(&$data) {
    $this->data =& $data;
  }
  function __set($prop_name, $prop_value) { 
    return true;
  }
}
overload("containerClass");
$contentObject = new stdclass;
$containerObject = new containerClass($contentObject);
?>

Expected result:
----------------
blank page :D
---
actually "fixed" the problem with using global directive, but it still seems to be a bug. So enjoy.

Actual result:
--------------
Fatal error: Cannot create references to/from string offsets nor overloaded objects in C:\Program Files\Apache Group\Apache2\htdocs\itabi\dev\kala.php on line 8

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-17 19:27 UTC] sniper@php.net
Please read the error message.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 23:01:30 2024 UTC