mircobabini
1/19/2014 - 2:15 PM

sunset stands for safe_unset (unset safely) it won't occur in any Segmentation faults or zend_mm_heap corrupted

sunset stands for safe_unset (unset safely) it won't occur in any Segmentation faults or zend_mm_heap corrupted

<?php

function sunset() {
	$args = func_get_args_byref();
	foreach ( $args as $arg ) {
		if( $arg === null )
			continue;
			
		unset( $arg );
	}
}
function func_get_args_byref() {
	$trace = debug_backtrace();
	return $trace[1]['args'];
}