File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
tests /
classes /
autoload_018.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:06 2012 UTC (12 years, 5 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
1: --TEST--
2: Ensure __autoload() allows for recursive calls if the class name differs.
3: --FILE--
4: <?php
5: function __autoload($name)
6: {
7: echo "IN: " . __METHOD__ . "($name)\n";
8:
9: static $i = 0;
10: if ($i++ > 10) {
11: echo "-> Recursion detected - as expected.\n";
12: return;
13: }
14:
15: class_exists('UndefinedClass' . $i);
16:
17: echo "OUT: " . __METHOD__ . "($name)\n";
18: }
19:
20: var_dump(class_exists('UndefinedClass0'));
21: ?>
22: --EXPECTF--
23: IN: __autoload(UndefinedClass0)
24: IN: __autoload(UndefinedClass1)
25: IN: __autoload(UndefinedClass2)
26: IN: __autoload(UndefinedClass3)
27: IN: __autoload(UndefinedClass4)
28: IN: __autoload(UndefinedClass5)
29: IN: __autoload(UndefinedClass6)
30: IN: __autoload(UndefinedClass7)
31: IN: __autoload(UndefinedClass8)
32: IN: __autoload(UndefinedClass9)
33: IN: __autoload(UndefinedClass10)
34: IN: __autoload(UndefinedClass11)
35: -> Recursion detected - as expected.
36: OUT: __autoload(UndefinedClass10)
37: OUT: __autoload(UndefinedClass9)
38: OUT: __autoload(UndefinedClass8)
39: OUT: __autoload(UndefinedClass7)
40: OUT: __autoload(UndefinedClass6)
41: OUT: __autoload(UndefinedClass5)
42: OUT: __autoload(UndefinedClass4)
43: OUT: __autoload(UndefinedClass3)
44: OUT: __autoload(UndefinedClass2)
45: OUT: __autoload(UndefinedClass1)
46: OUT: __autoload(UndefinedClass0)
47: bool(false)
48:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>