From:             brad at info-link dot net
Operating system: RedHat Linux 7.3
PHP version:      5.0.0RC1
PHP Bug Type:     PHP options/info functions
Bug description:  zend.ze1_compatibility_mode = On causes object properties to be 
misreported

Description:
------------
When zend.ze1_compatibility_mode = On, the functions such as print_r and
get_object_vars seem to always return the values from the _class_
variables, NOT the current _object_ variable values.  The problem doesn't
seem to exist with zend.ze1_compatibility_mode = Off.



Reproduce code:
---------------
<?php

  class A {

    var $a = "Default for A";

    var $b = "Default for B";



    function __construct($a, $b) {

      $this->a = $a;

      $this->b = $b;

    }

    function A() {

      $args = func_get_args();

      call_user_func_array(Array(&$this, '__construct'), $args);

    }

  }



  $t = new A("New A", "New B");

  print_r($t);

  print_r(get_class_vars(get_class($t)));

  print_r(get_object_vars($t));

?>

Expected result:
----------------
a Object

(

    [a] => New A

    [b] => New B

)

Array

(

    [a] => Default for A

    [b] => Default for B

)

Array

(

    [a] => New A

    [b] => New B

)

Actual result:
--------------
A Object

(

    [a] => Default for A

    [b] => Default for B

)

Array

(

    [a] => Default for A

    [b] => Default for B

)

Array

(

    [a] => Default for A

    [b] => Default for B

)

-- 
Edit bug report at http://bugs.php.net/?id=27641&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27641&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27641&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27641&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27641&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27641&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27641&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27641&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27641&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27641&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27641&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27641&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27641&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27641&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27641&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27641&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27641&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27641&r=float

Reply via email to