note 80495 added to language.operators.type

From: Date: Fri, 18 Jan 2008 21:59:31 +0000
Subject: note 80495 added to language.operators.type
Groups: php.notes 
Request: Send a blank email to php-notes+get-135208@lists.php.net to get a copy of this message
The PHP parser generates a parse error on either of the two lines that are commented out here. Apparently the 'instanceof' construct will take a string variable in the second spot, but it will NOT take a string... lame class Bar {} $b = new Bar; $b_class = "Bar"; var_export($b instanceof Bar); // this is ok var_export($b instanceof $b_class); // this is ok //var_export($f instanceof "Bar"); // this is syntactically illegal //var_export($f instanceof 'Bar'); // this is syntactically illegal ---- Server IP: 208.69.120.35 Probable Submitter: 216.143.62.166 ---- Manual Page -- http://www.php.net/manual/en/language.operators.type.php Edit -- https://master.php.net/note/edit/80495 Del: integrated -- https://master.php.net/note/delete/80495/integrated Del: useless -- https://master.php.net/note/delete/80495/useless Del: bad code -- https://master.php.net/note/delete/80495/bad+code Del: spam -- https://master.php.net/note/delete/80495/spam Del: non-english -- https://master.php.net/note/delete/80495/non-english Del: in docs -- https://master.php.net/note/delete/80495/in+docs Del: other reasons-- https://master.php.net/note/delete/80495 Reject -- https://master.php.net/note/reject/80495 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135208) next »