<?php class Exemplo{ private $privado = 'Privado'; private function metodoPrivado() {} } $obj = new Exemplo(); $obj->privado = 'Teste';//Erro $obj->metodoPrivado();//Erro
Standard input is empty
Standard output is empty
PHP Fatal error: Uncaught Error: Cannot access private property Exemplo::$privado in /home/3NfL1n/prog.php:10 Stack trace: #0 {main} thrown in /home/3NfL1n/prog.php on line 10