<?php
$closure = (new ReflectionFunction('strlen'))->getClosure()->bindTo(new DateTime(), 'DateTime');
var_dump($closure('foo'), (new ReflectionFunction($closure))->getClosureThis());
Warning: Cannot bind closure to scope of internal class DateTime in /in/WtH0f on line 3
Fatal error: Uncaught Error: Value of type null is not callable in /in/WtH0f:4
Stack trace:
#0 {main}
thrown in /in/WtH0f on line 4
Process exited with code 255.
Warning: Cannot bind closure to scope of internal class DateTime in /in/WtH0f on line 3
Fatal error: Uncaught Error: Function name must be a string in /in/WtH0f:4
Stack trace:
#0 {main}
thrown in /in/WtH0f on line 4
Process exited with code 255.