<?php
class Foo {
function doStuff(){
echo 'Hi!';
}
}
$obj = new stdClass;
$obj->theFoo = new Foo();
$obj->theFoo->doStuff();
@$obj->notTheFoo->doStuff();
Hi!
Fatal error: Uncaught Error: Call to a member function doStuff() on null in /in/OLJmG:12
Stack trace:
#0 {main}
thrown in /in/OLJmG on line 12
Process exited with code 255.