More Related Content
Similar to WordPress on HHVM + Hack
Similar to WordPress on HHVM + Hack(20)
More from Takayuki Miyauchi
More from Takayuki Miyauchi(20)
WordPress on HHVM + Hack
- 15. <?hh
function my_func( int $a ): int {
return $a + 1;
}
my_func( 'hoge' ); // Fatal Error
my_func( '10' ); // Fatal Error
my_func( 10 ); // OK
- 19. <?php
/*
Plugin Name: Hack WP
*/
if ( is_hhvm() ) {
require_once( dirname( __FILE__ ) . '/lib/hhwp.hh' );
add_filter( 'the_content', 'hoge' );
}
function is_hhvm()
{
return preg_match( "/-hhvm$/", phpversion() );
}
- 24. <?hh
async function hello(): Awaitable<string> {
// do something
return "Hello World";
}
$a = hello();
$a->getWaitHandle()->join(); // Hello World