Follow @endyourif rss Facebook LinkedIn

PHP: self vs $this - what's the difference?

Published on Jan 30, 2020

This is a very unique topic that I found very interesting. Inside a class with PHP you can access a property or method by using either: self::myVariable or $this->myVariable. Let's explore the unique difference, specifically with how it relates to polymorphism.

Knockout: `this` context with ko computed observables and subscribe

Published on May 29, 2017

In JavaScript, the `this` variable inside a function (like a computed observable or a Knockout subscribe) function can be an extremely useful variable to access related properties to your observable.  Learning the following behavior has opened many doors for me when leveraging the Knockout.js framework. This Knockout js tutorial will demonstrate through an example using a computed observable inside my ViewModel.