Skip to content

Instantly share code, notes, and snippets.

Dmitry Stogov dstogov

Block or report user

Report or block dstogov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sccp_bug_3.php
<?php
function foo($data) {
$conds = array();
foreach ( $data as $base => $sub ) {
if ( count( $sub ) ) {
$conds[] = $base;
}
}
if ( $conds ) {
return $conds;
View sccp_bug_2.php
<?php
function getDurationIntervals($intervals = array() ) {
$smallestInterval = null;
$segments = array();
foreach ( $intervals as $name => $length ) {
if ( $length > 0 || ( $name === $smallestInterval && empty( $segments ) ) ) {
$segments[$name] = $length;
}
}
return $segments;
View sccp_bug.php
<?php
function form_process_radios($element) {
$weight = 0;
foreach ($element['#options'] as $key => $choice) {
$weight += 0.001;
$element += array($key => array());
$element[$key] += array(
'#type' => 'radio',
'#weight' => $weight,
);
View accel_pcre_reset-02.diff
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 601e3af0cf..34e4ef0071 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -412,7 +412,7 @@ static zend_string *accel_find_interned_string(zend_string *str)
}
if (!ZCG(counted)) {
- if (accel_activate_add() == FAILURE) {
+ if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
View tsrm_cache.diff
diff --git a/acinclude.m4 b/acinclude.m4
index cea6db87ff..59c627c883 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -919,7 +919,7 @@ AC_DEFUN([PHP_NEW_EXTENSION],[
if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
dnl ---------------------------------------------- Static module
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
- PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
+ PHP_ADD_SOURCES($ext_dir,$2,$ac_extra -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,)
View stats_wrap_stream_wrapper.c
static int stats_wrap_stream_wrapper(zval *pDest)
{
php_stream_wrapper *stream_wrapper = (php_stream_wrapper*)Z_PTR_P(pDest);
if(stream_wrapper->wops->stream_opener == stats_stream_opener) {
return ZEND_HASH_APPLY_KEEP;
}
php_stream_wrapper *new_wrapper = (php_stream_wrapper*)malloc(sizeof(php_stream_wrapper));
stats_stream_wrapper_ops *monitor_wops = (stats_stream_wrapper_ops*)malloc(sizeof(stats_stream_wrapper_ops));
memcpy(new_wrapper, stream_wrapper, sizeof(php_stream_wrapper));
stats_stream_wrapper_ops_ctor(monitor_wops, new_wrapper);
View run-tests.diff
diff --git a/win32/build/Makefile b/win32/build/Makefile
index d0a2d4e1fb..ab41612ad7 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -193,7 +193,7 @@ run: set-tmp-env
$(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" $(ARGS)
!else
test: set-tmp-env
- $(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) -d open_basedir= -d output_buffering=0 -d memory_limit=-1 run-tests.php -p "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(TESTS)
+ $(DEBUGGER_CMD) $(DEBUGGER_ARGS) "$(BUILD_DIR)\php.exe" -n -d open_basedir= -d output_buffering=0 -d memory_limit=-1 run-tests.php -p "$(BUILD_DIR)\php.exe" -n -c $(PHP_TEST_INI_PATH) $(TESTS)
View get_iterator.diff
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index a80838666b..dfb04ab732 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -263,6 +263,9 @@ typedef struct _zend_oparray_context {
/* Whether all property types are resolved to CEs | | | */
#define ZEND_ACC_PROPERTY_TYPES_RESOLVED (1 << 16) /* X | | | */
/* | | | */
+/* Children must reuse parent get_iterator() | | | */
+#define ZEND_ACC_REUSE_GET_ITERATOR (1 << 17) /* X | | | */
View stack_page_size.diff
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index b6a759b470..7fbb023ed1 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -170,9 +170,9 @@ ZEND_API const zend_internal_function zend_pass_function = {
#define ZEND_VM_STACK_PAGE_SIZE (ZEND_VM_STACK_PAGE_SLOTS * sizeof(zval))
-#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size) \
+#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(size, page_size) \
View variance-backtrace,txt
==6814== Invalid read of size 4
==6814== at 0x7EE2AA3: zend_string_hash_val (zend_string.h:98)
==6814== by 0x7EE2AA3: accel_new_interned_string (ZendAccelerator.c:464)
==6814== by 0x7EEDB3F: zend_persist_zval_calc.part.0 (zend_persist_calc.c:129)
==6814== by 0x7EEE959: zend_persist_zval_calc (zend_persist_calc.c:186)
==6814== by 0x7EEE959: zend_persist_op_array_calc_ex (zend_persist_calc.c:185)
==6814== by 0x7EEEFA3: zend_accel_script_persist_calc (zend_persist_calc.c:479)
==6814== by 0x7EE7209: cache_script_in_shared_memory (ZendAccelerator.c:1472)
==6814== by 0x7EE7209: persistent_compile_file (ZendAccelerator.c:2080)
==6814== by 0x7EE7209: persistent_compile_file (ZendAccelerator.c:1872)
You can’t perform that action at this time.