summaryrefslogtreecommitdiff
path: root/pear/tests/php_dump.php.inc
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2005-08-15 22:05:55 +0000
committerPierre Joye <pajoye@php.net>2005-08-15 22:05:55 +0000
commit4e9d393cacc4f79a29b70edb4cdb50c2aa1de24b (patch)
tree7a601be7b74edb09a06fbbf35954f13e376e1ee0 /pear/tests/php_dump.php.inc
parent6467e78253fb735efadc065e5c7f8708dee5c88b (diff)
downloadphp-git-4e9d393cacc4f79a29b70edb4cdb50c2aa1de24b.tar.gz
- cvs delete is not recursive...
Diffstat (limited to 'pear/tests/php_dump.php.inc')
-rw-r--r--pear/tests/php_dump.php.inc57
1 files changed, 0 insertions, 57 deletions
diff --git a/pear/tests/php_dump.php.inc b/pear/tests/php_dump.php.inc
deleted file mode 100644
index 4f7a666295..0000000000
--- a/pear/tests/php_dump.php.inc
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-class PHP_Dump {
- var $_var;
- function PHP_Dump($var)
- {
- $this->_var = $var;
- }
-
- function toPHP()
- {
- return $this->_toUnknown($this->_var);
- }
-
- function _toUnknown($var, $indent = ' ')
- {
- switch (gettype($var)) {
- case 'array' :
- return $this->_toArray($var, $indent);
- case 'boolean' :
- return $this->_toBool($var, $indent);
- case 'double' :
- case 'integer' :
- return $this->_toNumber($var, $indent);
- case 'NULL' :
- return "{$indent}null";
- case 'string' :
- return $this->_toString($var, $indent);
- }
- }
-
- function _toString($var, $indent)
- {
- return $indent . '"' . addslashes($var) . '"';
- }
-
- function _toBool($var, $indent)
- {
- return $indent . ($var ? 'true' : 'false');
- }
-
- function _toNumber($var, $indent)
- {
- return $indent . $var;
- }
-
- function _toArray($var, $indent = ' ')
- {
- $ret = $indent . "array(\n";
- foreach ($var as $key => $value) {
- $ret .= $indent . ((is_int($key) || is_double($key)) ? $key : "'$key'") . " =>\n";
- $ret .= $this->_toUnknown($value, "$indent ") . ",\n";
- }
- $ret .= $indent . ')';
- return $ret;
- }
-}
-?> \ No newline at end of file