This file contains hidden or 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
const vm = require('vm'); | |
(async () => { | |
const sandbox = { | |
a: 1 | |
}; | |
await new Promise(resolve => { | |
sandbox.resolve = resolve; | |
const code = 'Promise.resolve(2).then(result => {a = result; resolve();})'; | |
const script = new vm.Script(code); |
This file contains hidden or 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 | |
{ | |
private $ab = 5; | |
public $ac = 6; | |
} | |
/** | |
* WARNING: This https://bugs.php.net/bug.php?id=45937 seems not yet solved |
This file contains hidden or 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 | |
/** | |
* Validates a value using the LUHN Algorithm. | |
* @param string $value Value to validate. EG: Credit card number | |
* @return bool | |
*/ | |
function isLuhn($value) | |
{ | |
if (!is_string($value) || !ctype_digit($value)) { |