Created
December 16, 2009 08:04
-
-
Save tomohiro/257677 to your computer and use it in GitHub Desktop.
Ruby のようなメソッドを PHP でも再実装
This file contains hidden or 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 | |
/** | |
* ex. | |
* include 'ruby_like.php'; | |
*/ | |
function puts($args) | |
{ | |
print $args; | |
} | |
function p() | |
{ | |
foreach(func_get_args() as $argments) { | |
var_export($argments); | |
} | |
} | |
function pp() | |
{ | |
foreach(func_get_args() as $argments) { | |
var_dump($argments); | |
} | |
} | |
function h($string, $quote_style = null, $charset = null) | |
{ | |
return htmlspecialchars($string, $quote_style, $charset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment