<?php
class user {

	public function __construct( ) {
		$this->__magic( '__construct', $arguments );
	}

	public function __call( $name, $arguments ) {
		if ( $result = $this->__magic( $name, $arguments )) {
			return $result;
		}

		return call_user_func( array( $this, "_$name" ), $arguments );
	}

	private function __magic( $name, $arguments ) {
		if ( defined( 'class_hook_handler' )) {
			$hook_handler = class_hook_handler;

			return $hook_handler( $this, get_class( $this ), $name, $arguments );
		}

		return false;
	}

	private function _print_user( $arguments ) {
		$user = $this->get_user( )->user;
		echo 'O user chama-se '. $user['name'] . ' ' . $user['surname'] . '!<br />';
	}

	private function _get_user( $arguments ) {
		return $this->user;
	}
}

class big_user extends user {
	
}

/*
function __magic( $name, $arguments ) {
	if ( defined( 'class_hook_handler' )) {
		$hook_handler = function_hook_handler;

		return $hook_handler( $name, $arguments );
	}

	return false;
}

function big_user( ) {
	__magic( 'big_user' );
	echo( 'aqui!<br />' );
}
*/
