File: 
 
[ELWIX - Embedded LightWeight unIX -] / 
embedaddon / 
php / 
Zend / 
tests / 
bug34260.phpt
 Revision 
1.1.1.1 (vendor branch): 
download - view: 
text, 
annotated - 
select for diffs - 
revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 8 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: Bug #34260 (Segfault with callbacks (array_map) + overloading)
    3: --FILE--
    4: <?php
    5: class 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--
   33: I hate me
   34: I hate me
   35: I heart me
   36: I heart me
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>