#27656 [NEW]: array problems and objects $this

From: Date: Fri, 19 Mar 2004 11:41:20 +0000
Subject: #27656 [NEW]: array problems and objects $this
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56670@lists.php.net to get a copy of this message
From:             emanuel at oxylus dot ro
Operating system: Redhat 9/Apache 1.3.29
PHP version:      5.0.0RC1
PHP Bug Type:     Scripting Engine problem
Bug description:  array problems and objects $this

Description:
------------
I'm getting this error in php5rc1

Fatal error: Cannot use string offset as an array in
/www/base/modules/eshop/module.php on line 374

count($product["prices"][1]["prices"])>0 , which worked in 4.x
its kinda too hard to check step by step to be sure is array
["prices"], then ["prices"]["1"] and then
["prices"][1]["prices"]

The second problem is with some objects:

this is the code:

<?php 

class CObject {

	function Test() {

		$this->var1 = "test";

		function Test2( $this ) {
			echo $this->var1;
		}

		Test2(&$this);		
	}
	
}


$test = new CObject;
$test->Test();

?>

in php4.x the output is "test"
in 5rc1

Fatal error: Non-static method CObject::Test2() cannot be called
statically in /home/www/work.phpbase.net/obj/test.php on line 13


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


Thread (3 messages)

« previous php.bugs (#56670) next »