Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Upgrade from PHP 4 to PHP 5 - the TRY issue

It's often the most surprising things that catch you out on language upgrades! Our new web server is running PHP 5 (5.2.6) whereas the old shared service was running PHP 4. No problem with the conversion, PHP wise, except the exchange rate page which goes to the European Central Bank's web site and reads the current rates from there. And what was the problem with that page? The Turkish currency called TRY in 3 character shorthand - which was fine in PHP 4 but has become a reserved word in PHP 5. So the code

SIT => "Slovenian Tolar",
SKK => "Slovakian Koruna",
TRL => "Old Turkish Lira (to 2004)",
TRY => "New Turkish Lira (2005)",

has become

SIT => "Slovenian Tolar",
SKK => "Slovakian Koruna",
TRL => "Old Turkish Lira (to 2004)",
"TRY" => "New Turkish Lira (2005)",

and, yes, I am aware that the Slovenian Tolar is no more and that country now uses the Euro.

The (working!) exchange rate page is here and there's also our hotel currency exchange rate page available too, both of which collect the current exchange rate from the European Central Bank's site via XML / using Web 2 technologies (more resources and publicly available source code demo) from our PHP Technology Workshop).

The picture .. we're talking Turkey, and it's the Topkapi Palace in Istanbul, taken in October 2004 on the Perl Whirl 2004 - cruising in the company of Larry Wall, Rasmus Lerdorf, Monty Widenius (Perl, PHP, MySQL) and others.





In the past, I have had a similar issue with a variable called yield in Python - since yield became a keyword. I am mindful of the same issues with say, given and when in Perl 5.10, although Perl's use of a $ in front of variable names will make these problems into very rare cases indeed - such as was the PHP try issue that I started with.
(written 2008-08-15 16:36:48)

 
Associated topics are indexed under
S159 - MySQL 5 and PHP 5
H310 - PHP - Putting it all together

Back to
Perl v PHP, choosing the right language
Previous and next
or
Horse's mouth home
Forward to
Istanbul
Some other Articles
Lindors Hotel, near St. Briavels, Wye Valley
Preserved railways - struggling to the future?
Ever had One of THOSE mornings?
Istanbul
Upgrade from PHP 4 to PHP 5 - the TRY issue
Perl v PHP, choosing the right language
Dynamic maps / geographics in PHP
Public Training Course Dates until July 2009
Glorious (?) 12th August - what a Pe(a)rl!
Using server side and client side programming together
1892 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho