1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00

Added some class tests; Replaced some hardcoded instance ids with %d.

This commit is contained in:
Steve Seear
2008-03-19 17:56:08 +00:00
parent 7533d77bb0
commit 07fb7b6377
6 changed files with 100 additions and 24 deletions
+8 -8
View File
@@ -129,9 +129,9 @@ string(6) "FooBar"
string(9) "FooBarBaz"
===ArrayOverloading===
ArrayProxy::__construct(0)
object(ArrayProxy)#1 (2) {
object(ArrayProxy)#%d (2) {
["object":"ArrayProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
["person"]=>
array(1) {
[0]=>
@@ -166,9 +166,9 @@ string(12) "FooBarBarBaz"
ArrayProxy::__construct(0)
ArrayProxy::offsetUnset(0, name)
ArrayProxy::__construct(0)
object(ArrayProxy)#1 (2) {
object(ArrayProxy)#%d (2) {
["object":"ArrayProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
["person"]=>
array(1) {
[0]=>
@@ -194,9 +194,9 @@ unicode(6) "FooBar"
unicode(9) "FooBarBaz"
===ArrayOverloading===
ArrayProxy::__construct(0)
object(ArrayProxy)#1 (2) {
object(ArrayProxy)#%d (2) {
[u"object":u"ArrayProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
[u"person"]=>
array(1) {
[0]=>
@@ -231,9 +231,9 @@ unicode(12) "FooBarBarBaz"
ArrayProxy::__construct(0)
ArrayProxy::offsetUnset(0, name)
ArrayProxy::__construct(0)
object(ArrayProxy)#1 (2) {
object(ArrayProxy)#%d (2) {
[u"object":u"ArrayProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
[u"person"]=>
array(1) {
[0]=>
+8 -8
View File
@@ -105,9 +105,9 @@ string(9) "FooBarBaz"
Notice: Array to string conversion in %s on line %d
ArrayReferenceProxy::__construct(Array)
object(ArrayReferenceProxy)#1 (2) {
object(ArrayReferenceProxy)#%d (2) {
["object":"ArrayReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
["person"]=>
array(1) {
[0]=>
@@ -181,9 +181,9 @@ ArrayReferenceProxy::offsetUnset(Array, name)
Notice: Array to string conversion in %s on line %d
ArrayReferenceProxy::__construct(Array)
object(ArrayReferenceProxy)#1 (2) {
object(ArrayReferenceProxy)#%d (2) {
["object":"ArrayReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
["person"]=>
array(1) {
[0]=>
@@ -224,9 +224,9 @@ unicode(9) "FooBarBaz"
Notice: Array to string conversion in %s on line %d
ArrayReferenceProxy::__construct(Array)
object(ArrayReferenceProxy)#1 (2) {
object(ArrayReferenceProxy)#%d (2) {
[u"object":u"ArrayReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
[u"person"]=>
array(1) {
[0]=>
@@ -300,9 +300,9 @@ ArrayReferenceProxy::offsetUnset(Array, name)
Notice: Array to string conversion in %s on line %d
ArrayReferenceProxy::__construct(Array)
object(ArrayReferenceProxy)#1 (2) {
object(ArrayReferenceProxy)#%d (2) {
[u"object":u"ArrayReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
[u"person"]=>
array(1) {
[0]=>
+8 -8
View File
@@ -112,9 +112,9 @@ string(6) "FooBar"
string(9) "FooBarBaz"
===ArrayOverloading===
ArrayAccessReferenceProxy::__construct(0)
object(ArrayAccessReferenceProxy)#1 (3) {
object(ArrayAccessReferenceProxy)#%d (3) {
["object":"ArrayAccessReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
["person"]=>
&array(1) {
[0]=>
@@ -157,9 +157,9 @@ string(12) "FooBarBarBaz"
ArrayAccessReferenceProxy::__construct(0)
ArrayAccessReferenceProxy::offsetUnset(0, name)
ArrayAccessReferenceProxy::__construct(0)
object(ArrayAccessReferenceProxy)#1 (3) {
object(ArrayAccessReferenceProxy)#%d (3) {
["object":"ArrayAccessReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
["person"]=>
&array(1) {
[0]=>
@@ -191,9 +191,9 @@ unicode(6) "FooBar"
unicode(9) "FooBarBaz"
===ArrayOverloading===
ArrayAccessReferenceProxy::__construct(0)
object(ArrayAccessReferenceProxy)#1 (3) {
object(ArrayAccessReferenceProxy)#%d (3) {
[u"object":u"ArrayAccessReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
[u"person"]=>
&array(1) {
[0]=>
@@ -236,9 +236,9 @@ unicode(12) "FooBarBarBaz"
ArrayAccessReferenceProxy::__construct(0)
ArrayAccessReferenceProxy::offsetUnset(0, name)
ArrayAccessReferenceProxy::__construct(0)
object(ArrayAccessReferenceProxy)#1 (3) {
object(ArrayAccessReferenceProxy)#%d (3) {
[u"object":u"ArrayAccessReferenceProxy":private]=>
object(Peoples)#2 (1) {
object(Peoples)#%d (1) {
[u"person"]=>
&array(1) {
[0]=>
@@ -0,0 +1,24 @@
--TEST--
default argument value in interface implementation
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
<?php
interface test {
public function bar();
}
class foo implements test {
public function bar($arg = 2) {
var_dump($arg);
}
}
$foo = new foo;
$foo->bar();
?>
--EXPECT--
int(2)
@@ -0,0 +1,31 @@
--TEST--
Method override allows optional default argument
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
<?php
class A {
function foo($arg1 = 1) {
}
}
class B extends A {
function foo($arg1 = 2, $arg2 = 3) {
var_dump($arg1);
var_dump($arg2);
}
}
class C extends A {
function foo() {
}
}
$b = new B();
$b->foo(1);
?>
--EXPECTF--
Fatal error: Declaration of C::foo() must be compatible with that of A::foo() in %s on line %d
@@ -0,0 +1,21 @@
--TEST--
Omitting optional arg in method inherited from abstract class
--FILE--
<?php
abstract class A {
function foo($arg = 1) {}
}
class B extends A {
function foo() {
echo "foo\n";
}
}
$b = new B();
$b->foo();
?>
--EXPECTF--
Fatal error: Declaration of B::foo() must be compatible with that of A::foo() in %s on line %d