Comments on: MOPS Submission 06: Variable Initialization in PHP http://php-security.org/2010/05/17/mops-submission-06-variable-initialization-in-php/ "improving the security of the PHP ecosystem" Tue, 01 Jun 2010 13:59:11 +0000 http://wordpress.org/?v=2.9.2 hourly 1 By: Oliver http://php-security.org/2010/05/17/mops-submission-06-variable-initialization-in-php/comment-page-1/#comment-10 Oliver Tue, 18 May 2010 02:45:24 +0000 http://php-security.org/?p=273#comment-10 I'd love to see PHP changing the scope of variables, e.g. a variable declared inside a statement (or any block really) should be out of scope outside of that block.<br>This way you wouldn't need any notices, the code just wouldn't work, but would be very easy to fix. I'd love to see PHP changing the scope of variables, e.g. a variable declared inside a statement (or any block really) should be out of scope outside of that block.
This way you wouldn't need any notices, the code just wouldn't work, but would be very easy to fix.

]]>
By: cdamian http://php-security.org/2010/05/17/mops-submission-06-variable-initialization-in-php/comment-page-1/#comment-11 cdamian Mon, 17 May 2010 20:31:50 +0000 http://php-security.org/?p=273#comment-11 In the first examples I would avoid the whole problem by directly assigning to the variable:<br><br>$auth = authUser($_POST["login"], $_POST["password"]);<br><br>Missing assignments can also spotted quiet easy if you have enough tests with good code coverage. In the first examples I would avoid the whole problem by directly assigning to the variable:

$auth = authUser($_POST["login"], $_POST["password"]);

Missing assignments can also spotted quiet easy if you have enough tests with good code coverage.

]]>
By: wellingtonrodrigues http://php-security.org/2010/05/17/mops-submission-06-variable-initialization-in-php/comment-page-1/#comment-12 wellingtonrodrigues Mon, 17 May 2010 19:56:00 +0000 http://php-security.org/?p=273#comment-12 Greetings,<br><br>Very cool your article but for matters of authentication would be much safer to carry the validity of the authentication session.<br><br>Best regards,<br><br>Wellington Rodrigues<br>PHP Programmer Brazil Greetings,

Very cool your article but for matters of authentication would be much safer to carry the validity of the authentication session.

Best regards,

Wellington Rodrigues
PHP Programmer Brazil

]]>