<?php
$f = function(){ echo $this->getX(); };
class Test
{
private $x;
public function __construct($x) { $this->x = $x; }
public function setX($x){ $this->x = $x; }
public function getX(){ return $this->x; }
}
$t1 = new Test(100);
$t2 = new Test(600);
$f->call($t1);
$closure = $f->bindTo($t2);
$closure();
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
100600