Skip to content

Instantly share code, notes, and snippets.

Joe Watkins krakjoe

View GitHub Profile
@krakjoe
krakjoe / log.diff
Last active Jan 20, 2019
pcov vs xdebug comparison
View log.diff
--- pcov.log 2019-01-20 14:28:58.444851609 +0100
+++ xdebug.log 2019-01-20 14:25:27.607884120 +0100
@@ -1,8 +1,8 @@
-time php vendor/bin/phpunit --coverage-text --colors=never 2>&1 > pcov.log
+time php vendor/bin/phpunit --coverage-text --colors=never 2>&1 >xdebug.log
PHPUnit 7.5.2 by Sebastian Bergmann and contributors.
-Runtime: PHP 7.2.15-dev
+Runtime: PHP 7.2.15-dev with Xdebug 2.7.0beta2-dev
@krakjoe
krakjoe / document.php
Last active Nov 28, 2017
for generating stubs for a loaded extension
View document.php
<?php
/*
usage: php document.php --ext name [--output document.txt]
*/
function prototype(Reflector $reflector) {
$elements = [];
switch (get_class($reflector)) {
case "ReflectionClass":
if ($reflector->isFinal()) {
@krakjoe
krakjoe / opcache.diff
Created Apr 14, 2017
7.1.0 ... 7.1.4 ext/opcache
View opcache.diff
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 77b02cc99f..38c2ecb124 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend OPcache |
+----------------------------------------------------------------------+
- | Copyright (c) 1998-2016 The PHP Group |
+ | Copyright (c) 1998-2017 The PHP Group |
View mm.patch
diff --git a/src/gdhelpers.c b/src/gdhelpers.c
index 20fff5c..a64278b 100644
--- a/src/gdhelpers.c
+++ b/src/gdhelpers.c
@@ -14,6 +14,33 @@
#define SEP_TEST (separators[*((unsigned char *) s)])
+static inline void* gd_malloc_wrapper(size_t size)
+{
View variance-correct-probably.patch
diff --git a/Zend/tests/object_types/variance_in_param.phpt b/Zend/tests/object_types/variance_in_param.phpt
index bcc528e..cf28dd8 100644
--- a/Zend/tests/object_types/variance_in_param.phpt
+++ b/Zend/tests/object_types/variance_in_param.phpt
@@ -15,6 +15,7 @@ class Bar extends Foo {
var_dump(new Bar);
?>
--EXPECTF--
+Warning: Declaration of Bar::qux(Qux $qux) should be compatible with Foo::qux(object $object) in %s on line 10
object(Bar)#%d (0) {
@krakjoe
krakjoe / starfield.d
Created Nov 8, 2016
Starfield in D, uses krakjoe/dui (or any other 1:1 module)
View starfield.d
import std.random;
import andlabs.libui;
struct Star {
double X;
double Y;
double V;
bool F;
double G;
View test.md

ui

Build Status

This extension wraps the very excellent libui to provide PHP 7 with an API for the creation of cross platform native look-and-feel interfaces.

TODO

  • queue for pthreads
View starfield.php
<?php
use UI\App;
use UI\Window;
use UI\Point;
use UI\Size;
use UI\Area;
use UI\Controls\Box;
use UI\Draw\Pen;
use UI\Draw\Brush;
use UI\Draw\Path;
View prop_access.out
krakjoe@fiji:/usr/src/php-src$ sapi/cli/php -n prop.php
empty_loop 0.060
write_prop1() 0.085 0.025
write_prop2() 0.070 0.010
write_prop3() 0.058 -0.002
------------------------
Total 0.274
krakjoe@fiji:/usr/src/php-src$ sapi/cli/php -n prop.php
empty_loop 0.059
write_prop1() 0.086 0.027
View datetimeabstract.patch
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 2f52353..930c9f1 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -326,7 +326,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 0)
- ZEND_ARG_OBJ_INFO(0, datetime, DateTimeInterface, 0)
+ ZEND_ARG_OBJ_INFO(0, datetime, DateTimeAbstract, 0)
You can’t perform that action at this time.