This morning, I've been notified that a new Twig_Extensions release is available! Yay!
Before integrating it to twigfiddle, I wanted to see changes. This is mainly adding support to namespaces using class_alias
function, and then add PSR-4 correspoding classes that just include the legacy one.
But each new (namespaced) classes are implemented like this:
<?php
namespace Twig\Extensions;
require __DIR__.'/../lib/Twig/Extensions/Extension/Text.php';
if (\false) {
class TextExtension extends \Twig_Extensions_Extension_Text
{
}
}
What does this notation mean?
It means it's using the false defined in the global namespace..
After a bit of research it turns out the rest of this answer is nonesense... I could swear you were able to do this in PHP at one point in time.
I think this is get around the situation where
<?php
namespace whywouldyoudothis;
false = true;
?>
I have never ever seen anyone code for this but that's what springs to mind.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With