Skip to content

Fixes due to some inconsistencies in HHVM vs PHP #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/bson/bug0325.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ var_dump($value);
===DONE===
<?php exit(0); ?>
--EXPECTF--
Warning: %s\toPHP(): Reading document did not exhaust input buffer in %s on line %d
Warning:%sReading document did not exhaust input buffer in %s on line %d%a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seldom use %a. What is HHVM printing that requires greedy matching of multiple lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A stack trace (as my commit message says).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix with PHPC-345.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derickr Can you paste the full error message here for future reference?
Also, is it all messages or just thig particular one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He said it was argument-passing errors as well, which he was ignoring. I believe HHVM is just throwing stacktraces on all error/warning messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct - well, almost all. It looks like:

Warning: Reading document did not exhaust input buffer in /home/derick/dev/php/derickr-mongo-php-driver-prototype/tests/utils/tools.php on line 379
    #0 MongoDB\BSON\toPHP(), called at [/home/derick/dev/php/derickr-mongo-php-driver-prototype/tests/utils/tools.php:379]
    #1 toPHP(), called at [/home/derick/dev/php/derickr-mongo-php-driver-prototype/tests/bson/bug0325.phpt:11]

NULL
===DONE===
12 changes: 5 additions & 7 deletions tests/bson/bug0334.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ class MyClass implements BSON\Persistable {
}
}

hex_dump(fromPHP(new MyClass));
$bson = fromPHP(new MyClass);
$php = toPHP($bson, array('root' => 'array'));

var_dump($php['__pclass']->getData());

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, we discussed ===DONE=== previously and it should stick around.

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
0 : 28 00 00 00 05 5f 5f 70 63 6c 61 73 73 00 07 00 [(....__pclass...]
10 : 00 00 80 4d 79 43 6c 61 73 73 02 66 6f 6f 00 04 [...MyClass.foo..]
20 : 00 00 00 62 61 72 00 00 [...bar..]
===DONE===
string(7) "MyClass"