Non-abstract method Foo::bar() must contain body

From Php

Jump to: navigation, search

You can get errors like

  Non-abstract method Foo::bar() must contain body in Foo.php on line 10

if you accidentally put a semicolon at the end of the first line of the function:

WRONG

  class Foo
  {
    function bar();   // extra semicolon!
    {
      // stuff
    }
  }

RIGHT

  class Foo
  {
    function bar()    // no semicolon, yay!
    {
      // stuff
    }
  }
Personal tools