namespace testnamespace;
class Test {
public function __construct() {
echo 'Hi';
}
}
new \Test; // Fatal error: Uncaught Error: Class 'Test' not found
class_alias('\testnamespace\Test', 'GlobalTest');
new \GlobalTest; // Hi
на ios еще глазами не видел как делаютда не вопрос
You can use the alias in GROUP BY, ORDER BY, or HAVING clauses.https://dev.mysql.com/doc/refman/8.0/en/problems-w...
Standard SQL disallows references to column aliases in a WHERE clause. This restriction is imposed because when the WHERE clause is evaluated, the column value may not yet have been determined.
$data = json_decode($data);
$data = array_column($data, 1);
$result = [];
for($i = 1, $size = count($data); $i < $size; ++$i) {
$result[$i] = $data[$i] - $data[$i - 1];
}
https://ideone.com/ZGf0iR > echo hash('sha256', 'bla-bla-bla');
> e29256c37ac614866b41c51eb8bf013d2f0b208988a21016e0abf6e81fc99c58
$html = <<<'HTML'
<article>
<p rel="#" src="#">aaaaaa</p>
<p href="#" bla="#" bla2="#">bbbbbb</p>
</article>
HTML;
$dom = new DOMDocument;
@$dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$xpath = new DomXPath($dom);
$elements = $xpath->query('//article/*');
$allowedAttributes = ['src', 'href'];
foreach($elements as $element) {
for( $i = $element->attributes->length; --$i >= 0; ) {
if( ! in_array( $element->attributes->item($i)->name, $allowedAttributes ) ) {
$element->removeAttribute($element->attributes->item($i)->name);
}
}
}
echo $dom->saveHTML();
https://3v4l.org/UPrsr