Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1 Running php v3.0.6 - no preg_match cmd

closed-wont-fix
nobody
None
5
2002-03-27
2001-06-19
Anonymous
No

I am trying to use PhpUnit under 3.0.6, but the preg_match command is not supported. I have tried
substituting ereg, but the first five tests only seem to run.

Output:

testFail1 FAIL
testFail2 FAIL
testPass1 ok
Fail3 FAIL
Fail4 FAIL

5 tests run
4 failures.

.... <Descripts skipped>

Then the assertRegexp which requires 'preg_match' seems to fail, and the rest of the tests are not
completed.

Any assistance would be appreciated.

While I have some basic - intermed Java experience, I am new to OO in php, so would appreciate
response.

Go xp!

Thanks and regards,
Richard Ferrers
Brisbane, Oz

Discussion

  • Adrian Quark
    Adrian Quark
    2001-07-22

    Logged In: YES
    user_id=92617

    preg_* require compiled-in support for pcre. I thought even
    php 3 did this by default (3.0.18 at least does).

    If you can't or don't want to recompile php to use pcre,
    you can use ereg but you'll have to tweak the patterns
    slightly. The biggest difference is preg_* patterns require
    delimiters (like "/") around the pattern. ereg_* patterns
    don't support any of perl's escapes (like "\b" or "\s"), so
    you'll have to use posix equivalents (like "[[:space:]]").
    For more information see the php manual.

     
  • Fred Yankowski
    Fred Yankowski
    2002-03-27

    Logged In: YES
    user_id=20580

    I'm inclined to continue using PCRE in phpUnit. Perhaps we
    just need to state the dependency in the installation
    guide. (Perhaps we should write such a guide first!)

     
  • Fred Yankowski
    Fred Yankowski
    2002-03-27

    Logged In: YES
    user_id=20580

    I'm inclined to continue using PCRE in phpUnit. Perhaps we
    just need to state the dependency in the installation
    guide. (Perhaps we should write such a guide first!)

     
  • Fred Yankowski
    Fred Yankowski
    2002-03-27

    • status: open --> open-wont-fix
     
  • Fred Yankowski
    Fred Yankowski
    2002-03-27

    • status: open-wont-fix --> closed-wont-fix