Last active
March 18, 2016 04:46
-
-
Save shinderuman/2c494324e4fe9e41f6e3 to your computer and use it in GitHub Desktop.
こんなズンドコキヨシは嫌だ with PHP ref: http://qiita.com/shinderuman@github/items/15fe031ab9ff74ce8fb2
This file contains 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 ズンドコキ・ヨ・シ! | |
{ | |
public function __toString() | |
{ | |
$ズンズンズンズンドコ = null; | |
foreach ((function($ズンドコ) { | |
loop: yield $ズンドコ[mt_rand(0, 1)]; | |
goto loop; | |
})(str_split(__CLASS__, 6)) as $どっちか) { | |
echo $どっちか, PHP_EOL; | |
$ズンズンズンズンドコ .= $どっちか; | |
if (strstr($ズンズンズンズンドコ, key(get_defined_vars()))) { | |
return mb_substr(__CLASS__, -6) . PHP_EOL; | |
} | |
} | |
} | |
} | |
echo new ズンドコキ・ヨ・シ!(); |
This file contains 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 ズンドコキ・ヨ・シ! | |
{ | |
private $_0_2; | |
private $_2_2; | |
public function __get($name) | |
{ | |
list(, $offset, $limit) = explode('_', $name); | |
echo mb_substr(__CLASS__, $offset, $limit); | |
} | |
} | |
ob_start(); | |
$ズンズンズンズンドコ = new ズンドコキ・ヨ・シ!(); | |
start: | |
((function($zundoko) { | |
$zd = (new ReflectionClass(get_class($zundoko)))->getProperties()[mt_rand(0, 1)]->getName(); | |
$zundoko->$zd; | |
})($ズンズンズンズンドコ)); | |
if (strstr(ob_get_contents(), key(array_reverse(get_defined_vars())))) { | |
echo mb_substr(get_class($ズンズンズンズンドコ), -6), PHP_EOL; | |
ob_end_flush(); | |
exit(); | |
} | |
goto start; |
This file contains 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 ズンドコキヨシ | |
{ | |
private $_0_2; | |
private $_2_2; | |
public function __get($name) | |
{ | |
list(, $offset, $limit) = explode('_', $name); | |
echo mb_substr(__CLASS__, $offset, $limit); | |
} | |
} | |
ob_start(); | |
while (true) { | |
((function($ズンドコキヨシ) { | |
$どっちか = (new ReflectionClass(key(get_defined_vars())))->getProperties()[mt_rand(0, 1)]->getName(); | |
$ズンドコキヨシ->$どっちか; | |
})(new ズンドコキヨシ())); | |
if (strstr(ob_get_contents(), 'ズンズンズンズンドコ')) { | |
echo 'キ・ヨ・シ!', PHP_EOL; | |
break; | |
} | |
} | |
ob_end_flush(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment