Lines:
1 to 100 of 1116
<?php /************************************************************************************* * php.php * -------- * Author: Nigel McNie (nigel@geshi.org) * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/) * Release Version: 1.0.9.0 * Date Started: 2004/06/20 * * PHP language file for GeSHi. * * CHANGES * ------- * 2008/05/23 (1.0.7.22) * - Added description of extra language features (SF#1970248) * 2004/11/25 (1.0.3) * - Added support for multiple object splitters * - Fixed &new problem * 2004/10/27 (1.0.2) * - Added URL support * - Added extra constants * 2004/08/05 (1.0.1) * - Added support for symbols * 2004/07/14 (1.0.0) * - First Release * * TODO (updated 2004/07/14) * ------------------------- * * Make sure the last few function I may have missed * (like eval()) are included for highlighting * * Split to several files - php4, php5 etc * ************************************************************************************* * * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GeSHi is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GeSHi; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ************************************************************************************/ $language_data = array( 'LANG_NAME' => 'PHP', 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'), 'COMMENT_MULTI' => array('/*' => '*/'), 'COMMENT_REGEXP' => array( //Heredoc and Nowdoc syntax 3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+?)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU', // phpdoc comments 4 => '#/\*\*(?![\*\/]).*\*/#sU', // Advanced # handling 2 => "/#.*?(?:(?=\?\>)|^)/smi" ), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array('"'), 'ESCAPE_CHAR' => '', 'ESCAPE_REGEXP' => array( //Simple Single Char Escapes 1 => "#\\\\[nfrtv\$\"\n\\\\]#i", //Hexadecimal Char Specs 2 => "#\\\\x[\da-fA-F]{1,2}#i", //Octal Char Specs 3 => "#\\\\[0-7]{1,3}#", //String Parsing of Variable Names 4 => "#\\$[a-z0-9_]+(?:\\[[a-z0-9_]+\\]|->[a-z0-9_]+)?|(?:\\{\\$|\\$\\{)[a-z0-9_]+(?:\\[('?)[a-z0-9_]*\\1\\]|->[a-z0-9_]+)*\\}#i", //Experimental extension supporting cascaded {${$var}} syntax 5 => "#\$[a-z0-9_]+(?:\[[a-z0-9_]+\]|->[a-z0-9_]+)?|(?:\{\$|\$\{)[a-z0-9_]+(?:\[('?)[a-z0-9_]*\\1\]|->[a-z0-9_]+)*\}|\{\$(?R)\}#i", //Format String support in ""-Strings 6 => "#%(?:%|(?:\d+\\\\\\\$)?\\+?(?:\x20|0|'.)?-?(?:\d+|\\*)?(?:\.\d+)?[bcdefFosuxX])#" ), 'HARDQUOTE' => array("'", "'"), 'HARDESCAPE' => array("'", "\\"), 'HARDCHAR' => "\\", 'NUMBERS' => GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_SCI_ZERO, 'KEYWORDS' => array( 1 => array( 'as','break','case','continue','default','do','else','elseif', 'endfor','endforeach','endif','endswitch','endwhile','for', 'foreach','if','include','include_once','require','require_once', 'return','switch','throw','while', 'yield', 'echo','print' ), 2 => array( '&new','</script>','<?php','<script language', 'abstract','class','const','declare','extends','function','global', 'implements', 'interface','namespace','new','private','protected', 'public','Telf','trait','use','var'View on GitHub View on Trac