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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: olgo at city dot ee
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

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

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 14:01:31 2025 UTC