Req #73536 [Opn->Nab]: var_dump ignore private permitions in class

From: Date: Wed, 16 Nov 2016 10:08:44 +0000
Subject: Req #73536 [Opn->Nab]: var_dump ignore private permitions in class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205401@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73536&edit=1 ID: 73536 Updated by: stas@php.net Reported by: peter dot mlich at volny dot cz Summary: var_dump ignore private permitions in class -Status: Open +Status: Not a bug Type: Feature/Change Request Package: Unknown/Other Function PHP Version: 5.6.28 Block user comment: N Private report: Y New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is how var_dump is supposed to work. It's a debug function. Previous Comments: ------------------------------------------------------------------------ [2016-11-16 08:49:08] peter dot mlich at volny dot cz Description: ------------ --- From manual page: http://www.php.net/function.var-dump --- var_dump ignore class permitions 'private'. Php 5.5.12. Cannot be upgraded, wamp server problem. But, its only for programing and testing. On server have top version, but not run test code there. Test script: --------------- class classDb { private $table; public $structure; function __construct($structure) { $this->table = array(1,2,3); } } $users_db = new classDb('classUser'); var_dump($users_db); // 2 var_dump($users_db->table); // 1 // 1 - Fatal error: Cannot access private property classDb::$table in C:\wamp\www\ // 2 - Show all + all in private $users_db->table :) easy for hackers ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73536&edit=1

« previous php.bugs (#205401) next »