$this and php

Little mistake on naming variable make me confuse for almost an hour.


yes, $this is built-in variable that often use in OOP. By using $this, we refer to self referencing variable.

More in php.net manual

class A
if (isset(
$this)) {
'$this is defined (';
} else {
"\$this is not defined.\n";

class B

$a = new A();
$b = new B();

in PHP | 88 Words

PHP OO tutorials

Best way to learn scripting / program is easy. Just write the code and see the result.

With the progress of OOP approach in field recently for our team make its ‘hard’ to adapt such change in mindset :

Procedural vs Object Oriented Programming

With case codeiginter,  we must learn the basic of OOP in PHP. Starting by dumping php4 and use php5 for production release.

Thanks to a lot of tutorial about OO in internet world, some of them are :

  1. Tutorialized
  2. Codewalkers
  3. Massassi
  4. KillerPHP, very good. With video too.

I myself more familiar with book, as I can carry it whenever I want and read it in my bed. When I feel I like to practice I’ll dive to my laptop and try to code.

Some books ( I ordered some in Amazon ) are :

  1. PHP 5 Objects, Patterns, and Practice
  2. CodeIgniter for Rapid PHP Application Development

From amazon description :

CodeIgniter (CI) is a powerful open-source PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. CodeIgniter is an MVC framework, similar in some ways to the Rails framework for Ruby, and is designed to enable, not overwhelm.

Continue reading

in PHP | 774 Words