Tag Archives: object

Object Oriented PHP for Beginners

php_elephant
I think the Idea with this elephant logo is that you’ll associate PHP with smiley “cartoony” things and approach it with optimism. While I’m certain you can learn PHP, I’m not so fond of such attempts to obfuscate the fact that PHP is a language that will require some dedication to get your head around. Or maybe they just like elephants?

Here’s an excellent tutorial that introduces the concept of Object Oriented Programming (OOP) in PHP. It is written lucidly but may be a little confusing if you don’t already have some basic familiarity with the PHP language.

Here’s another tutorial if you find that one a bit much.

Setting and Outputting a Class Property
<?php
 
class MyClass
{
  public $prop1 = "I'm a class property!";
}
 
$obj = new MyClass;
 
echo $obj->prop1; // Output the property
 
?>

OOP and The Internet of Things

This article by author  brings up an important subject that will no doubt become more relevant as the public becomes more familiar with “The Internet of Things“. Matt points out that the conceptualization inherent with Object Oriented Programming is what makes IoT possible.

“It can safely be said that the object has been the driving force in the programming industry for a very long time and will continue to be so for the foreseeable future. The evidence to support this statement is pretty compelling! Today, just about every major software development methodology is based on objects. As a result, virtually all programming languages, scripting languages and application designs are object-oriented or object-based.”

Read more here.