php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31686 Incoherent behaviour
Submitted: 2005-01-25 12:26 UTC Modified: 2005-05-07 18:30 UTC
From: guth at fiifo dot u-psud dot fr Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.3 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
31 + 18 = ?
Subscribe to this entry?

 
 [2005-01-25 12:26 UTC] guth at fiifo dot u-psud dot fr
Description:
------------
hello,

Classes A/B and C/D are identical, i just changed a default value from an 'int' to an 'array'.

See at the expected and actual results to understand the problem.



Reproduce code:
---------------
<?php
class A {

	protected static $plop = 42;

}

class B extends A {

	public function __construct() {
		self::$plop = 43;
		var_dump(self::$plop);
	}

}

new B;


class C {

	protected static $plop = array('42');
	
	public function __construct() {
		self::$plop = array('12');
	}

}

class D extends C {

	public function __construct() {
		parent::__construct();
		var_dump(self::$plop);
	}

}

new D;
?>

Expected result:
----------------
int(43)
array(1) { [0]=>  string(2) "43" }

Actual result:
--------------
int(43)
array(1) { [0]=>  string(2) "42" }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-07 03:18 UTC] guth at fiifo dot u-psud dot fr
No change.

Seems to be the same bug than bug #30140.
 [2005-05-07 18:30 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Do NOT report same bugs many times.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 05:01:28 2024 UTC