Question : self vs this in php
Answered by : sila-arasan
<?php
class X { private $non_static_member = 1; private static $static_member = 2; function __construct() { echo $this->non_static_member . ' ' . self::$static_member; }
}
new X();
?>
Source : https://stackoverflow.com/questions/151969/when-should-i-use-self-over-this | Last Update : Sat, 28 May 22