xref: /PHP-7.1/ext/spl/tests/bug73423.phpt (revision 1efb9fd3)
1--TEST--
2Bug #73423 (Reproducible crash with GDB backtrace)
3--FILE--
4<?php
5
6class foo implements \RecursiveIterator
7  {
8    public $foo = [];
9
10    public Function current ()
11      {
12        return current ($this->foo);
13      }
14
15    public Function key ()
16      {
17        return key ($this->foo);
18      }
19
20    public Function next ()
21      {
22        next ($this->foo);
23      }
24
25    public Function rewind ()
26      {
27        reset ($this->foo);
28      }
29
30    public Function valid ()
31      {
32        return current ($this->foo) !== false;
33      }
34
35    public Function getChildren ()
36      {
37        return current ($this->foo);
38      }
39
40    public Function hasChildren ()
41      {
42        return (bool) count ($this->foo);
43      }
44  }
45
46
47class fooIterator extends \RecursiveFilterIterator
48  {
49    public Function __destruct ()
50      {
51		eval("class A extends NotExists {}");
52
53        /* CRASH */
54      }
55
56    public Function accept ()
57      {
58        return true;
59      }
60  }
61
62
63$foo = new foo ();
64
65$foo->foo[] = new foo ();
66
67foreach (new \RecursiveIteratorIterator (new fooIterator ($foo)) as $bar) ;
68
69?>
70--EXPECTF--
71Fatal error: Class 'NotExists' not found in %sbug73423.php(%d) : eval()'d code on line 1
72