|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
warn_plus_overloading
i have my php.ini with
log_errors = on error_log = phperror.log warn_plus_overloading = on running PHP4.2.2 on Apache 2.0.39 on Win2k with <?php echo 'ab' + 'cd'; ?> produces a 0 (zero) and no warnings in phperror.log (now that i'm writing this i thought of trying displaying the errors to the output -- will be back in a bit) how come? don't warnings get logged? do i have something misconfigured? any help appreciated |
|
#2
|
|||
|
|||
|
RE: warn_plus_overloading
no display of this warning to the screen
|
|
#3
|
|||
|
|||
|
RE: warn_plus_overloading
yes, it produces no warnings as it is a perfectly valid piece of code (it takes any letters as a 0). What its doing is the math: 0 + 0 = 0.
What i think you are trying to do is produce abcd on the output - to do this you need to use '.' not '+' as follows: |
|
#4
|
|||
|
|||
|
RE: warn_plus_overloading
i know it is valid; i thought PHP would say something to avoid nasty errors
http://www.php.net/manual/en/configuration.php#ini.warn-plus-overloading imagine this: <?php $class = 't'; $type = 3; echo $class . $type; // ok: 't3' // now imagine i forgot the dot // and concatenate with '+' echo $a + $b; // ok: 3 ??? // further imagine this: $q = 'select * from table where field='' . ($a + $b) . '''; // and we've got a nasty bug ?> |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > warn_plus_overloading |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|