Skip to content

Instantly share code, notes, and snippets.

@LionsAd
Created October 29, 2015 01:21
Show Gist options
  • Select an option

  • Save LionsAd/73e027259c9ff8444eeb to your computer and use it in GitHub Desktop.

Select an option

Save LionsAd/73e027259c9ff8444eeb to your computer and use it in GitHub Desktop.
Test PHP7 crash with Drupal 8
<?php
function foo() {}
function bar() {}
function crash_merge($attached) {
$merge = [ 'html_head' => ['2']];
$attached = array_merge_recursive(
$attached,
$merge
);
print_r($attached);
return $attached;
}
function crash_prepare() {
$attachments2 = [ '#attached' => [ 'html_head' => ['0', '1']]];
$attached = $attachments2['#attached'];
unset($attached['html_head'][1]);
return crash_merge($attached);
}
$dummy = str_repeat('-', 1024*1024*10);
$autoloader = require_once 'autoload.php';
$x = crash_prepare();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment