var_export() from PHP 4.2.0?
| From: | Yasuo Ohgaki | Date: | Sat, 24 Aug 2002 10:11:10 +0000 |
| Subject: | var_export() from PHP 4.2.0? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-87391@lists.php.net to get a copy of this message | ||
I'm very suprised there is var_export() from PHP 4.2.0 that works
just like var_dump()/print_r().
If we keep doing this, there will be full of duplicated functions
that do almost the same thing with a little different manner.
Is there good reason to have this?
Am I missing very useful var_export() only feature that
cannot be integrated into var_dump()/print_r()?
[yohgaki@dev yohgaki]$ php
<?php
$a = array (1, 2, array ("a", "b", "c"));
var_export ($a);
echo "\n";
var_dump($a);
echo "\n";
print_r($a);
?>
array (
0 => 1,
1 => 2,
2 =>
array (
0 => 'a',
1 => 'b',
2 => 'c',
),
)
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
array(3) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
}
}
Array
(
[0] => 1
[1] => 2
[2] => Array
(
[0] => a
[1] => b
[2] => c
)
)