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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: guth at fiifo dot u-psud dot fr
New email:
PHP Version: OS:

 

 [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: Sun Apr 28 20:01:29 2024 UTC