3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Kitchen { private $yummy = 'cake12'; protected $taste = 'cake21'; } $sweetsThief = function (Kitchen $kitchen) { var_dump( $kitchen->yummy ); var_dump( $kitchen->taste ); return $kitchen->taste; }; $kitchen = new Kitchen(); $sweetsThief = Closure::bind($sweetsThief, null, $kitchen); var_dump($sweetsThief($kitchen));

preferences:
41.41 ms | 402 KiB | 5 Q