php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27656 array problems and objects $this
Submitted: 2004-03-19 06:41 UTC Modified: 2004-03-19 07:07 UTC
From: emanuel at oxylus dot ro Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0RC1 OS: Redhat 9/Apache 1.3.29
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: emanuel at oxylus dot ro
New email:
PHP Version: OS:

 

 [2004-03-19 06:41 UTC] emanuel at oxylus dot ro
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-19 06:50 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

You can never nest functions like you did.
 [2004-03-19 07:07 UTC] emanuel at oxylus dot ro
What about the backward compatibility ? php4-5?
Isnt suposed to work all what was made using php4 in php5 ?

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 10 19:01:28 2024 UTC