Skip to content

Instantly share code, notes, and snippets.

@bpteam
Created October 8, 2015 17:32
Show Gist options
  • Save bpteam/889f9c260fdb5bde83dd to your computer and use it in GitHub Desktop.
Save bpteam/889f9c260fdb5bde83dd to your computer and use it in GitHub Desktop.
die without gc
<?php
var_dump(gc_enabled());
gc_disable();
var_dump(gc_enabled());
class Demo
{
function __construct()
{
echo "constructor\n";
}
function __destruct()
{
echo "destructor\n";
}
public function test()
{
echo "in test \n";
}
}
(new Demo())->test();
echo "after die class\n";
@bpteam
Copy link
Author

bpteam commented Oct 8, 2015

return
bool(true)
bool(false)
constructor
in test
destructor
after die class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment