Check alle échte Black Friday-deals Ook zo moe van nepaanbiedingen? Wij laten alleen échte deals zien

[bug] PHP highlighter en "array" als reserved word

Pagina: 1
Acties:
  • 29 views sinds 30-01-2008

  • T-MOB
  • Registratie: Maart 2001
  • Laatst online: 17:53
Mja, de GoT highlighter is beter dan de highlighter van mijn text-editor, dus waar zeur je dan over. Maar het loopt spaak wanneer je array als class property definieert:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class bar() P
   var $string = array('bla');
   var $array = array('mja');

   bar () {
    echo $this->string[0];

    //you'd expect "array" in blue
    echo $this->array[0];
   }
}


//normally it's ok:
$array = 'blue';

Regeren is vooruitschuiven


  • NMe
  • Registratie: Februari 2004
  • Laatst online: 20-11 11:59

NMe

Quia Ego Sic Dico.

:D

Ik had je post al gezien en heb moto-moi al gevraagd (via PM :P) of hij me de PHP lexerfile wilde sturen. Als hij (of een andere serveradmin) dat doet fix ik het wel even snel. :P

Edit: Dan kan ik meteen even wat nieuwe reserved words uit PHP5 toevoegen:
PHP:
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
abstract class MyClass extends MyOtherClass
{
   public $public = 'Public';
   protected $protected = 'Protected';
   private $private = 'Private';

   public static $my_static = 'static var';

   const CONST_VALUE = 'A constant value';

   final public function printHello()
   {
       echo $this->public;
       echo $this->protected;
       echo $this->private;
   }

   public static function doubleColon() {
       echo parent::CONST_VALUE . "\n";
       echo self::$my_static . "\n";
   }
}

interface iTemplate {..}
class Template implements iTemplate {..}

Blijkbaar zitten abstract, final, implements, interface, private, protected en public er nog niet in. :P

[ Voor 78% gewijzigd door NMe op 09-12-2005 01:58 ]

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • crisp
  • Registratie: Februari 2000
  • Nu online

crisp

Devver

Pixelated

allebei lokaal done :)

Intentionally left blank


Dit topic is gesloten.