- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
<?php
class std {
public static function cout() {
return new std();
}
public function endl() {
echo PHP_EOL;
}
public function __get($name) {
echo $name;
return $this;
}
}
std::cout()->{'Кукареку!'}->endl();
http://pecl.php.net/package/operator
К сожалению, его нет в Ideone.
Use Perl*, Luke:
https://wandbox.org/permlink/CWq65ohMlYE1ioYR
* Правда heredoc-syntax не позволяет пропустить скобочки после std::cout.
https://wandbox.org/permlink/j6nG2fmRwb3V3xgr
> GET-ORDER R> SWAP 1+ SET-ORDER DEFINITIONS
> CREATE (endl) 10 C
ЗОЖИМАЕМ> ВОРЕЦИИ 1+ ЛЕСНЫЕ КОБЕНАЦИИ
ПОЛУЧАЕМ (вдруг) 10 БАТ