cvs: php4 /scripts/ext_skel_ng php_element.php

From: Date: Sat, 26 Apr 2003 15:35:16 +0000
Subject: cvs: php4 /scripts/ext_skel_ng php_element.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20512@lists.php.net to get a copy of this message
hholzgra Sat Apr 26 11:35:16 2003 EDT Modified files: /php4/scripts/ext_skel_ng php_element.php Log: better 'name' regex Index: php4/scripts/ext_skel_ng/php_element.php diff -u php4/scripts/ext_skel_ng/php_element.php:1.2 php4/scripts/ext_skel_ng/php_element.php:1.3 --- php4/scripts/ext_skel_ng/php_element.php:1.2 Fri Feb 28 01:28:53 2003 +++ php4/scripts/ext_skel_ng/php_element.php Sat Apr 26 11:34:10 2003 @@ -1,6 +1,7 @@ <?php class php_element { + function is_type($name) { $types = array("void" => "void", "bool" => "bool", @@ -18,7 +19,7 @@ "callback" => "callback", ); - if(isset($types[$name])) { + if (isset($types[$name])) { return $types[$name]; } else { return false; @@ -26,7 +27,7 @@ } function is_name($name) { - if(ereg("[a-zA-Z0-9_]",$name)) { + if (ereg("^[[:alpha:]_][[:alnum:]_]*$",$name)) { // TODO reserved words return true; } @@ -49,7 +50,7 @@ function docbook_editor_footer($level=3) { return ' <!-- Keep this comment at the end of the file -Local variables: +Local'.' variables: mode: sgml sgml-omittag:t sgml-shorttag:t

« previous php.cvs (#20512) next »