Skip to content

Instantly share code, notes, and snippets.

Anthony Ferrara ircmaxell

Block or report user

Report or block ircmaxell

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 expect.php
<?php
class Foo {
public $name;
public $age;
public function __construct($name, $age) {
}
}
View code.php
<?php
$a = 1.0;
$b = 2;
$c = foo($a, $b);
$d = foo($b, $c);
function foo(int $a, int $b): int {
View about.md

This gist determines keys for the "RADICORE ENCRYPTION CLASS": http://pastebin.com/2j2G83AH.

It relies on knowing the settings, but not the key.

See the demo.php file for a test situation using weak random keys.

It takes approximately 10 seconds to work out a 50 character random key.

One interesting thing is that there are colliding keys for a given plaintext.

View fibo.php
<?php
function fibo(int $n): int {
return match($n) {
case 1: 1;
case 0: 1;
case _<0: throw new Exception("Less than 0 is not allowed, " . _ . " provided");
case _: fibo(_ - 1) + fibo(_ - 2);
};
}
View test.c
if (file_ast->children > 0 && !(
file_ast->child[0] == ast // First statement in the file
|| ( // after a non-block namespace declaration
file_ast->child[0]->kind == ZEND_AST_NAMESPACE
&& file_ast->child[0]->child[1] == NULL // non-block mode namespace declaration
&& file_ast->child[1] == ast
))) {
zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be "
"the very first statement in the script");
}
View example.php
<?php
trait VerifyPrecondition {
protected $parent;
protected function verifyPrecondition($method, array $args) {
$objs = [new ReflectionMethod($this->parent, $method)];
foreach ((new ReflectionObject($this->parent))->getInterfaces() as $iface) {
if ($iface->hasMethod($method)) {
$objs[] = $iface;
}
View votes.json
{
"stas": [
"PHP: rfc:group_use_declarations - Should Grouped Use Declarations be added to PHP 7: 3",
"PHP: rfc:skipparams - Should PHP 7 support parameter skipping as described in this RFC?: 1",
"PHP: rfc:scalar_type_hints - Accept the Scalar Type Hints RFC and merge patch into master?: 2",
"PHP: rfc:scalar_type_hints - Type aliases: 1",
"PHP: rfc:scalar_type_hints - Reserve type names if RFC does not pass?: 2",
"PHP: rfc:combined-comparison-operator - Accept the Combined Comparison (Spaceship) Operator RFC and merge patch into master?: 1",
"PHP: rfc:error_handler_callback_parameters_passed_by_reference - Allow error_handler callback parameters to be passed by reference: 3",
"PHP: rfc:php7timeline - php7timeline: 1",
View fix_conversion.patch
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 4f12834..8094dda 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -1189,12 +1189,10 @@ static zend_always_inline int zend_parse_arg_str(zval *arg, zend_string **dest,
if (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
*dest = NULL;
} else {
- if (Z_COPYABLE_P(arg) && Z_REFCOUNT_P(arg) > 1) {
- Z_DELREF_P(arg);
View soap-test.php
<?php
$url = 'https://qa-orderapi.intelispend.com/Processes/IntelispendAPI/IntelispendOrderAPI/SubmitFileService.serviceagent?wsdl';
$opts = array(
'http' => array(
'verify_peer' => false,
'verify_peer_name' => false
)
);
$context = stream_context_create($opts);
$client = new \SoapClient($url,
@ircmaxell
ircmaxell / test.php
Last active Aug 29, 2015
A simple functional experimental language in PHP
View test.php
<?php
$code = "
= print (-> #text (
echo (chr text)
print
))
You can’t perform that action at this time.