Re: Exposing Variables



Jim Carlock wrote:
::Jerry Stuckle:: posted...
: It's better not to use globals. Rather, pass the needed values in
: the function call. Much better programming practice.

Thanks Jerry and Hendri.

I ran into a problem using "global" where I copied a variable name
outside of a function and even though I didn't put anything in the
outside variable.

When creating a class in PHP 4, I'm not seeing any kind of
private variables. Is there a way to simulate private variables
in PHP 4 ?

I've been thinking about moving to PHP 5.x, but before I finalize
and commit to such... I'm exploring classes in PHP 4.


Sorry, there really isn't. PHP 5 has much better encapsulation.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: Exposing Variables
    ... It's better not to use globals. ... Much better programming practice. ... When creating a class in PHP 4, I'm not seeing any kind of ... Is there a way to simulate private variables ...
    (comp.lang.php)
  • PHP import_request_variables() arbitrary variable overwrite
    ... PHP import_request_variablesarbitrary variable overwrite ... GLOBALS programmers wrote applications using this input method, ... E_NOTICE level error if you specify no prefix, ...
    (Bugtraq)
  • [Full-disclosure] PHP import_request_variables() arbitrary variable overwrite
    ... PHP import_request_variablesarbitrary variable overwrite ... GLOBALS programmers wrote applications using this input method, ... E_NOTICE level error if you specify no prefix, ...
    (Full-Disclosure)
  • Re: static vs global variable
    ... global is kinda trouble as i need to delcare global every php file i ... to have then as globals, in order not to either pass pointers to the ... In short its just as easy to make a buggers muddle in OOP, it jus5 happens with different syntax. ... My pint being that anine using an interepreted language to construct a huge data crunching or screen handling edifice is probably going to be disappointed performance wise anyway, ...
    (comp.lang.php)
  • [UNIX] PHP Multiple Vulnerabilities (File Upload, parse_str() register_global bypassing, phpinfo XSS
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... array of PHP allowing attackers to inject different content to PHP global ... File-Upload $GLOBALS Overwrite: ... sending a multipart/form-data POST request containing a fileupload field ...
    (Securiteam)