Page Title: How to add PHP method chaining or create a fluent interface? - JavaScript Dev

  • This webpage makes use of the TITLE meta tag - this is good for search engine optimization.

Page Description:

  • This webpage DOES NOT make use of the DESCRIPTION meta tag - this is NOT GOOD for search engine optimization.

Page Keywords:

  • This webpage DOES NOT make use of the KEYWORDS meta tag - whilst search engines nowadays do not put too much emphasis on this meta tag including them in your website does no harm.

Page Text: How to add PHP method chaining or create a fluent interface? Spread the love Sometimes, we want to add PHP method chaining or create a fluent interface. In this article, we’ll look at how to add PHP method chaining or create a fluent interface. How to add PHP method chaining or create a fluent interface? To add PHP method chaining or create a fluent interface, we return $this in our object. For instance, we write str = ""; } function addA() { $this->str .= "a"; return $this; } function addB() { $this->str .= "b"; return $this; } function getStr() { return $this->str; } } $a = new FakeString(); echo $a->addA()->addB()->getStr(); to create the FakeString class. In it, we have the addA and addB return $this, which is the class instance, after concatenating a string to $this->str. As a result, we can chain addA and addB like $a->addA()->addB()->getStr() since addA returns the class instance, which we use to call addB. Conclusion To add PHP method chaining or create a fluent interface, we return $this in our object. Posted on

  • This webpage has 289 words which is between the recommended minimum of 250 words and the recommended maximum of 2500 words - GOOD WORK.

Header tags:

  • It appears that you are using header tags - this is a GOOD thing!

Spelling errors:

  • This webpage has 3 words which may be misspelt.

Possibly mis-spelt word: addA

Suggestion: add A
Suggestion: add
Suggestion: adds
Suggestion: Edda
Suggestion: ADD
Suggestion: Ada

Possibly mis-spelt word: PHP

Suggestion: PP
Suggestion: HP
Suggestion: PEP
Suggestion: PHI
Suggestion: PIP
Suggestion: PAP
Suggestion: POP
Suggestion: PUP
Suggestion: P HP
Suggestion: PHD
Suggestion: PH

Possibly mis-spelt word: getStr

Suggestion: gets tr
Suggestion: gets-tr
Suggestion: gesture

Broken links:

  • This webpage has 15 broken links.

Broken image links:

  • This webpage has no broken image links that we can detect - GOOD WORK.

CSS over tables for layout?:

  • It appears that this page uses DIVs for layout this is a GOOD thing!

Last modified date:

  • We were unable to detect what date this page was last modified

Images that are being re-sized:

  • This webpage has no images that are being re-sized by the browser - GOOD WORK.

Images that are being re-sized:

  • This webpage has no images that are missing their width and height - GOOD WORK.

Mobile friendly:

  • After testing this webpage it appears to be mobile friendly - this is a GOOD thing!

Links with no anchor text:

  • This webpage has no links that are missing anchor text - GOOD WORK.

W3C Validation:

Print friendly?:

  • It appears that the webpage does NOT use CSS stylesheets to provide print functionality - this is a BAD thing.

GZIP Compression enabled?:

  • It appears that the serrver does NOT have GZIP Compression enabled - this is a NOT a good thing!