How to check current PHP version in PHP?
Answer:
If your PHP version is after PHP 5.2.7, you can use the PHP_VERSION constant.
echo PHP_VERSION;
Else, you can use the function phpversion()
echo phpversion();
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to check current PHP version in PHP?
Answer:
If your PHP version is after PHP 5.2.7, you can use the PHP_VERSION constant.
echo PHP_VERSION;
Else, you can use the function phpversion()
echo phpversion();
New way to print in Perl6
Answer:
In Perl 6, you can use the new syntax say to print out string in Perl.
say 'hello';
But they are also valid under Perl 5.10 or 5.12, if you add
use feature qw(say);
Disable APC auto recompile modified PHP files
Answer:
If you want extra performance boost for PHP/APC, you can tell APC not to auto recompile modified PHP files even they have changed. This can save APC for not to check the modification time of your script on every request.
To do so, edit your php.ini, and add
apc.apc.stat = 0
Restart your web server (e.g. Apache) to take effect.
How to convert hash to array in Perl?
Answer:
It is easy to convert hash to array in Perl.
The following code extracted all values from a hash and save into an array.
my @a = values %h;
How to print out Perl opcodes?
Answer:
If you want to have a deep understanding on how Perl execute your statements, you can try the following:
# perl -MO=Concise -e ' print "foo\n" '
6 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 1 -e:1) v:{ ->3
5 <@> print vK ->6
3 <0> pushmark s ->4
4 <$> const[PV "foo\n"] s ->5
-e syntax OK