This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (empty($_SESSION['threadName'])) { | |
$t = new AsyncThread("util/handler.php"); | |
// By setting a name, it becomes persistent and may be resumed later | |
$t->setName($_SESSION['threadName'] = uniqid()); | |
} else { | |
// Previously started AsyncThread instance with still-running script | |
$t = AsyncThread::Resume($_SESSION['threadName']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/CMake/FindFreetype.cmake b/CMake/FindFreetype.cmake | |
index 4603d01..3a3d4bf 100644 | |
--- a/CMake/FindFreetype.cmake | |
+++ b/CMake/FindFreetype.cmake | |
@@ -1,15 +1,10 @@ | |
-if (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) | |
- set (Freetype_FIND_QUIETLY TRUE) | |
-endif (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS) | |
+find_package(PkgConfig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?hh | |
function foo(array<string> $bar) { | |
echo implode(',', $bar); | |
} | |
foo(['a','b','c']); | |
// Outputs 'a,b,c' as expected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void hi(int a, float b) { | |
printf("a = %d\n", a); | |
printf("b = %f\n", b); | |
} | |
int main(void) { | |
void (*hello)(float,int) = (void(*)(float,int))hi; | |
hi(1,2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://us2.php.net/session_set_save_handler | |
"[For all callback functions] Return value is TRUE for success, FALSE for failure." | |
In ext/session/mod_user.c: | |
PS_FUNC(user) { | |
/* blah blah */ | |
zval *retval = ps_call_handler(PSF(func), argc, argc); | |
if (retval) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Jemallocfb < Formula | |
homepage 'http://www.canonware.com/jemalloc/download.html' | |
url 'http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2' | |
sha1 '40c0892b172e5dc14a6cea6fe4edda7dea4f3a68' | |
keg_only "We're just a patched version." | |
# __GLIBC__ is not defined, but we still want hooks! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/hphp/parser/hphp.y b/hphp/parser/hphp.y | |
--- a/hphp/parser/hphp.y | |
+++ b/hphp/parser/hphp.y | |
@@ -887,17 +887,8 @@ | |
| class_declaration_statement { $$ = $1;} | |
| trait_declaration_statement { $$ = $1;} | |
; | |
-statement: | |
+statement_no_if: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* {{{ proto DateTime date_create_immutable_from_format(string format, string time[, DateTimeZone object]) | |
Returns new DateTime object formatted according to the specified format | |
*/ | |
PHP_FUNCTION(date_create_immutable_from_format) | |
{ | |
zval *timezone_object = NULL; | |
char *time_str = NULL, *format_str = NULL; | |
size_t time_str_len = 0, format_str_len = 0; | |
zval datetime_object; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<<__Native>> function foo(int $bar, string $baz): bool; | |
bool HHVM_FUNCTION(foo, int bar, const String& baz) { | |
// Do stuff with bar and baz | |
return true; | |
} | |
ZEND_BEGIN_ARG_INFO(foo_arginfo, 0, ZEND_RETURN_VALUE, 2) | |
ZEND_ARG_INFO(0, bar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$names = ['Alice', 'Bob']; | |
// PHP Closures | |
$greetings = array_map( | |
function($x) { | |
return "Hello $x"; | |
}, $names); |
OlderNewer