Skip to content

Instantly share code, notes, and snippets.

@Izumi-kun
Forked from sanmai/die_twice.php
Last active October 30, 2015 12:52
Show Gist options
  • Save Izumi-kun/fb97504464e56cc5f621 to your computer and use it in GitHub Desktop.
Save Izumi-kun/fb97504464e56cc5f621 to your computer and use it in GitHub Desktop.
If you want to die more than once
<?php
register_shutdown_function(function(){ new one(); });
class one
{
public function __construct()
{
die("DIED ONCE\n");
}
}
class two
{
public function __destruct()
{
new one();
}
}
$two = new two();
new one();
DIED ONCE
DIED ONCE
DIED ONCE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment