summaryrefslogtreecommitdiff
path: root/Zend/tests/bug34260.phpt
blob: fa393d065c2a154c0024fa1918a2407958fd25ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--TEST--
Bug #34260 (Segfault with callbacks (array_map) + overloading)
--FILE--
<?php
class Faulty
{
    function __call($Method,$Args)
    {
        switch($Method)
        {
            case 'seg':
              echo "I hate me\n";
            break;
        }
    }

    function NormalMethod($Args)
    {
       echo "I heart me\n"; 
    }
}

$Faulty = new Faulty();
$Array = array('Some junk','Some other junk');

// This causes a seg fault.
$Failure = array_map(array($Faulty,'seg'),$Array);

// This does not.
$Failure = array_map(array($Faulty,'NormalMethod'),$Array);
?>
--EXPECT--
I hate me
I hate me
I heart me
I heart me