- Add isValidDefineName method to validate constant names according to PHP rules - Implement validation check in define function call processing - Add fatal error handling for invalid constant names - Create comprehensive test case covering constant definition and usage scenariospull/1/head
parent
0cee9a4154
commit
fbb68ad689
2 changed files with 27 additions and 1 deletions
@ -0,0 +1,15 @@ |
|||||||
|
--TEST-- |
||||||
|
Defining and using constants |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
define('foo', 2); |
||||||
|
define('foo1', 3); |
||||||
|
|
||||||
|
var_dump(constant('foo')); |
||||||
|
var_dump(constant('foo1')); |
||||||
|
|
||||||
|
?> |
||||||
|
--EXPECTF-- |
||||||
|
int(2) |
||||||
|
int(3) |
||||||
Loading…
Reference in new issue