Error when calling methods between two services (triggered by init)
Your service’s init() function gets called immediately after it is loaded – and before Yii has had a chance to remember that craft()-&gt;myPlugin should return the service instance.

Take a look at these two lines from CModule::getComponent() (the method that the magic getter invokes when you call craft()-&gt;somePluginName):

$component-&gt;init();
return $this-&gt;_components[$id]=$component;


So when MyPlugin_OtherService::methodInOtherService() tries to refer back to craft()-&gt;myPlugin, craft()-&gt;myPlugin has not yet been assigned to the service instance, which results in the PHP fatal error you’re getting.

I can propose a change that would fix this:

$this-&gt;_components[$id] = $component;
$component-&gt;init();
return $component;


…but I’m not sure what the implications would be for that.

You might just need to question whether it’s so important for this code to be running from init() as opposed to another function that you’d have to invoke manually. Having it in init() could lead to other unexpected consequences as well.