<commit_before>package tink.native;
#if macro
	import tink.macro.tools.AST;
	import haxe.macro.Expr;
#end
/**
 * ...
 * @author back2dos
 */

class PHP {
	@:macro static public function embed(s:String) {
		return AST.build(untyped __php__('eval__s'));
	}
}<commit_msg>Added object hashing method.<commit_after>package tink.native;
#if macro
	import tink.macro.tools.AST;
	import haxe.macro.Expr;
#end
/**
 * ...
 * @author back2dos
 */

class PHP {
	@:macro static public function embed(s:String) {
		return AST.build(untyped __php__('eval__s'));
	}
	static public function objHash(key:Dynamic):String {
		if (embed('is_array($key)')) {
			if (embed('is_callable($key)')) 
				return objHash(key[0]) + key[1];
			else 
				throw 'cannot handle native PHP arrays yet';
		}
		else return embed('spl_object_hash($key)');
	}
}
{'fraction_non_alphanumeric': 0.15815085158150852, 'fraction_numerical': 0.004866180048661801, 'mean_word_length': 4.208860759493671, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7184224', 'n_tokens_mistral': 327, 'n_tokens_neox': 297, 'n_words': 68}