summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-05-31 14:55:16 +0000
committerAntony Dovgal <tony2001@php.net>2006-05-31 14:55:16 +0000
commit1fdb25459111ef9a81c4f52a5d2f400c3a875791 (patch)
treea079a04769d438721c6e8a61683ec00e0c06e6e4
parent4e662470f77957e6edf0ca867a9e73888ec5fbb7 (diff)
downloadphp-git-1fdb25459111ef9a81c4f52a5d2f400c3a875791.tar.gz
add tests for new E_FATALs
-rw-r--r--Zend/tests/objects_001.phpt60
-rw-r--r--Zend/tests/objects_002.phpt23
-rw-r--r--Zend/tests/objects_003.phpt23
-rw-r--r--Zend/tests/objects_004.phpt23
-rw-r--r--Zend/tests/objects_005.phpt23
-rw-r--r--Zend/tests/objects_006.phpt23
-rw-r--r--Zend/tests/objects_007.phpt23
-rw-r--r--Zend/tests/objects_008.phpt23
-rw-r--r--Zend/tests/objects_009.phpt23
9 files changed, 244 insertions, 0 deletions
diff --git a/Zend/tests/objects_001.phpt b/Zend/tests/objects_001.phpt
new file mode 100644
index 0000000000..5cdc3dded0
--- /dev/null
+++ b/Zend/tests/objects_001.phpt
@@ -0,0 +1,60 @@
+--TEST--
+comparing objects to other types
+--FILE--
+<?php
+
+class Bar {
+}
+
+$b = new Bar;
+
+var_dump($b == NULL);
+var_dump($b != NULL);
+var_dump($b == true);
+var_dump($b != true);
+var_dump($b == false);
+var_dump($b != false);
+var_dump($b == "");
+var_dump($b != "");
+var_dump($b == 0);
+var_dump($b != 0);
+var_dump($b == 1);
+var_dump($b != 1);
+var_dump($b == 1.0);
+var_dump($b != 1.0);
+var_dump($b == 1);
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+bool(false)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(false)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(true)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(true)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(false)
+
+Notice: Object of class Bar could not be converted to double in %s on line %d
+bool(true)
+
+Notice: Object of class Bar could not be converted to double in %s on line %d
+bool(false)
+
+Notice: Object of class Bar could not be converted to int in %s on line %d
+bool(true)
+Done
diff --git a/Zend/tests/objects_002.phpt b/Zend/tests/objects_002.phpt
new file mode 100644
index 0000000000..ac79e8de97
--- /dev/null
+++ b/Zend/tests/objects_002.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo() {}
+}
+
+class test2 extends test {
+ function foo() {}
+}
+
+class test3 extends test {
+ function foo($arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d
diff --git a/Zend/tests/objects_003.phpt b/Zend/tests/objects_003.phpt
new file mode 100644
index 0000000000..9041e30110
--- /dev/null
+++ b/Zend/tests/objects_003.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg) {}
+}
+
+class test2 extends test {
+ function foo($arg) {}
+}
+
+class test3 extends test {
+ function foo($arg, $arg2) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d
diff --git a/Zend/tests/objects_004.phpt b/Zend/tests/objects_004.phpt
new file mode 100644
index 0000000000..14620c15a4
--- /dev/null
+++ b/Zend/tests/objects_004.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg) {}
+}
+
+class test2 extends test {
+ function foo($arg) {}
+}
+
+class test3 extends test {
+ function foo(&$arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d
diff --git a/Zend/tests/objects_005.phpt b/Zend/tests/objects_005.phpt
new file mode 100644
index 0000000000..d4ab8697c4
--- /dev/null
+++ b/Zend/tests/objects_005.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function &foo() {}
+}
+
+class test2 extends test {
+ function &foo() {}
+}
+
+class test3 extends test {
+ function foo() {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d
diff --git a/Zend/tests/objects_006.phpt b/Zend/tests/objects_006.phpt
new file mode 100644
index 0000000000..67f43c33bb
--- /dev/null
+++ b/Zend/tests/objects_006.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg, $arg2 = NULL) {}
+}
+
+class test2 extends test {
+ function foo($arg, $arg2 = NULL) {}
+}
+
+class test3 extends test {
+ function foo($arg, $arg2) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d
diff --git a/Zend/tests/objects_007.phpt b/Zend/tests/objects_007.phpt
new file mode 100644
index 0000000000..21e07c0c9e
--- /dev/null
+++ b/Zend/tests/objects_007.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo($arg, &$arg2 = NULL) {}
+}
+
+class test2 extends test {
+ function foo($arg, &$arg2 = NULL) {}
+}
+
+class test3 extends test {
+ function foo($arg, &$arg2) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d
diff --git a/Zend/tests/objects_008.phpt b/Zend/tests/objects_008.phpt
new file mode 100644
index 0000000000..49ad42ded2
--- /dev/null
+++ b/Zend/tests/objects_008.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo(Test $arg) {}
+}
+
+class test2 extends test {
+ function foo(Test $arg) {}
+}
+
+class test3 extends test {
+ function foo(Test3 $arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d
diff --git a/Zend/tests/objects_009.phpt b/Zend/tests/objects_009.phpt
new file mode 100644
index 0000000000..67611f14e2
--- /dev/null
+++ b/Zend/tests/objects_009.phpt
@@ -0,0 +1,23 @@
+--TEST--
+method overloading with different method signature
+--INI--
+error_reporting=8191
+--FILE--
+<?php
+
+class test {
+ function foo(Test $arg) {}
+}
+
+class test2 extends test {
+ function foo(Test $arg) {}
+}
+
+class test3 extends test {
+ function foo($arg) {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Declaration of test3::foo() must be compatible with that of test::foo() in %s on line %d