--- /dev/null
+--TEST--
+Bug #20240 order of destructor calls
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
+--FILE--
+<?php
+
+class test
+{
+ var $member;
+
+ function test() {
+ $this->member = 1;
+ register_shutdown_function(array($this, 'destructor'));
+ }
+
+ function destructor() {
+ print $this->member;
+ }
+
+ function add() {
+ $this->member += 1;
+ print $this->member."\n";
+ }
+}
+
+$t = new test();
+
+$t->add();
+$t->add();
+
+echo "Done\n";
+?>
+--EXPECT--
+2
+3
+Done
+3
--- /dev/null
+--TEST--
+Bug #20242 Method call in front of class definition)
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '>=')) die('skip ZendEngine 2 does not support this'); ?>
+--FILE--
+<?php
+
+// THIS IS A WON'T FIX FOR ZE2
+
+test::show_static();
+
+$t = new test;
+$t->show_method();
+
+class test {
+ static function show_static() {
+ echo "static\n";
+ }
+ function show_method() {
+ echo "method\n";
+ }
+}
+?>
+--EXPECT--
+static
+method
--- /dev/null
+--TEST--
+Bug #21478 Zend/zend_alloc.c :: shutdown_memory_manager produces segfault
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed');
+ if (!function_exists('stream_filter_register') die('skip stream_filter_register() not available');
+?>
+--FILE--
+<?php
+class debugfilter extends php_user_filter {
+ function filter($in, $out, &$consumed, $closing) {
+ while ($bucket = stream_bucket_make_writeable($in)) {
+ $bucket->data = strtoupper($bucket->data);
+ stream_bucket_append($out, $bucket);
+ $consumed += strlen($bucket->data);
+ }
+ return PSFS_PASS_ON;
+ }
+}
+
+stream_filter_register("myfilter","debugfilter");
+
+$fp = fopen(dirname(__FILE__)."test.txt","w");
+stream_filter_append($fp, "myfilter");
+stream_filter_append($fp, "myfilter");
+stream_filter_append($fp, "myfilter");
+fwrite($fp, "This is a test.\n");
+print "Done.\n";
+fclose($fp);
+// Uncommenting the following 'print' line causes the segfault to stop occuring
+// print "2\n";
+readfile(dirname(__FILE__)."test.txt");
+?>
+--EXPECT--
+Done.
+THIS IS A TEST.
--- /dev/null
+--TEST--
+Bug #21888 protected property and protected method of the same name
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed');
+?>
+--FILE--
+<?php
+class mom {
+
+ protected $prot = "protected property\n";
+
+ protected function prot() {
+ print "protected method\n";
+ }
+}
+
+class child extends mom {
+
+ public function callMom() {
+ $this->prot();
+ }
+
+ public function viewMom() {
+ print $this->prot;
+ }
+
+}
+
+$c = new child();
+$c->callMom();
+$c->viewMom();
+?>
+--EXPECT--
+protected method
+protected property
+--EXPECT--
+protected method
+protected property
--- /dev/null
+--TEST--
+A derived class can call a parent's protected method that calls a private method
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class Foo {
+ private function aPrivateMethod() {
+ echo "Foo::aPrivateMethod() called.\n";
+ }
+
+ protected function aProtectedMethod() {
+ echo "Foo::aProtectedMethod() called.\n";
+ $this->aPrivateMethod();
+ }
+}
+
+class Bar extends Foo {
+ public function aPublicMethod() {
+ echo "Bar::aPublicMethod() called.\n";
+ $this->aProtectedMethod();
+ }
+}
+
+$o = new Bar;
+$o->aPublicMethod();
+?>
+--EXPECT--
+Bar::aPublicMethod() called.
+Foo::aProtectedMethod() called.
+Foo::aPrivateMethod() called.