For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > July 2006 > cvs: ZendEngine2 /tests bug37667.phpt









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 /tests bug37667.phpt
Marcus Boerger

2006-07-09, 6:56 pm

helly Mon Jul 10 00:10:14 2006 UTC

Added files:
/ZendEngine2/tests bug37667.phpt
Log:
- Add new test



http://cvs.php.net/viewvc.cgi/ZendE...=markup&rev=1.1
Index: ZendEngine2/tests/bug37667.phpt
+++ ZendEngine2/tests/bug37667.phpt
--TEST--
#37667 (Object is not added into array returned by __get)
--FILE--
<?php

class Test
{
protected $property = array('foo' => 'bar');

function __get($name)
{
return $this->property;
}
}

$obj = new Test;

var_dump($obj->property['foo']);
var_dump($obj->property[2]);

var_dump($obj);

$obj->property[] = 1;
$obj->property[] = 2;

var_dump($obj);

?>
===DONE===
--EXPECTF--
string(3) "bar"

Notice: Undefined offset: 2 in %sbug37667.php on line %d
NULL
object(Test)#%d (1) {
["property":protected]=>
array(1) {
["foo"]=>
string(3) "bar"
}
}

Fatal error: Cannot use array returned from Test::__get('property') in write context in %sbug37667.php on line %d
--UEXPECTF--
unicode(3) "bar"

Notice: Undefined offset: 2 in %sbug37667.php on line %d
NULL
object(Test)#%d (1) {
[u"property":protected]=>
array(1) {
[u"foo"]=>
unicode(3) "bar"
}
}

Fatal error: Cannot use array returned from Test::__get('property') in write context in %sbug37667.php on line %d
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com