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 early_binding.diff
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 6721612b4c..de0ac1fe13 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -278,6 +278,9 @@ typedef struct _zend_oparray_context {
/* Class has unresolved variance obligations. | | | */
#define ZEND_ACC_UNRESOLVED_VARIANCE (1 << 21) /* X | | | */
/* | | | */
+/* Method compatibility already checked. | | | */
+#define ZEND_ACC_CHECKED (1 << 22) /* X | | | */
View variance_bug.php
<?php
class X {
}
abstract class A {
abstract function __construct(X $x);
}
class B extends A {
function __construct(object $x) {}
}
class C extends B {
View another_posible_fix_for_bug78106.diff
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index b0aace8ff0..6b65eef2d7 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -1880,16 +1880,22 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
int key_length;
int from_shared_memory; /* if the script we've got is stored in SHM */
- if (!file_handle->filename || !ZCG(enabled) || !accel_startup_ok) {
+ if (!file_handle->filename || !ZCG(accelerator_enabled)) {
View posible_fix_for_bug78106.diff
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index b57d446df5..5a1c9c8e79 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -413,7 +413,7 @@ static zend_string *accel_find_interned_string(zend_string *str)
if (!ZCG(counted)) {
if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
- return str;
+ return NULL;
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);
You can’t perform that action at this time.