File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug50383.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, 1 month 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 #50383 (Exceptions thrown in __call / __callStatic do not include file and line in trace)
    3: --FILE--
    4: <?php
    5: 
    6: class myClass {
    7: 	public static function __callStatic($method, $args) {
    8: 		throw new Exception("Missing static method '$method'\n");
    9: 	}
   10: 	public function __call($method, $args) {
   11: 		throw new Exception("Missing method '$method'\n");
   12: 	}
   13: }
   14: 
   15: function thrower() {
   16: 	myClass::ThrowException();
   17: }
   18: function thrower2() {
   19: 	$x = new myClass;
   20: 	$x->foo();
   21: }
   22: 
   23: try {
   24: 	thrower();
   25: } catch(Exception $e) {
   26: 	print $e->getMessage();
   27: 	print_r($e->getTrace());
   28: }
   29: 
   30: try {
   31: 	thrower2();
   32: } catch (Exception $e) {
   33: 	print $e->getMessage();
   34: 	print_r($e->getTrace());
   35: }
   36: 
   37: ?>
   38: --EXPECTF--
   39: Missing static method 'ThrowException'
   40: Array
   41: (
   42:     [0] => Array
   43:         (
   44:             [file] => %s
   45:             [line] => 13
   46:             [function] => __callStatic
   47:             [class] => myClass
   48:             [type] => ::
   49:             [args] => Array
   50:                 (
   51:                     [0] => ThrowException
   52:                     [1] => Array
   53:                         (
   54:                         )
   55: 
   56:                 )
   57: 
   58:         )
   59: 
   60:     [1] => Array
   61:         (
   62:             [file] => %s
   63:             [line] => 13
   64:             [function] => ThrowException
   65:             [class] => myClass
   66:             [type] => ::
   67:             [args] => Array
   68:                 (
   69:                 )
   70: 
   71:         )
   72: 
   73:     [2] => Array
   74:         (
   75:             [file] => %s
   76:             [line] => 21
   77:             [function] => thrower
   78:             [args] => Array
   79:                 (
   80:                 )
   81: 
   82:         )
   83: 
   84: )
   85: Missing method 'foo'
   86: Array
   87: (
   88:     [0] => Array
   89:         (
   90:             [file] => %s
   91:             [line] => 17
   92:             [function] => __call
   93:             [class] => myClass
   94:             [type] => ->
   95:             [args] => Array
   96:                 (
   97:                     [0] => foo
   98:                     [1] => Array
   99:                         (
  100:                         )
  101: 
  102:                 )
  103: 
  104:         )
  105: 
  106:     [1] => Array
  107:         (
  108:             [file] => %s
  109:             [line] => 17
  110:             [function] => foo
  111:             [class] => myClass
  112:             [type] => ->
  113:             [args] => Array
  114:                 (
  115:                 )
  116: 
  117:         )
  118: 
  119:     [2] => Array
  120:         (
  121:             [file] => %s
  122:             [line] => 28
  123:             [function] => thrower2
  124:             [args] => Array
  125:                 (
  126:                 )
  127: 
  128:         )
  129: 
  130: )

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>