summaryrefslogtreecommitdiff
path: root/Zend/tests/bug35634.phpt
blob: 9681b6ad406b4b8bf5af910b03fe87c2f725bd88 (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 #35634 (Erroneous "Class declarations may not be nested" error raised)
--INI--
error_reporting=0
--FILE--
<?php
if (defined("pass3")) {

  class ErrorClass {
  }

} else if (defined("pass2")) {

  class TestClass {
    function __construct() {
    }
    function TestClass() {
      $this->__construct();
    }
  }

} else {

  function errorHandler($errorNumber, $errorMessage, $fileName, $lineNumber) {
    define("pass3", 1);
    include(__FILE__);
    die("Error: $errorMessage ($fileName:$lineNumber)\n");
  }

  set_error_handler('errorHandler');
  define("pass2", 1);
  include(__FILE__);
}
?>
--EXPECTF--
Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)