29ff6382e2
We were depending on a side effect of the string conversion
23 linhas
345 B
PHP
23 linhas
345 B
PHP
<?php
|
|
|
|
class Foo {
|
|
public function __toString() { some(); }
|
|
}
|
|
|
|
function some() {
|
|
throw new Exception('bye');
|
|
}
|
|
|
|
function wat() {
|
|
$z = 'asd' . mt_rand();
|
|
$k = new Foo();
|
|
$l = array($z, $z);
|
|
$y = $k == $z;
|
|
$k = null;
|
|
return $y;
|
|
}
|
|
|
|
try { wat(); }
|
|
catch (Exception $ex) { echo "Caught: " . $ex->getMessage() . "\n"; }
|
|
echo "done\n";
|