diff options
| author | Georg Brandl <georg@python.org> | 2016-02-03 23:42:54 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2016-02-03 23:42:54 +0100 |
| commit | e79c9a4b8b79ae8e4271b3a3779aa4286d85ee9c (patch) | |
| tree | 18a5fdc691a8a1e83ded7dd7c642d5f76c79ba9a /tests | |
| parent | e6e2c7895b7281ccab8bc694673b166881a7f19d (diff) | |
| parent | 973e0f4bfeb95168cb226cd778bd00603fd2f950 (diff) | |
| download | pygments-git-e79c9a4b8b79ae8e4271b3a3779aa4286d85ee9c.tar.gz | |
merge
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/examplefiles/test.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/examplefiles/test.php b/tests/examplefiles/test.php index 2ce4023e..794961c1 100644 --- a/tests/examplefiles/test.php +++ b/tests/examplefiles/test.php @@ -505,6 +505,30 @@ function &byref() { return $x; } +// Test highlighting of magic methods and variables +class MagicClass { + public $magic_str; + public $ordinary_str; + + public function __construct($some_var) { + $this->magic_str = __FILE__; + $this->ordinary_str = $some_var; + } + + public function __toString() { + return $this->magic_str; + } + + public function nonMagic() { + return $this->ordinary_str; + } +} + +$magic = new MagicClass(__DIR__); +__toString(); +$magic->nonMagic(); +$magic->__toString(); + echo <<<EOF Test the heredocs... |
