- var_dump: documentation ( source)
<?php
class toStr {
private $str;
public function __construct( $str ) {
$this->str = $str;
}
public function __toString() {
return $this->str;
}
}
$a = new toStr( 'hi' );
var_dump( $a === 'hi' );
var_dump( $a == 'hi' );
var_dump( 'hi' === $a );
var_dump( 'hi' == $a );