note 128753 added to function.define

From: Date: Sat, 22 Jul 2023 08:02:12 +0000
Subject: note 128753 added to function.define
Groups: php.notes 
Request: Send a blank email to php-notes+get-220713@lists.php.net to get a copy of this message
May this is obvious for many, but i had to test it to see that this was true (since not found into documentations i've read): <?php define("TEST", 'test'.'me'); echo TEST; if(defined('TES'.'T')){ echo TEST; } $test = 'NICE'; $me = 'TOKNOW'; define("NICETOKNOW", $test . $me); if(defined($test . $me)){ echo NICETOKNOW; } ?> Result: testmetestmeNICETOKNOW on Php 8.2.6 it is actually possible, do not know on previous Php versions but i assume also yes. ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.159.168 (proxied: 2.37.207.169) ---- Manual Page -- https://php.net/manual/en/function.define.php Edit -- https://main.php.net/note/edit/128753 Del: integrated -- https://main.php.net/note/delete/128753/integrated Del: useless -- https://main.php.net/note/delete/128753/useless Del: bad code -- https://main.php.net/note/delete/128753/bad+code Del: spam -- https://main.php.net/note/delete/128753/spam Del: non-english -- https://main.php.net/note/delete/128753/non-english Del: in docs -- https://main.php.net/note/delete/128753/in+docs Del: other reasons-- https://main.php.net/note/delete/128753 Reject -- https://main.php.net/note/reject/128753 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#220713) next »