Ticket #2976 (new defect)

Opened 4 years ago

Last modified 2 years ago

ereg* character class problem

Reported by: weyrick Assigned to: anonymous
Priority: normal Milestone: 3.0.0 release
Component: Standard Library Version: trunk
Severity: minor Keywords:
Cc:

Description (Last modified by weyrick)

A PHP 4.x bug noted in all the PHP 5 online manuals is lack of "[:space:]"
and I encounted that and verified it: Try this:

$matches="A$ B$ C$ D$ E $ F";
# this works with the interpreter, but not the compiler:
$matcharray=split('[[:space:]]*\$[[:space:]]*', trim($matches));
print_r($matcharray);
# and must be rewritten as this:
$matcharray=preg_split('/[\s]*\$[\s]*/', trim($matches));
print_r($matcharray);

Change History

04/15/07 11:29:10 changed by weyrick

  • version set to trunk.
  • type set to defect.
  • description changed.
  • milestone set to 3.0.0 release.