Skip to content

Instantly share code, notes, and snippets.

@weltling
weltling / gist:5494284
Created May 1, 2013 08:13
php pthreads x64 test fails
TEST 5/31 [C:\php-sdk\php55\vc11\x64\php-5.5.0beta4-src\ext\pthreads\tests\conditions.phpt]
========DIFF========
001+
001- bool(true)
========DONE========
TEST 7/31 [C:\php-sdk\php55\vc11\x64\php-5.5.0beta4-src\ext\pthreads\tests\corrupted-resources.phpt]
========DIFF========
001+
001- Work Object
$ diff -ru riack.orig riack
Only in riack.orig: .git
diff -ru riack.orig/src/ints.h riack/src/ints.h
--- riack.orig/src/ints.h Sun Sep 15 01:20:33 2013
+++ riack/src/ints.h Sun Sep 15 01:22:25 2013
@@ -5,7 +5,7 @@
#include "riack-config.h"
#endif
-#if defined(HAVE_STDINT_H)
@weltling
weltling / gist:6606099
Created September 18, 2013 08:09
php sundown patch
$ diff -u sundown.orig/src/buffer.h sundown/src/buffer.h
--- sundown.orig/src/buffer.h Sun Sep 30 10:00:24 2012
+++ sundown/src/buffer.h Wed Sep 18 10:04:26 2013
@@ -20,7 +20,11 @@
#include <stddef.h>
#include <stdarg.h>
-#include <stdint.h>
+#ifdef PHP_WIN32
+# include "win32/php_stdint.h"
diff --git a/fann.c b/fann.c
index 9cb3171..531ad19 100644
--- a/fann.c
+++ b/fann.c
@@ -933,7 +933,9 @@ ZEND_GET_MODULE(fann)
/* macro for chencking fann_error structs */
#define PHP_FANN_ERROR_CHECK(__fann_struct) \
- if (fann_get_errno((struct fann_error *) __fann_struct) != 0) { \
+ if (NULL == __fann_struct) { \
--- ext/fileinfo/libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014
+++ readcdf_new.c Mon Apr 28 16:55:57 2014
@@ -97,6 +97,8 @@
const char *s;
int len;
+ memset(&ts, 0, sizeof(ts));
+
for (i = 0; i < count; i++) {
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
diff --git a/Zend/zend.c b/Zend/zend.c
index 334a8df..9bb6463 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1031,11 +1031,10 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
} \
} while (0)
-ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
+static void zend_error_va_list(int type, const char *format, va_list args) /* {{{ */
diff --git a/Zend/zend.c b/Zend/zend.c
index 334a8df..854e94c 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1031,11 +1031,10 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
} \
} while (0)
-ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
+static void zend_error_va_list(int type, const char *format, va_list args) /* {{{ */
@weltling
weltling / gist:6bda7fb7be9c07293826
Created September 23, 2014 11:50
native-tls apache crash
#0 0x00007ffff39f07fc in zend_set_memory_limit (memory_limit=134217728) at /home/anatol/dws/src/native-tls/Zend/zend_alloc.c:2280
#1 0x00007ffff3971d01 in OnChangeMemoryLimit (entry=0x7fffec046a00, new_value=0x7fffec046a90, mh_arg1=0x0, mh_arg2=0x0, mh_arg3=0x0, stage=1) at /home/anatol/dws/src/native-tls/main/main.c:185
#2 0x00007ffff3a49543 in zend_ini_refresh_cache (el=0x7fffec0430b0, arg=0x1) at /home/anatol/dws/src/native-tls/Zend/zend_ini.c:280
#3 0x00007ffff3a3c201 in zend_hash_apply_with_argument (ht=0x7fffec042840, apply_func=0x7ffff3a494e2 <zend_ini_refresh_cache>, argument=0x1) at /home/anatol/dws/src/native-tls/Zend/zend_hash.c:1063
#4 0x00007ffff3a4959a in zend_ini_refresh_caches (stage=1) at /home/anatol/dws/src/native-tls/Zend/zend_ini.c:288
#5 0x00007ffff3a256dd in zend_new_thread_end_handler (thread_id=140737001740032) at /home/anatol/dws/src/native-tls/Zend/zend.c:594
#6 0x00007ffff3970e93 in allocate_new_resource (thread_resources_ptr=0x70f1f8, thread_id=140737001740032) at /home/ana
@weltling
weltling / remove_tsrmls.php
Created December 18, 2014 08:29
Tool for basic removals of TSRMLS_* in PHP7
<?php
$path = !isset($argv[1]) ? "." : realpath($argv[1]);
if (!is_dir($path)) {
echo "need the source dir path\n";
exit(3);
}
$map = array(
" TSRMLS_CC)" => ")",
diff --git a/ext/standard/tests/general_functions/proc_open_pipes1.phpt b/ext/standard/tests/general_functions/proc_open_pipes1.phpt
index 011e093..7f0bb18 100644
--- a/ext/standard/tests/general_functions/proc_open_pipes1.phpt
+++ b/ext/standard/tests/general_functions/proc_open_pipes1.phpt
@@ -7,7 +7,11 @@ for ($i = 3; $i<= 30; $i++) {
$spec[$i] = array('pipe', 'w');
}
-proc_open('sleep 1', $spec, $pipes);
+$callee = dirname(__FILE__) . DIRECTORY_SEPARATOR . "proc_open_pipes_sleep.php";