From bf473c43f167865086b69446509840960d1cfa90 Mon Sep 17 00:00:00 2001 From: Miikka Salminen Date: Wed, 3 Feb 2016 21:28:17 +0200 Subject: Adds an entry to changelog. Adds magic method and variable lexing for PHP along with corresponding changes in a test file. --- tests/examplefiles/test.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') 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 <<