コード例 #1
0
ファイル: bug64023.php プロジェクト: badlamer/hhvm
<?php

class A extends \SplFileInfo
{
    public function __toString()
    {
        return ' -expected- ';
    }
}
$a = new A('/');
// Works
echo $a, $a->__toString(), $a->__toString() . '', "\n";
// Does not work - outputs parent::__toString()
echo $a . '', "\n";
コード例 #2
0
ファイル: ATest.php プロジェクト: ToddBudde/phrails
 /**
  * @test
  **/
 public function With_options()
 {
     $a = '<a href="/" class="foo" id="bar">home</a>';
     $o = new A('home', '/', 'class:foo,id:bar');
     $this->assertEquals($a, $o->__toString());
 }