[wp-trac] [WordPress Trac] #33926: Improve WordPress Compatibility with HHVM
WordPress Trac
noreply at wordpress.org
Tue Oct 13 16:17:50 UTC 2015
#33926: Improve WordPress Compatibility with HHVM
--------------------------+------------------------
Reporter: wjywbs | Owner: pento
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 4.4
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------
Comment (by wjywbs):
Sorry for the delay! Previously I used a self-compiled one, and now I
retested with stock HHVM 3.9.1 on Ubuntu. I got a minimal repro for the
`test_db_reconnect()`, but the bug is probably in either phpunit or HHVM.
{{{
<?php
class DBTest extends PHPUnit_Framework_TestCase {
public function testDBQuery() {
@mysqli_query(null, "SELECT CONNECTION_ID()");
}
}
}}}
Save the file above as DBTest.php and run it as:
{{{
$ php phpunit.phar DBTest
PHPUnit 4.8.9 by Sebastian Bergmann and contributors.
.
Time: 273 ms, Memory: 13.50Mb
OK (1 test, 0 assertions)
$ hhvm phpunit.phar DBTest
PHPUnit 4.8.9 by Sebastian Bergmann and contributors.
$
}}}
@ocean90 To see the error message, remove the "@" and run the test again:
{{{
hhvm ../phpunit.phar DBTest
PHPUnit 4.8.9 by Sebastian Bergmann and contributors.
E
Time: 1.41 seconds, Memory: 16.65Mb
There was 1 error:
1) DBTest::testDBQuery
Argument 1 passed to mysqli_query() must be an instance of mysqli, null
given
DBTest.php:4
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
}}}
I still need to test if a WordPress site would function properly in HHVM
if I put the following code in the theme, such as header.php (it should
work fine with 33926-db.patch):
{{{
global $wpdb;
$var = $wpdb->get_var( "SELECT ID FROM $wpdb->users LIMIT 1" );
var_dump($var);
unset( $wpdb->dbh );
$var = $wpdb->get_var( "SELECT ID FROM $wpdb->users LIMIT 1" );
var_dump($var);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33926#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list