CopyPastor

Detecting plagiarism made easy.

Score: 0.7612916827201843; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2017-04-21
by Nishad Up

Original Post

Original - Posted on 2011-12-06
by Mohit Bumb



            
Present in both answers; Present only in the new answer; Present only in the old answer;

In the later PHP version `self::staticMethod();` also will not work. It will throw the strict standard error.
In this case, we can create object of same class and call by object
here is the example
class Foo { public function fun1() { echo 'non-static'; } public static function fun2() { echo (new self)->fun1(); } }

> Here is an example of correct usage of $this and self for non-static > and static member variables:
<?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(); ?>

        
Present in both answers; Present only in the new answer; Present only in the old answer;