Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion trick-1.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

/* Insert Magic Code Here */
namespace foo;
function var_dump() {
\var_dump(true);
}

// NO CHANGES ALLOWED BELOW

Expand Down
4 changes: 3 additions & 1 deletion trick-2.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

/* Insert Magic Code Here */
$array[2] = 0;
$array[1] = &$array[2];
$array[0] = &$array[2];

// NO CHANGES ALLOWED BELOW

Expand Down
8 changes: 4 additions & 4 deletions trick-3.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/*
* Insert Magic Code Here
*
*/
$a = 'echo "Hello World\n";';
$b = 'a';
$c = 'b';
$var = 'c';

// NO CHANGES ALLOWED BELOW
eval($$$$var);
Expand Down
16 changes: 16 additions & 0 deletions trick-4-2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

ob_start(function() {
return 'World!';
});

// NO CHANGES ALLOWED BELOW

$var = 'Hello!';
echo $var;

/*
* Magic output:
*
* World!
*/
15 changes: 5 additions & 10 deletions trick-4.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<?php

/*
*
* Insert Magic Code Here
*
*
*
*
*
*
*/
declare(ticks=1);
register_tick_function(function() {
$GLOBALS['var'] = 'World!';
});


// NO CHANGES ALLOWED BELOW

Expand Down
2 changes: 1 addition & 1 deletion trick-5.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

/* Insert Magic Code Here */
$data = 'Hellm';

// NO CHANGES ALLOWED BELOW

Expand Down
10 changes: 4 additions & 6 deletions trick-6.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php

/*
*
* Insert Magic Code Here
*
*
*/
declare(ticks=3);
register_tick_function(function() {
echo ' PHP ';
});

// NO CHANGES ALLOWED BELOW

Expand Down
6 changes: 3 additions & 3 deletions trick-7.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

/*
* Insert Magic Code Here
*/
ob_start(function($v) {
return strrev($v);
});

// NO CHANGES ALLOWED BELOW

Expand Down