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 | 0c812483363f57bc812f979d70d6b6773da6135f (patch) | |
| tree | 177e7fc52a20f9e539e7e05feee6d831a12db812 /tests/examplefiles/test.php | |
| parent | 74be24a8aa7ee62359b6cb92c8a78b663dc3bb5a (diff) | |
| parent | 3660f9bb446d53c55416c87b157a694763276f93 (diff) | |
| download | pygments-0c812483363f57bc812f979d70d6b6773da6135f.tar.gz | |
merge
Diffstat (limited to 'tests/examplefiles/test.php')
| -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... |
