- print_r: documentation ( source)
<?php
class My_Class {
const CLASS_CONSTANT = 'test value';
private $x = array(1,2,3);
private function my_function() {
$self = $this;
$lambda_function = function() use ($self) {
echo $self::CLASS_CONSTANT;
print_r($self::$x);
};
$lambda_function();
}
public function start() {
$this->my_function();
}
}
$obj = new My_Class;
$obj->start();