Class Object in print_r php 4x vs 5x
Posted: Fri Mar 31, 2006 3:09 pm
This is probably one of those changes that nobody has noticed or if they did just shrugged it off because as far as I can tell it doesn't really affect anything. Nonetheless it really stumped me when I was trying to debug a class.
Using the following code:
Check out the capitalization of the class name in PHP 4x vs 5x . I know this is small beans however (As far as I can tell it doesn't matter), it baffled me during the debug....
Using the following code:
Code: Select all
echo 'Current PHP version: ' . PHP_VERSION;
class Foo{
var $myFoo;
function Foo(){
}
function bar(){
}
}
$foo = new Foo();
echo '<pre>'; print_r($foo); echo '</pre>';Code: Select all
Current PHP version: 4.3.2
foo Object
(
[myFoo] =>
)Code: Select all
Current PHP version: 5.1.1
Foo Object
(
[myFoo] =>
)