This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
CREATE DEFINER=`root`@`localhost` FUNCTION `proper_date`(`value` TEXT) | |
RETURNS TEXT | |
LANGUAGE SQL | |
DETERMINISTIC | |
CONTAINS SQL | |
SQL SECURITY DEFINER | |
COMMENT '' | |
BEGIN | |
# preprocessing ---------------------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.prop1 = 11; | |
window.prop2 = 22; | |
b = function() { | |
console.log("this: ", this); | |
console.log("this.prop1: ", this.prop1); | |
console.log("this.prop2: ", this.prop2); | |
} | |
console.log("\n=== b() without context -> window ==="); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
constructor() { | |
console.log("A constructor is called"); | |
} | |
// --------------------------------------------- | |
#prop1; | |
set prop1(val) { | |
this.#prop1 = val; | |
} | |
get prop1() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*PHP* | |
================ | |
class a { | |
function f1() {echo "f1 from 'a'";} | |
} | |
class b extend a { | |
function b1() {echo "b1 from 'b'";} | |
function b2() {echo "b1 from 'b'";} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The ordinary and simplest way to write enum in PHP is: | |
class MyEnum { | |
const val1 = "val1"; | |
const val2 = "val2"; | |
const val3 = "val3"; | |
} | |
and the way to use enum is: |