note 72127 added to language.operators.type

From: Date: Wed, 03 Jan 2007 23:03:04 +0000
Subject: note 72127 added to language.operators.type
Groups: php.notes 
Request: Send a blank email to php-notes+get-121261@lists.php.net to get a copy of this message
Here a small snipplet to test if a class extends another class. <?php function class_is_a($class, $base_class) { $o = unserialize('O:'. strlen($class) . ':"' . $class . '":0:{}'); return $o instanceof $base_class; } ?> Enjoy :) ---- Server IP: 83.137.20.120 Probable Submitter: 213.84.27.165 ---- Manual Page -- http://www.php.net/manual/en/language.operators.type.php Edit -- https://master.php.net/note/edit/72127 Del: integrated -- https://master.php.net/note/delete/72127/integrated Del: useless -- https://master.php.net/note/delete/72127/useless Del: bad code -- https://master.php.net/note/delete/72127/bad+code Del: spam -- https://master.php.net/note/delete/72127/spam Del: non-english -- https://master.php.net/note/delete/72127/non-english Del: in docs -- https://master.php.net/note/delete/72127/in+docs Del: other reasons-- https://master.php.net/note/delete/72127 Reject -- https://master.php.net/note/reject/72127 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121261) next »