Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.
Source: When to use self vs this -stackoverflow
| /* ******************************************************************************************* | |
| * THE UPDATED VERSION IS AVAILABLE AT | |
| * https://github.com/LeCoupa/awesome-cheatsheets | |
| * ******************************************************************************************* */ | |
| // 0. Synopsis. | |
| // http://nodejs.org/api/synopsis.html |
Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.
Source: When to use self vs this -stackoverflow
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <?php | |
| /** | |
| * @file | |
| * Extends DrupalWebTestCase to use Xdebug for drupalGet() and drupalPost(). | |
| */ | |
| class DrupalXdebugWebTestCase extends DrupalWebTestCase { | |
| /** | |
| * Override the parent drupalPost to allow xdebug options. |
| """ | |
| Hooking up Selenium to Behave. | |
| For details, see: | |
| http://pyuseful.wordpress.com/2012/11/08/running-cucumber-style-tests-in-django-using-behave/ | |
| """ | |
| import logging | |
| from selenium import webdriver |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| /** This may be one of the most useless files in the world, but it essentially encapsulates | |
| * the answers to as many interview questions as I can remember over the years. Written in PHP | |
| * because ... just because. | |
| **/ | |
| /** | |
| * Write me a program that can determine if something is a palindrome | |
| * ex. A man, a plan, a canal - Panama! should count |