- var_dump: documentation ( source)
- strpos: documentation ( source)
- str_replace: documentation ( source)
- stripos: documentation ( source)
<?php
class stringable1 {
function __toString() {
return "abc";
}
}
$s = new stringable1();
// AS EXPECTED: converts the object into a string executes the replace in the same fashion with a plain php string
var_dump(str_replace('a', 'x', $s));
var_dump(strpos('abcd', $s));
var_dump(stripos('abcd', $s));