SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Feb 2005
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Benefit of object interfaces?

    http://pl.php.net/manual/en/language...interfaces.php

    What is the benefit of writing code with object interfaces...?

    PHP Code:
       interface IUser
        
    {
        function 
    getName();
        }

        class 
    User implements IUser
        
    {
        public function 
    __construct$id ) { }

        public function 
    getName()
        {
        return 
    "Jack";
        }} 

  2. #2
    is_empty(2); foofoonet's Avatar
    Join Date
    Mar 2006
    Posts
    1,000
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This might help, or lead to further answers.old post
    Upgrading to Mysql 5? Auto-increment fields now strict
    use NULL
    Or zero or leave the field name out completely.

  3. #3
    SitePoint Addict
    Join Date
    Feb 2005
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    provides some insight, but still don't really see the purpose were this would help me code something better

  4. #4
    SitePoint Zealot DerelictMan's Avatar
    Join Date
    Oct 2005
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lajkonik86
    http://pl.php.net/manual/en/language...interfaces.php

    What is the benefit of writing code with object interfaces...?
    Please search the archives before creating a new thread. This has been one of the most commonly asked questions on this forum in the past few months. A thread that discusses this very issue is still listed on the first page:

    Advantages of Interfaces and Public Methods and Members

    A search for "interfaces" yields the following:

    When to type hint?
    interface vs abstract class
    Interface Usage Question
    Interface Confusion...

    There are many more...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •