I think I understand the reason because I obtain that output, but I
cannot figure out the motivations for doing it in that way. I should
probably take a look at ZE sources.
Thx. a lot by your help.
Andrey Hristov wrote:
Well, when there is traversion inside the engine, it checks whether
it has
BTW., I'm not sure that there's nothing more wrong here. Takin the first
part of the code of first example:
$Arr = array();
$Arr['self'] = &$Arr;
var_dump ( $Arr );
?>
It returns:
array(1) {
["self"]=>
array(1) {
["self"]=>
*RECURSION*
}
}
Is that as its expected to be? I meant that perhaps
Should I fill a bug notification report or so? (where are them? ;-))
Andrey Hristov wrote:
Francisco M. Marzoa Alonso wrote:
Try this code:
$Arr = array();
$Arr['self'] = &$Arr;
var_dump ( $Arr );
$serdata = serialize ($Arr);
$Arr2 = unserialize ( $serdata );
echo "\n\n
Try this code:
$Arr = array();
$Arr['self'] = &$Arr;
var_dump ( $Arr );
$serdata = serialize ($Arr);
$Arr2 = unserialize ( $serdata );
echo "\n\n";
var_dump ( $Arr2 );
?>
The second array is expected to be exactly as $Arr, but it doesn't. This
is the output for that code:
array(1) {
["self"]=
7; that servers for this
purpouse:
http://www.emerson.emory.edu/services/perl/perldoc/manual/perlfunc/bless.html
But I didn't found an equivalent in PHP.
I'm writting my own serialization routines and I need this to
unserialize objects.
Thx.
Derick Rethans wrote:
On Mon, 25 Oct 2004, Francisc
Hi,
Is it possible to convert an array in an object instance?
I can convert an object in an array as follows:
$Test = new MyClass ();
$TestArray = (array) $Test;
Then I've an array with all members of the object $Test, but it seems
that I cannot simply do:
$TestObject = (MyClass) $TestArray;
To r
Is there any manner to know if a class is a subclass of another from
class name as string?
I meant something in the line of is_subclass_of but using the name of
the child class instead of an object instance.
TIA
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http
Thanks a lot, it was very useful.
Andrey Hristov wrote:
[...]
There is a hack to access private data of an object.
[...]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
I'm trying to wrote my own serialization routines and I've found a
previsible problem: protected members are not visible to my
serialization routine. This is ok and it should be as is, but I've seen
that PHP's serialize function have access to that members anyway, so the
question is: Is there a
This code:
class TestClass {
public $myself;
function __construct () {
$this->myself = $this;
}
}
$TestObj = new TestClass ();
if ( $TestObj->myself == $TestObj ) {
echo "They are same.\n";
}
?>
Gives me a "Fatal error: Nesting level too deep - recursive dependency?"
on lin
10 matches
Mail list logo