<?php
$var = "test";
class Test {
function __construct() {
return $this->Output();
}
function Output() {
global $var;
return $var;
}
}
echo new Test();
Fatal error: Uncaught Error: Object of class Test could not be converted to string in /in/gGD0H:16
Stack trace:
#0 {main}
thrown in /in/gGD0H on line 16
Process exited with code 255.