php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41417 php build date information in a script
Submitted: 2007-05-17 16:13 UTC Modified: 2007-05-17 18:03 UTC
Votes:5
Avg. Score:3.6 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: hajo at clansphere dot net Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 6CVS-2007-05-17 (snap) OS: Irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-05-17 16:13 UTC] hajo at clansphere dot net
Description:
------------
since not everyone uses php snaps in the same build date it is possible to have a function work with one and not with another.

so it would be nice to have a predefined constant like PHP_BUILD_DATE or something like that to echo in a debug mode of a script.

i searched for it on search engines and even some forums without success. it was just possible to extract it from phpinfo(INFO_GENERAL) with some code that doesn't work for all php versions the same.

thank you very much

Reproduce code:
---------------
     

Expected result:
----------------
     

Actual result:
--------------
     

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-17 16:32 UTC] tony2001@php.net
Well, you should not be using snapshots in production for the first place.
Second, I don't think it would be useful for anybody except developers, but then they always use the latest snapshot.
So such a constant makes very little sense for me.
 [2007-05-17 16:52 UTC] hajo at clansphere dot net
wouldn't it be good to have issues fixed in snapshots before they appear to a script when a new final php version is set up on the webserver?

to have this done i often try out snapshots, and for example php6 triggers strict errors and a few notices that couldn't be seen on php5 in the current versions. they help to make scripts more valid and flexible. while different developers have different snapshot releases installed it could be easier when looking at the build date to compare with.

is there any other way to have the build date available without workarounds?
 [2007-05-17 17:00 UTC] tony2001@php.net
`php -v` shows the build date.
I'm sure it's more than enough if you don't really want to use it in your scripts.
 [2007-05-17 17:19 UTC] hajo at clansphere dot net
running shellcode is forbidden on many webservers due to security
 [2007-05-17 17:25 UTC] tony2001@php.net
You don't have to use PHP to execute a shell command.
SSH to the server and execute it manually.
Or use phpinfo().

 [2007-05-17 17:29 UTC] hajo at clansphere dot net
is it possible to fetch phpinfo data directly as an array? that html formated 'output' is useless to me in this case
 [2007-05-17 17:34 UTC] hajo at clansphere dot net
new idea: is it possible to add an argument to php_version() if the version returned should be with/out the build date? to have backwards compatibility it could be off by default.
 [2007-05-17 17:42 UTC] tony2001@php.net
I don't see any reason why would anyone need to know the build date *in a script*.
 [2007-05-17 17:46 UTC] hajo at clansphere dot net
this bug is useless from now on, because i can't change your mind.

anyway, thanks for help
 [2007-05-17 18:03 UTC] hajo at clansphere dot net
corrected summary
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC