want to join us? register, it's easy | help

browse by tag: methods

sort by

newest, oldest, most popular


category icon

The Magic __set_state Method in PHP5

in PHP added by goodphptutorials, on 10/9/2006 __set_state advanced tutorials magic methods methods php5 set_state

It is fairly self-evident how to use most of the magic methods of PHP 5. However, it is not quite so apparent how to use the __set_state method introduced in PHP 5.1. In this article, Peter lavin delves into this elusive magic method to show you how to use this gem in some really 'classy' object oriented PHP.

comment save report
category icon

Stay away from Bloated Class Methods, actually, bloated ANYTHING!

in PHP added by rvdavid, on 22/3/2008 classes methods oop php5 principles tips

Why are there so many examples of bloated PHP methods out there?! I see a lot of bloated methods being used in examples through sites like phpclasses.org and a very large chunk of a project I’ve recently picked up which a few developers have worked on. Guys! remember! There is no good reason to bloat your methods to over 10-20 lines long and on the rare occasions that you do exceed 10 - 20 lines it would be more the exception to the rule as opposed to being the rule itself!

comment save report
category icon

Functions and Variable Scope

in PHP added by goodphptutorials, on 3/12/2005 beginner tutorials functions methods variable scope variables

A function is a declared piece of code that has code as members of it.

comment save report