Bug #11565 Updated: classes/objects
| From: | derick@php.net | Date: | Wed, 20 Jun 2001 06:40:14 +0000 |
| Subject: | Bug #11565 Updated: classes/objects | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57341@lists.php.net to get a copy of this message | ||
ID: 11565
Updated by: derick
Reported By: i6razi@vdu.lt
Old-Status: Open
Status: Duplicate
Bug Type: Scripting Engine problem
Operating system:
PHP Version: 4.0.4pl1
Assigned To:
Comments:
For both your requests are already feature requests filed.
So I'm marking this one as duplicate. However, I was to lazy to look up the bug id's, and
that's why I didn't add them here.
Derick
Previous Comments:
---------------------------------------------------------------------------
[2001-06-19 13:22:46] i6razi@vdu.lt
Hello,
In the following example source:
<?php
class A
{
var $property = 'string value';
function methodA()
{
echo "$this->propertyn";
}
}
class B
{
var $objArray = array();
var $currentObj = 0;
function B()
{
$this->objArray[$this->currentObj] = new A;
}
function methodB($index = 0)
{
return $this->objArray[$index];
}
}
$b = new B;
/*
* This works:
*/
$b->objArray[$b->currentObj]->methodA();
/*
* But this don't:
*/
// $b->methodB()->methodA();
?>
Is it possible to get this work? It is something like collections in JScript of Internet Explorer,
for example:
<HTML>
<SCRIPT LANGUAGE="JScript">
function numberCells() {
var count=0;
for (i=0; i < document.all.mytable.rows.length; i++) {
for (j=0; j < document.all.mytable.rows(i).cells.length; j++) {
// Looks like rows() is method of mytable and
// cells() is method of object returned by rows()
document.all.mytable.rows(i).cells(j).innerText = count;
// ~~~~~~~ ~~~~~~~~
count++;
}
}
}
</SCRIPT>
<BODY onload="numberCells()">
<TABLE id=mytable border=1>
<TR><TH> </TH><TH> </TH><TH> </TH><TH> </TH></TR>
<TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
<TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD></TR>
</TABLE>
</BODY>
</HTML>
The following example works in PHP3, but not in PHP4:
<?php
class A
{
var $var = 'some value';
}
class B
{
var $date = date('Y.m.d');
var $a = new A;
}
?>
Is it possible to get it work in PHP4? Maybe, in the future versions of PHP4?
If it's possible let me know about this.
Ramunas
P.s. Sorry for my English.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11565&edit=2