![]() |
|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
![]() |
|
Thread Tools | Display Modes |
|
||||
![]()
Note: This discussion was originally in "Funny stuff" and moved to a new thread.
I don't think I've ever seen a simple string been put that awkwardly as that. I find it hard to believe it's possible. Worst thing is, PHP errors suck. Code:
$isengard->Template($vars;) PHP will just exit. No error whatever-so-ever. including from the commandline (Just exits with status 255). I refactored 300 lines of code. Spot the error ... fun fun fun ![]()
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
![]()
For the most part, PHP is very configurable about warnings and errors, or at least the FastCGI and mod_php setups respect that part of php.ini. You should be able to set it to something that will help you out.
The real problem is that between production-style settings and "I don't fucking care" developers, that in actual practice PHP is more like do anything you can to avoid dieing, even if that means doing something stupid. I have also known people to test on "Live" sites and turn off warnings on development machines. The responses from users are sometimes comical. PHP is why I like the strongest possible type checking at compile and runtime, and why PHP would be my last choice of dynamic language for anything but a cheap web host or needing a PHP-based third party web app.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
![]()
Assuming you're lucky enough to be using PHP 5, you might want to append E_STRICT, which isn't included with E_ALL. YMMV with it however, and expressly with the nature of the codebase you're using. Note that PHP's E_STRICT is not quite the same as Perls use strict.
Good PHP code should be E_ALL and E_STRICT compliant, documented, and well covered by unit tests and the like. Don't underestimate the utility of good unit tests. I assume you know all the stuff about controlling where it sends errors; so you ought to be able to judge what's most convenient for you. Quote:
I might also add that the PHP chatter isn't quite on topic, hardy har haarr ![]()
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
![]()
Doesn't E_ALL include E_STRICT? I always thought E_ALL was *all* messages ...
In any case, I tried `E_ALL | E_STRICT' and I got the same effect. From what I remember from PHP4, I never had this sort of problems ... I haven't done a lot of PHP programming for some time until I got landed in this job, in that time either something changed with PHP or something changed with my typing accuracy ![]() And yeah, I used error_handler() and set a custom error handler to just quit on *any* error.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
![]() Quote:
![]() That does say something about the nature of PHP though, doesn't it?
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
![]() Quote:
XDebug seems interesting (Haven't tried it yet): http://www.xdebug.org/index.php
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
![]()
Ok, so I had some time to test stuff.
One typo consistently reproduces this error: Code:
<?php error_reporting(E_ALL | E_STRICT); date(;) ?> I compared the php.ini configuration files with the one used at the Fedora core machine I have at work, and they are almost exactly the same ... :-/ I'll do some testing with enabling/disabling extensions later (After-hours, since this is a production machine) ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
![]()
The default error_reporting was set to:
Code:
error_reporting = E_ALL & E_NOTICE & E_DEPRECATED Code:
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED I also don't quite understand why the error_reporting() function doesn't work ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
![]()
I would've just wrote it as
Code:
E_ALL ^ E_NOTICE ^ E_DEPRECATED Why do you want notice and deprecated off? (E_ALL = 111011111111111; E_ALL & ~E_NOTICE & ~E_DEPRECATED = 101011111110111)
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
output to a file in java | c0mrade | Programming | 4 | 15th October 2009 07:55 AM |
dwm status bar won't display apm output | asemisldkfj | General software and network | 6 | 16th August 2009 11:07 PM |
strange dmesg output | gosha | OpenBSD General | 4 | 11th March 2009 01:10 PM |
Digital sound output | Zodox | FreeBSD General | 5 | 12th November 2008 02:21 PM |
daemonforums's font displays horribly in firefox | s2scott | Feedback and Suggestions | 15 | 8th May 2008 01:18 AM |