Re: php 5 classes: public, protected and private




"Jerry Stuckle" <jstucklex@xxxxxxxxxxxxx> wrote in message
news:WfCdnZi7SJhguO3YnZ2dnUVZ_u6dnZ2d@xxxxxxxxxxxxxx
Michael Fesser wrote:
.oO(Tony Marston)


That just tells me what interfaces ARE, but it certainly does not say
that interfaces are REQUIRED. It is possible to define a class method and
access it directly WITHOUT going through an interface, therefore an
interface IS NOT NECESSARY.


Forget it. Obviously you haven't understood what interfaces in PHP are
used for and what you can do/ensure with them. Just an example: Without
these interfaces it wouldn't be possible to use 'foreach' to iterate
over any arbitrary object:

foreach ($directory as $file) {...}
foreach ($resultSet as $record) {...}

Micha

Micha,

Tony is just a troll who is beyond stupid. He can't even understand the
"experts" he quotes. They contradict what he says, but he can't see that.

They also contradict what you say, and you can't see that.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


.



Relevant Pages

  • Re: php 5 classes: public, protected and private
    ... these interfaces it wouldn't be possible to use 'foreach' to iterate ... over any arbitrary object: ... interfaces, so your argument is not valid. ... interfaces in PHP are necessary, and it is my opinion that they are NOT. ...
    (comp.lang.php)
  • Re: foreach on Collection, List, IList, ICollection, ...
    ... The reason being that these are all interfaces and thus can be ... to use foreach on a collection that collection has to implement the ... clear that you'll get the results in the natural order. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: php 5 classes: public, protected and private
    ... these interfaces it wouldn't be possible to use 'foreach' to iterate ... over any arbitrary object: ... interfaces, so your argument is not valid. ...
    (comp.lang.php)
  • check if object implements interface not working ;/
    ... I wrote this function that is suppose to returnt rue if an array of ... types(actually stuff returned by GetInterfaces) implements the interface Q. ... foreach ... was the same for interfaces but it doesn't work. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: foreach on Collection, List, IList, ICollection, ...
    ... The reason being that these are all interfaces and thus can be implemented any way the programmer wants and you may have some developer that for some odd reason likes to start at index 1. ... However in order for you to use foreach on a collection that collection has to implement the IEnumerator interface so I think you can be pretty sure that even if it doesn't start at index 0 you will still hit each element in the collection. ... If you are really that concerned about it starting at 0 then I would suggest using a for loop instead. ...
    (microsoft.public.dotnet.languages.csharp)