Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10513

Re: Function Problem

From Twayne <nobody@spamcop.net>
Newsgroups comp.lang.php
Subject Re: Function Problem
Date 2013-08-15 18:17 -0400
Organization Aioe.org NNTP Server
Message-ID <kujk2c$3vf$1@speranza.aioe.org> (permalink)
References <kudttm$82o$1@speranza.aioe.org> <b70hr1Fak9fU1@mid.individual.net>

Show all headers | View raw


On 2013-08-14 1:10 AM, J.O. Aho wrote:
> On 13/08/13 20:29, Twayne wrote:
>> Hi All,
>
> As others already has pointed out, it's not the functions fault.

Wow, KUDOS for an informative post! I DO seem to recall coming across an 
8859/Unicode mixup; I didn't think anything of it at the time; I see now 
that might gave been a big mistake!
>
>
...

>
> Without seeing the whole code it's difficult to tell what's wrong, there
> is patebin.com which could be a good place to post the code and just
> post the link here.
>

Agreed. And:
It seems you have provided some excellent "for the future" fodder here, 
and I'll look into all of them. THANKS, because they are all sites I'm 
as yet not familiar with.

>
> Some advice which can help you in the future:
>
> 1. use the phplint feature, it will in this case give you the same
> error, but you don't have to use the browser.

That's really appealing!
>
> php -l script_name.php
>
> 2. Use a version control system like git, this will give you the good
> opportunity to see what changed in the code and it's easier to see what
> is wrong. See http://githowto.com
>
>  From own experience, I have worked at companies where they do not have
> version control at all, which makes it impossible to revert to a working
> version. I have worked at companies where they have a system where you
> rename files with a number in the end, which makes it difficult to know
> which combination of those changed files will be the correct one for the
> previous working version of the project. IMHO it's just stupid to not
> use tools which makes things a lot easier to keep track of and gives you
> a lot of other features which are useful while developing a site.

Exactly: my own "archive" purposes to date are my remembering to create 
the backups.
It ight be stupid to not use such tools, but first we have to figure out 
what exists and what's not just crap or so old it's no longer useful. 
Maybe I can tame your version of "stupid"; we'll see.

>
> 3. Separate HTML and PHP code as much as possible, have your functions
> in include scripts, you have then include in the top of the "HTML" page,
> this makes it easier to get the right highlight for the PHP and HTML (in
> mixed PHP/HTML files the highlighting may not be correct) and having
> include scripts, then you don't duplicate functions.

I haven't done much including but was just considering that specific 
possibility. Thanks for confirming, even if it's a no-brainer :).

>
> 4. Check for input that has been written in wrong charset, for example
> some ISO-8859 characters in an UTF-8 encoded page can make PHP to get
> acting strangely and you can't see them.

Interesting; as I said earlier, I do recall such an event being 
discovered and I thought I'd taken care of it; maybe not.

>
>
>> Realizing PHP's often misleading line numbers, I went through each and
>> every use of the function call on the entire page.
>
> Line number tends to be after the error.

Yeah, I've pretty much learned that and only use given line numbers as 
ballpark indicators; it seems the error, warning, notice, whatever give 
more accurate information.

If you happened to notice I've also published a RESOLVED to the thread, 
indicating it seemed like more a hiden character somewhere; perhaps you 
came to a closer estimate.

I sincerely thank you for your post!

Twayne`

>
> Not the only language having it like that.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 14:29 -0400
  Re: Function Problem Paul Herber <paul@pherber.com> - 2013-08-13 21:57 +0100
    Re: Function Problem Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-13 17:26 -0400
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 19:29 -0400
      Re: Function Problem The Natural Philosopher <tnp@invalid.invalid> - 2013-08-14 10:24 +0100
  Re: Function Problem Norman Peelman <npeelman@cfl.rr.com> - 2013-08-13 19:25 -0400
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 19:39 -0400
  Re: Function Problem David Robley <me@home.invalid> - 2013-08-14 09:04 +0930
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 20:45 -0400
    PS Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 20:51 -0400
  Re: Function Problem Richard Yates <richard@yatesguitar.com> - 2013-08-13 16:48 -0700
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-13 21:00 -0400
  Re: Function Problem "J.O. Aho" <user@example.net> - 2013-08-14 07:10 +0200
    Re: Function Problem Twayne <nobody@spamcop.net> - 2013-08-15 18:17 -0400
  Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-15 17:28 -0400
    Re: Function Problem RESOLVED Tim Streater <timstreater@greenbee.net> - 2013-08-15 23:15 +0100
      Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-15 18:59 -0400
        Re: Function Problem RESOLVED Tim Streater <timstreater@greenbee.net> - 2013-08-16 08:50 +0100
          Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-17 13:41 -0400
    Re: Function Problem RESOLVED Norman Peelman <npeelman@cfl.rr.com> - 2013-08-16 06:43 -0400
      Re: Function Problem RESOLVED Twayne <nobody@spamcop.net> - 2013-08-17 13:44 -0400

csiph-web