1--TEST--
2PhpToken extensions that throw during construction
3--SKIPIF--
4<?php if (!extension_loaded("tokenizer")) print "skip tokenizer extension not enabled"; ?>
5--FILE--
6<?php
7
8class MyPhpToken1 extends PhpToken {
9    public $extra = UNKNOWN;
10}
11
12try {
13    var_dump(MyPhpToken1::tokenize("<?php foo"));
14} catch (Error $e) {
15    echo $e->getMessage(), "\n";
16}
17
18abstract class MyPhpToken2 extends PhpToken {
19}
20
21try {
22    var_dump(MyPhpToken2::tokenize("<?php foo"));
23} catch (Error $e) {
24    echo $e->getMessage(), "\n";
25}
26
27?>
28--EXPECT--
29Undefined constant "UNKNOWN"
30Cannot instantiate abstract class MyPhpToken2
31