type declaration

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mihalka
Forum Newbie
Posts: 10
Joined: Thu Oct 13, 2005 2:19 pm

type declaration

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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)
Post Reply