- printf: documentation ( source)
<?php
class Test {
public $test1 = 1;
protected $test2 = 2;
private $test3 = 3;
public function __construct(){}
public function showVariables(){
printf("public : %d\nprotected: %d\nprivate: %d", $this->test1, $this->test2, $this->test3);
}
}
$tst = new Test;
$tst->showVariables();