1--TEST-- 2ZE2 Ensuring destructor visibility 3--SKIPIF-- 4<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> 5--FILE-- 6<?php 7 8class Base { 9 private function __destruct() { 10 echo __METHOD__ . "\n"; 11 } 12} 13 14class Derived extends Base { 15 public function __destruct() { 16 echo __METHOD__ . "\n"; 17 } 18} 19 20$obj = new Derived; 21 22unset($obj); // Derived::__destruct is being called not Base::__destruct 23 24?> 25===DONE=== 26--EXPECTF-- 27Derived::__destruct 28===DONE=== 29