xref: /PHP-7.0/tests/classes/autoload_006.phpt (revision 610c7fbe)
1--TEST--
2ZE2 Autoload from destructor
3--SKIPIF--
4<?php
5	if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
6	if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
7?>
8--FILE--
9<?php
10
11function __autoload($class_name)
12{
13	require_once(dirname(__FILE__) . '/' . strtolower($class_name) . '.p5c');
14	echo __FUNCTION__ . '(' . $class_name . ")\n";
15}
16
17var_dump(interface_exists('autoload_interface', false));
18var_dump(class_exists('autoload_implements', false));
19
20$o = new Autoload_Implements;
21var_dump($o);
22var_dump($o instanceof autoload_interface);
23unset($o);
24
25var_dump(interface_exists('autoload_interface', false));
26var_dump(class_exists('autoload_implements', false));
27
28?>
29===DONE===
30--EXPECTF--
31bool(false)
32bool(false)
33__autoload(autoload_interface)
34__autoload(Autoload_Implements)
35object(autoload_implements)#%d (0) {
36}
37bool(true)
38bool(true)
39bool(true)
40===DONE===
41