PHP weirdness extending IMagick class

Posted by Jamie Carl on Stack Overflow See other posts from Stack Overflow or by Jamie Carl
Published on 2010-11-05T03:46:26Z Indexed on 2011/01/08 23:53 UTC
Read the original article Hit count: 247

Filed under:
|
|

This is a really weird one. I have some code that is happily working on version 2.1.1RC1 of the php5-imagick module. It's basically just a class I wrote that extends the Imagick class and manages images stored in a database.

Since upgrading to version 3.0.0RC1 (thankfully only on my dev box) things have gone to hell. It seems that object members are writeable but are NOT readable. Take the following sample code:

class db_image extends IMagick {

private $data;

function __construct( $id = null ){
    parent::__construct();

    $this->data = 'some plain text';

    echo $this->data;
}

This will output absolutely NOTHING. My debugger indicates that the contents of $this->data are the correct string value, but I am unable to read the value back out of the member variable.

Seriously. WTF? Does anyone know what is causing this or has seen it before? I don't even know how to replicate this behaviour in my own classes.

© Stack Overflow or respective owner

Related posts about php

Related posts about php5