/usr/portage

Fool me 9

Without words.

$ php -r 'var_dump(strpos("foo 11 bar", 11));'
int(4)
$ php --version
PHP 5.2.4-dev with Suhosin-Patch 0.9.6.2 (cli) (built: Oct  1 2007 14:16:42) 
$ php -r 'var_dump(strpos("foo 11 bar", 11));'
bool(false)
$ php --version
PHP 5.2.5-pl1-gentoo with Suhosin-Patch 0.9.6.2 (cli) (built: Jan  9 2008 04:53:10) 

Filed under & nine comments & no trackbacks

Trackbacks

Trackback specific URI for this entry

No Trackbacks

Comments

  1. Lukas states:
    published on January 22nd 2008, 02:48:14 pm *

    Hi,

    As I said on IRC. It seems this behavior is unique to PHP 5.2.4 (at least 5.2.3 seems to behave just like 5.2.5), where it also did not match the documentation. I suggest you file a doc bug (ideally with patch) if there is no such bug report yet.

    Reply

  2. Lars Strojny responses:
    published on January 22nd 2008, 03:14:58 pm *

    Oh, didn’t noticed the answer. Is this considered a regression or was it a bug fix in 5.2.5? I would guess the latter.

    Reply

  3. Lukas returns:
    published on January 22nd 2008, 03:19:03 pm *

    It seems to be a fix in 5.2.5. There are a few points though:

    1) I did not find anything in the changelog from a quick skim
    2) Apparently there was not a test case to catch this regression before 5.2.4 was released
    3) There should be a note in the strpos() docs
    4) Potentially also in the upgrading guide

    Feel free to fix 2)-4) with patches :)

    Reply

  4. steve supposes:
    published on January 22nd 2008, 02:49:07 pm *

    muahaha

    PS: geht man auf deine seite kommt ein alert von wegen, dass dein google-api-key auf eine andere webseite registriert ist

    Reply

  5. Lars Strojny opines:
    published on January 22nd 2008, 03:35:53 pm *

    Was the case on usrportage.net. Fixed that.

    Reply

  6. sapphirecat returns:
    published on January 22nd 2008, 05:13:41 pm *
    $ php -r 'var_dump(strpos("foo 11 bar", 11));'
    bool(false)
    $ php --version
    PHP 5.1.6 (cli) (built: Oct 17 2007 11:08:45)
    

    Reply

  7. aurelian opines:
    published on January 23rd 2008, 07:48:08 pm *

    $ php -r ‘var_dump(strpos("foo 11 bar", 11));’
    bool(false)
    $ php —version
    PHP 5.3.0-dev (cli) (built: Jan 23 2008 20:43:09)

    Reply

  8. Lars Strojny responses:
    published on January 24th 2008, 12:28:45 am *

    Of course. The regression was in 5.2.4. A test to avoid this for the future is committed to php-src.

    Reply

  9. aurelian says:
    published on January 24th 2008, 08:18:27 am *

    Sure,
    You can also notice that my comment was added at 19:48 while I’m using a php version from the future (build timestamp is at 20:43).
    My php has special powers then :)

    Reply

Add a Comment & let me know what you think