Page 1 of 1

type declaration

Posted: Fri Nov 04, 2005 5:58 pm
by mihalka
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


This is an extract from manual, see below. But the editors Eclipse PHP, PHPed dispay erros concerning type declarations. Why ?

Code: Select all

<?php
class ReflectionFunction implements Reflector
{
   final private __clone()
   public object __construct(string name)
   public string __toString()
   public static string export()
   public string getName()
   public bool isInternal()
   public bool isUserDefined()
   public string getFileName()
   public int getStartLine()
   public int getEndLine()
   public string getDocComment()
   public array getStaticVariables()
   public mixed invoke(mixed* args)
   public mixed invokeArgs(array args)
   public bool returnsReference()
   public ReflectionParameter[] getParameters()
   public int getNumberOfParameters()
   public int getNumberOfRequiredParameters()
}
?>

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Fri Nov 04, 2005 6:24 pm
by feyd
mixed is not a type. php is a typeless language. Only php 5 supports type-hinting, which is for arguements of a function only.

The code you found is the prototype information for one of the reflection classes... it is not code (in a php sense)