xp-forge / frontend

Web frontends
1 stars 1 forks source link

Route matching failure on HHVM #1

Closed thekid closed 6 years ago

thekid commented 6 years ago

See https://travis-ci.org/xp-forge/frontend/jobs/361281316:

Exception lang.IndexOutOfBoundsException (Undefined index: MARK)
  at <main>::__error(8, (0x15)'Undefined index: MARK'...) [line 50 of Frontend.class.php] 
  at web.frontend.Frontend::handle(web.Request{}, ...) [line 33 of HandlingTest.class.php] 
  at web.frontend.unittest.HandlingTest::handle(...) [line 46 of HandlingTest.class.php] 
  ...
thekid commented 6 years ago

This is because backtracking via (*MARK:NAME) is not supported by HHVM:

preg_match_all('/(*MARK:X)[a-z]+/', $argv[1], $matches, PREG_SET_ORDER);
var_dump($matches);
$ hhvm test.php "hello"
array(1) {
  [0]=>
  array(1) {
    [0]=>
    string(5) "hello"
  }
}
$ php test.php "hello"
array(1) {
  [0]=>
  array(2) {
    [0]=>
    string(5) "hello"
    ["MARK"]=>
    string(1) "X"
  }
}