×
          
              
          
      
      Clear all filters including search bar
          
        Valeri Tandilashvili's Personal Professional Blog
      
    .class1 .class2 h2{
    color: red;
}<h2>.class2.class1pp {
    text-decoration: underline;
    text-transform: uppercase;
}class A {
    final public static function who() {
        echo __CLASS__;
    }
}
class B extends A {
    public static function who() {
        echo __CLASS__;
    }
}
B::who();Cannot override final method A::who()div.sticky {
  background-color: yellow;
  position: sticky;
  top: 0;
}position:fixedpdivdiv p { 
    color: red; 
}p#id1#id1 p { 
    color: green; 
}p.class1.class1 p { 
    color: yellow; 
}replaceChildwindow.onload = function() {
    let p = document.createElement("p");
    p.innerHTML = "This is new";
    // Replaces the first p with the new one
    let parent = document.getElementById("demo");
    parent.replaceChild(p, document.getElementById("p1"));
};<div id="demo">
	<p id="p1">This is a paragraph.</p>
	<p id="p2">This is another paragraph.</p>
</div>p1removeChildwindow.onload = function() {
    var parent = document.getElementById("demo");
    parent.removeChild(document.getElementById("p1"));
};<div id="demo">
    <p id="p1">This is a paragraph.</p>
    <p id="p2">This is another paragraph.</p>
</div>insertBeforenode1node2function myFunction() {
  // Creates new list item
  let newItem = document.createElement("li");
  newItem.innerHTML = "Water";
  
  // Puts list item into myList before "tea" item
  let list = document.getElementById("myList");
  list.insertBefore(newItem, document.getElementById("tea"));
}<ul id="myList">
  <li>Coffee</li>
  <li id="tea">Tea</li>
  <li>Cocacola</li>
</ul>
<p>Click the button to insert an item to the list.</p>
<button onclick="myFunction()">Try it</button>quotation marksUPPER-CASESELECT 
    UPPER(first_name), 
    UPPER('Converts a string or column value to UPPER-CASE') 
FROM studentslower-caseSELECT 
    LOWER(first_name), 
    LOWER('Converts a string or column value to lower-case') 
FROM studentsSELECT 
    CONCAT(first_name, ' ', 'joins', ' ', 'strings', ' ', 'and', ' ', 'columns') 
FROM studentsLENGTHSELECT 
    id, 
    first_name,
    LENGTH(first_name) first_name_length 
FROM studentsthree bytesCONCATWSSELECT 
    CONCAT_WS(' - ', first_name, 'joins', 'strings', 'and', 'columns', 'with', 'separator') 
FROM studentsTRIMSELECT 
    LENGTH(' text ') length,
    LENGTH(TRIM(' text ')) length_with_trimRTRIMSELECT 
    LENGTH(' text ') length,
    LENGTH(RTRIM(' text ')) length_with_right_trimLTRIMSELECT 
    LENGTH(' text ') length,
    LENGTH(LTRIM(' text ')) length_with_left_trimLEFTSELECT 
    LEFT(first_name, 5) AS 'five leftmost characters'
FROM studentsRPAD-SELECT 
    RPAD(first_name, 10, '-') AS 'student name'
FROM studentsAnimalprey()abstract class Animal {
    // child classes must implement this
    abstract function prey();
    public function run() {
        echo "I am running!\n";
    }
}
class Dog extends Animal {
    public function prey() {
        echo "I killed the cat !\n";
    }
}
class Cat extends Animal {
    public function prey() {
        echo "I killed the rat !\n";
    }
}
$dog = new Dog();
$cat = new Cat();
$dog->prey(); // I killed the cat !
$cat->prey(); // I killed the rat !
$dog->run(); // I am running!
$cat->run(); // I am running!