summaryrefslogtreecommitdiff
path: root/Zend/tests/bug35634.phpt
blob: 1437017a3b66e3afb68214d46e3499dc831507ad (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
37
38
--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__);
  print "ok\n";
}

?>
--EXPECT--
ok