note 84436 added to language.oop5.typehinting

From: Date: Mon, 14 Jul 2008 13:18:51 +0000
Subject: note 84436 added to language.oop5.typehinting
Groups: php.notes 
Request: Send a blank email to php-notes+get-141485@lists.php.net to get a copy of this message
Love the typehint object Daniel. Great effort! However, it still throws catchable fatal errors, which is not what I want, so I added one line to handleTypehint() so it throws an Exception. public static function handleTypehint($ErrLevel, $ErrMessage) { if ($ErrLevel == E_RECOVERABLE_ERROR) { if (preg_match ( TYPEHINT_PCRE, $ErrMessage, $ErrMatches )) { list ( $ErrMatch, $ThArgIndex, $ThClass, $ThFunction, $ThHint, $ThType ) = $ErrMatches; if (isset ( self::$Typehints [$ThHint] )) { $ThBacktrace = debug_backtrace (); $ThArgValue = NULL; if (self::getTypehintedArgument ( $ThBacktrace, $ThFunction, $ThArgIndex, $ThArgValue )) { if (call_user_func ( self::$Typehints [$ThHint], $ThArgValue )) { return TRUE; } } } throw new Exception($ErrMessage); } } return FALSE; } ---- Server IP: 194.153.94.10 Probable Submitter: 217.145.1.248 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.typehinting.php Edit -- https://master.php.net/note/edit/84436 Del: integrated -- https://master.php.net/note/delete/84436/integrated Del: useless -- https://master.php.net/note/delete/84436/useless Del: bad code -- https://master.php.net/note/delete/84436/bad+code Del: spam -- https://master.php.net/note/delete/84436/spam Del: non-english -- https://master.php.net/note/delete/84436/non-english Del: in docs -- https://master.php.net/note/delete/84436/in+docs Del: other reasons-- https://master.php.net/note/delete/84436 Reject -- https://master.php.net/note/reject/84436 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#141485) next »