PHP 5.4-specific ISSET query regarding $_GET. $_POST Superglobals -
i have upgrade mission-critical (aren't all?) ubuntu server php 5.3 5.4, , happy 1 possible problem. our php scripts include around 1200 isset() references, of check status of either $_get or $_post variables, names comprise strings, not numerics.
i'm aware of (5.3 v 5.4) distinction 5.4 returns false when isset($var['somestringvalue']) used, , query whether unwanted behaviour apply our string-value $_post , $_get variables?
i knock quick 5.4 test server, use many extensions , adjustments that's easier said done. thought i'd try luck here first. in advance.
that not "unwanted behaviour", it's useful. behaviour changes if isset() called on string.
$string = 'my string'; // length = 9, character indexes 0 8 var_dump(isset($string[5])); // makes sense -> checks whether there's character on 5th position (true) var_dump(isset($string[10])); // makes sense -> checks whether there's character on 10th position (false) var_dump(isset($string['foo'])); // doesn't make sense -> checks whether there's character on "foo" position (false)
since $_get , $_post associative arrays, new behaviour not affect in case. more information, check manual @ http://php.net/manual/en/function.isset.php
ps: should consider development server, test things without creating problems users / customers!
Comments
Post a Comment