<?php
class Foo {
    public function getPrivateMethod() {
        return [$this, 'privateMethod'];
    }
    private function privateMethod() {
        echo __METHOD__, "\n";
    }
}
$foo = new Foo;
$privateMethod = $foo->getPrivateMethod();
$privateMethod();
// Ölümcül hata: private yöntem Foo::privateMethod() küresel etki alanında çağrılıyor.
// Bunun nedeni, çağrının Foo dışında yapılması ve
// görünürlüğün bu noktadan denetlenmesidir.
class Foo1 {
    public function getPrivateMethod() {
        // Çağrılabilirin oluşturulduğu etki alanı kullanılıyor.
        return $this->privateMethod(...); // Closure::fromCallable([$this, 'privateMethod']); ile eşdeğer
    }
    private function privateMethod() {
        echo __METHOD__, "\n";
    }
}
$foo1 = new Foo1;
$privateMethod = $foo1->getPrivateMethod();
$privateMethod();  // Foo1::privateMethod
?>