Skip to content

Instantly share code, notes, and snippets.

@binki
Last active January 5, 2017 18:22
Show Gist options
  • Save binki/7c0082c821bcd6c3f0ea1242be941ded to your computer and use it in GitHub Desktop.
Save binki/7c0082c821bcd6c3f0ea1242be941ded to your computer and use it in GitHub Desktop.
I can’t get PHP to look like C++ xD
<?php
class NotStream {
public function write($s) {
echo $s;
return $this;
}
}
class std {
const eol = PHP_EOL;
public static function cout() {
return new NotStream();
}
}
std::cout()->write('Hello world')->write(std::eol);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment