xref: /PHP-5.5/Zend/tests/bug34260.phpt (revision 610c7fbe)
1--TEST--
2Bug #34260 (Segfault with callbacks (array_map) + overloading)
3--FILE--
4<?php
5class Faulty
6{
7    function __call($Method,$Args)
8    {
9        switch($Method)
10        {
11            case 'seg':
12              echo "I hate me\n";
13            break;
14        }
15    }
16
17    function NormalMethod($Args)
18    {
19       echo "I heart me\n";
20    }
21}
22
23$Faulty = new Faulty();
24$Array = array('Some junk','Some other junk');
25
26// This causes a seg fault.
27$Failure = array_map(array($Faulty,'seg'),$Array);
28
29// This does not.
30$Failure = array_map(array($Faulty,'NormalMethod'),$Array);
31?>
32--EXPECT--
33I hate me
34I hate me
35I heart me
36I heart me
37