summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/bug31683.phpt2
-rw-r--r--Zend/tests/bug43200.phpt51
-rw-r--r--Zend/tests/bug43200_2.phpt25
-rw-r--r--Zend/tests/bug48693.phpt4
-rw-r--r--Zend/tests/bug54262.phpt6
-rw-r--r--Zend/tests/bug55509.phpt65
-rw-r--r--Zend/tests/bug60099.phpt10
-rw-r--r--Zend/tests/bug60138.phpt16
-rw-r--r--Zend/tests/bug60139.phpt30
-rw-r--r--Zend/tests/inter_007.phpt2
-rw-r--r--Zend/tests/inter_04.phpt4
-rw-r--r--Zend/tests/objects_018.phpt4
12 files changed, 209 insertions, 10 deletions
diff --git a/Zend/tests/bug31683.phpt b/Zend/tests/bug31683.phpt
index 4e0159d6c..205aca074 100644
--- a/Zend/tests/bug31683.phpt
+++ b/Zend/tests/bug31683.phpt
@@ -1,7 +1,5 @@
--TEST--
Bug #31683 (changes to $name in __get($name) override future parameters)
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
--FILE--
<?php
diff --git a/Zend/tests/bug43200.phpt b/Zend/tests/bug43200.phpt
new file mode 100644
index 000000000..24a8bbb1d
--- /dev/null
+++ b/Zend/tests/bug43200.phpt
@@ -0,0 +1,51 @@
+--TEST--
+Bug #43200 (Interface implementation / inheritence not possible in abstract classes)
+--FILE--
+<?php
+
+interface a {
+ function foo();
+ function bar();
+}
+interface b {
+ function foo();
+}
+
+abstract class c {
+ function bar() { }
+}
+
+class x extends c implements a, b {
+ function foo() { }
+}
+
+ReflectionClass::export('x');
+
+?>
+--EXPECTF--
+Class [ <user> class x extends c implements a, b ] {
+ @@ %s 15-17
+
+ - Constants [0] {
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [0] {
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [2] {
+ Method [ <user, prototype b> public method foo ] {
+ @@ %s 16 - 16
+ }
+
+ Method [ <user, inherits c, prototype a> public method bar ] {
+ @@ %s 12 - 12
+ }
+ }
+}
+
diff --git a/Zend/tests/bug43200_2.phpt b/Zend/tests/bug43200_2.phpt
new file mode 100644
index 000000000..5efc5facf
--- /dev/null
+++ b/Zend/tests/bug43200_2.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #43200.2 (Interface implementation / inheritence not possible in abstract classes)
+--FILE--
+<?php
+
+interface A {
+ function foo();
+}
+
+abstract class B implements A {
+ abstract public function foo();
+}
+
+class C extends B {
+ public function foo() {
+ echo 'works';
+ }
+}
+
+$o = new C();
+$o->foo();
+
+?>
+--EXPECTF--
+works
diff --git a/Zend/tests/bug48693.phpt b/Zend/tests/bug48693.phpt
index e57434602..e5f7ce8f4 100644
--- a/Zend/tests/bug48693.phpt
+++ b/Zend/tests/bug48693.phpt
@@ -18,9 +18,9 @@ var_dump(
?>
--EXPECTF--
-Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
+Parse error: %s in %s(%d) : runtime-created function on line 1
-Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
+Parse error: %s %s(%d) : runtime-created function on line 1
bool(false)
int(2)
bool(false)
diff --git a/Zend/tests/bug54262.phpt b/Zend/tests/bug54262.phpt
index 24c7122fc..1b9d3513c 100644
--- a/Zend/tests/bug54262.phpt
+++ b/Zend/tests/bug54262.phpt
@@ -11,7 +11,7 @@ echo "ok\n";
--EXPECTF--
bool(true)
-Warning: Attempt to modify property of non-object in %s/Zend/tests/bug54262.php on line 4
+Warning: Attempt to modify property of non-object in %sbug54262.php on line 4
-Warning: Cannot use a scalar value as an array in %s/Zend/tests/bug54262.php on line 5
-ok \ No newline at end of file
+Warning: Cannot use a scalar value as an array in %sbug54262.php on line 5
+ok
diff --git a/Zend/tests/bug55509.phpt b/Zend/tests/bug55509.phpt
new file mode 100644
index 000000000..b78fceb0d
--- /dev/null
+++ b/Zend/tests/bug55509.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Bug #55509 (segfault on x86_64 using more than 2G memory)
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) {
+ die('skip Not for 32-bits OS');
+}
+if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+// check the available memory
+if (PHP_OS == 'Linux') {
+ $lines = file('/proc/meminfo');
+ $infos = array();
+ foreach ($lines as $line) {
+ $tmp = explode(":", $line);
+ $index = strtolower($tmp[0]);
+ $value = (int)ltrim($tmp[1], " ")*1024;
+ $infos[$index] = $value;
+ }
+ $freeMemory = $infos['memfree']+$infos['buffers']+$infos['cached'];
+ if ($freeMemory < 2100*1024*1024) {
+ die('skip Not enough memory.');
+ }
+}
+elseif (PHP_OS == 'FreeBSD') {
+ $lines = explode("\n",`sysctl -a`);
+ $infos = array();
+ foreach ($lines as $line) {
+ if(!$line){
+ continue;
+ }
+ $tmp = explode(":", $line);
+ $index = strtolower($tmp[0]);
+ $value = trim($tmp[1], " ");
+ $infos[$index] = $value;
+ }
+ $freeMemory = ($infos['vm.stats.vm.v_inactive_count']*$infos['hw.pagesize'])
+ +($infos['vm.stats.vm.v_cache_count']*$infos['hw.pagesize'])
+ +($infos['vm.stats.vm.v_free_count']*$infos['hw.pagesize']);
+ if ($freeMemory < 2100*1024*1024) {
+ die('skip Not enough memory.');
+ }
+}
+?>
+--INI--
+memory_limit=2100M
+--FILE--
+<?php
+$a1 = str_repeat("1", 1024 * 1024 * 1024 * 0.5);
+echo "1\n";
+$a2 = str_repeat("2", 1024 * 1024 * 1024 * 0.5);
+echo "2\n";
+$a3 = str_repeat("3", 1024 * 1024 * 1024 * 0.5);
+echo "3\n";
+$a4 = str_repeat("4", 1024 * 1024 * 1024 * 0.5);
+echo "4\n";
+$a5 = str_repeat("5", 1024 * 1024 * 1024 * 0.5);
+echo "5\n";
+?>
+--EXPECTF--
+1
+2
+3
+4
+
+Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d
diff --git a/Zend/tests/bug60099.phpt b/Zend/tests/bug60099.phpt
new file mode 100644
index 000000000..13e2f54b0
--- /dev/null
+++ b/Zend/tests/bug60099.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #60099 (__halt_compiler() works in braced namespaces)
+--FILE--
+<?php
+namespace foo {
+ __halt_compiler();
+
+?>
+--EXPECTF--
+Fatal error: __HALT_COMPILER() can only be used from the outermost scope in %s on line %d
diff --git a/Zend/tests/bug60138.phpt b/Zend/tests/bug60138.phpt
new file mode 100644
index 000000000..3bf1fba96
--- /dev/null
+++ b/Zend/tests/bug60138.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #60138 (GC crash with referenced array in RecursiveArrayIterator)
+--FILE--
+<?php
+$tree = array(array("f"));
+$category =& $tree[0];
+
+$iterator = new RecursiveIteratorIterator(
+ new RecursiveArrayIterator($tree),
+ RecursiveIteratorIterator::SELF_FIRST
+);
+foreach($iterator as $file);
+echo "ok\n";
+?>
+--EXPECT--
+ok
diff --git a/Zend/tests/bug60139.phpt b/Zend/tests/bug60139.phpt
new file mode 100644
index 000000000..e429fe2b0
--- /dev/null
+++ b/Zend/tests/bug60139.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #60139 (Anonymous functions create cycles not detected by the GC)
+--FILE--
+<?php
+class Foo {
+ public $x;
+
+ public function __construct() {
+ $this->x = function() {};
+ }
+}
+
+class Bar {
+ public $x;
+
+ public function __construct() {
+ $self = $this;
+ $this->x = function() use ($self) {};
+ }
+}
+
+gc_collect_cycles();
+new Foo;
+var_dump(gc_collect_cycles());
+new Bar;
+var_dump(gc_collect_cycles());
+?>
+--EXPECT--
+int(0)
+int(2)
diff --git a/Zend/tests/inter_007.phpt b/Zend/tests/inter_007.phpt
index ee62063da..13b18883b 100644
--- a/Zend/tests/inter_007.phpt
+++ b/Zend/tests/inter_007.phpt
@@ -17,4 +17,4 @@ interface a extends d, w { }
?>
--EXPECTF--
-Fatal error: Can't inherit abstract function c::B() (previously declared abstract in d) in %s on line %d
+Fatal error: Cannot make non static method c::B() static in class d in %s on line %d
diff --git a/Zend/tests/inter_04.phpt b/Zend/tests/inter_04.phpt
index 0703e3d9b..ea0bd8476 100644
--- a/Zend/tests/inter_04.phpt
+++ b/Zend/tests/inter_04.phpt
@@ -14,6 +14,8 @@ interface b {
interface c extends a, b {
}
+echo "done!\n";
+
?>
--EXPECTF--
-Fatal error: Can't inherit abstract function b::b() (previously declared abstract in a) in %s on line %d
+done!
diff --git a/Zend/tests/objects_018.phpt b/Zend/tests/objects_018.phpt
index 5a24f4d42..ca5b4b8cd 100644
--- a/Zend/tests/objects_018.phpt
+++ b/Zend/tests/objects_018.phpt
@@ -14,6 +14,8 @@ interface Itest2 {
interface Itest3 extends Itest, Itest2 {
}
+echo "done!\n";
+
?>
--EXPECTF--
-Fatal error: Can't inherit abstract function Itest2::a() (previously declared abstract in Itest) in %s on line %d
+done!