×
          
              
          
      
      Clear all filters including search bar
          
        Valeri Tandilashvili's Personal Professional Blog
      
    gmailIFSELECT * 
FROM `students` 
WHERE IF(LENGTH(mail), mail, mail2) LIKE '%gmail.com%'
ORDER BY pointsORSELECT *
FROM  `students` 
WHERE 
    (`mail` LIKE '%gmail.com%' AND LENGTH(mail))
    OR 
    (mail2 LIKE '%gmail.com%') 
ORDER BY pointsCASESELECT * 
FROM `students` 
WHERE 
    (CASE
        WHEN LENGTH(mail) THEN mail
        ELSE mail2
    END) LIKE '%gmail.com%'
ORDER BY pointsinstallcomposer.jsonvendorcomposer install  /  composer icomposer.lockcomposer.jsonmajor1minorpatch"dependencies": {
    "moment": "^1.6.2"
}patchmajorminor"dependencies": {
    "moment": "~1.6.2"
}1.6.2"dependencies": {
    "moment": "1.6.2"
}"dependencies": {
    "moment": "*"
}childNodesfunction setText() {
    let a = document.getElementById("demo");
     let arr = a.childNodes;
     for(let x=0;x<arr.length;x++) {
       arr[x].innerHTML = "new text";
     }
}
//calling the function with setTimeout to make sure the HTML is loaded
setTimeout(setText, 500);<div id ="demo">
  <p>some text</p>
  <p>some other text</p>
</div>new text//calling the function in window.onload to make sure the HTML is loaded
window.onload = function() {
    //creating a new paragraph
    var p = document.createElement("p");
    p.innerHTML = 'Some new text 1';
       
    //adding the paragraph to the div
    var div = document.getElementById("demo"); 
    div.appendChild(p);
};<div id="demo">some content</div>getElementsByTagNamelet arr = document.getElementsByTagName("p");
for (let x = 0; x < arr.length; x++) {
  arr[x].innerHTML = "Hi there";
}<p>Hi</p>
<p>Hey</p>
<p>Hello</p>
<div>Hello there</div>lengtharraydatetimecreateFromFormatDateTime$first_date = DateTime::createFromFormat('Y-m-d', "2020-12-23");
$second_date = DateTime::createFromFormat('Y-m-d', "2020-12-30");diff()DateTime$difference_between_the_days = $second_date->diff($first_date)->format("%a");
	
echo $difference_between_the_days;class Foo
{
    public static $staticVariable = 'foo';
    public static function getVariableStatic() {
        return self::$staticVariable;
    }
    public function getVariableNONStatic() {
        return self::$staticVariable;
    }
}$staticVariable$foo = new Foo();
print $foo->staticVariable;Notice:  Accessing static property Foo::$staticVariable as non static...$foo = new Foo();
print $foo->getVariableStatic();$foo = new Foo();
print $foo->getVariableNONStatic();A property declared as static cannot be accessed with an instantiated class object (though a static method can).class BLock { }
class Lock {
    private $isLocked;
    
    public function __construct() {
        
    }
    
    public function lock() {
        $this->isLocked = true;
    }
    
    public function unLock() {
        $this->isLocked = false;
    }
    
    public function isLocked() {
        return $this->isLocked;
    }
}
class Chest {
    private $lock;
    
    public function __construct(Lock $lock) {
        $this->lock = $lock;
    }
    
    public function close() {
        $this->lock->lock();
        echo 'Closed' . PHP_EOL;
    }
    
    public function open() {
        if ($this->lock->isLocked()) {
            $this->lock->unLock();
        }
        echo 'Opened' . PHP_EOL;
    }
    
    public function isClosed() {
        return $this->lock->isLocked();
    }
}
$chest = new Chest(new Lock);
// $chest = new Chest(new Block);
$chest->open();
$chest->close();ChestLockUncaught TypeError: Argument 1 passed to Chest::__construct() must be an instance of Lock, instance of BLock givenclasspropertymethodinheritancepolymorphismencapsulationabstraction