
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, updated 2008-08-16)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
S159 - MySQL 5 and PHP 5 [104] mysql_connect or mysql_pconnect in PHP? - (2004-10-30)
[494] MySQL - a score of things to remember - (2005-11-12)
[515] MySQL - an FAQ - (2005-12-03)
[1131] MySQL - Password security (authentication protocol) - (2007-04-02)
[1417] What software version do we teach? - (2007-10-31)
[1455] Connecting to MySQL 5 from PHP on Mac OSX Leopard - (2007-12-03)
[1766] Diagrams to show you how - Tomcat, Java, PHP - (2008-08-22)
[2172] PHP4 v PHP5 - Object Model Difference - (2009-05-11)
[3455] MySQL, MySQLi, PDO or something else - how best to talk to databases from PHP - (2011-09-24)
H310 - PHP - Putting it all together [468] Stand alone PHP programs - (2005-10-18)
[687] Presentation, Business and Persistence layers in Perl and PHP - (2006-04-17)
[1716] Larger applications in PHP - (2008-07-22)
[1794] Refactoring - a PHP demo becomes a production page - (2008-09-12)
[1840] Validating Credit Card Numbers - (2008-10-14)
[1962] Index Card System for Game Characters in PHP - (2008-12-27)
[2275] Debugging multipage (session based) PHP applications - (2009-07-09)
[2635] A PHP example that lets your users edit content without HTML knowledge - (2010-02-14)
[2931] Syncronise - software, trains, and buses. Please! - (2010-08-22)
[3454] Your PHP website - how to factor and refactor to reduce growing pains - (2011-09-24)
G997 - Well House Consultants - Newsletter Lead Articles [1000] One Thousand Posts and still going strong - (2006-12-18)
[1065] Graham Ellis - an Introduction - (2007-02-05)
[1136] Buffering output - why it is done and issues raised in Tcl, Perl, Python and PHP - (2007-04-06)
[1224] Object Relation Mapping (ORM) - (2007-06-09)
[1318] Well House Manor - feature comparison against the old place! - (2007-08-24)
[1386] New software product for warmblooded programmers - (2007-10-10)
[1488] New trainee laptop fleet for our Open Source courses - (2007-12-30)
[1545] Letting new visitors know we provide training courses - (2008-02-19)
[1600] Cambidge - Tcl, Expect and Perl courses - (2008-04-04)
[1663] Python in an afternoon - a lecture for experienced programmers - (2008-06-01)
[1819] Calling base class constructors - (2008-10-03)
[1912] Book now for 2009 - (2008-11-29)
[2052] How was my web site compromised? - (2009-02-24)
[2119] Make your business a DESTINATION business - (2009-04-05)
[2253] Walks in and around Melksham, Wiltshire - (2009-06-21)
[2370] C++, Python, and other training - do we use an IDE - (2009-08-21)
[2425] Weekend and Christmas Promotion - Well House Manor Hotel, Melksham - (2009-09-26)
[2538] Open Source Training Centre and Courses for 2010 - (2009-12-16)
[2743] Public Open Source Training Courses running this summer and autumn in Melksham - (2010-04-27)
[3202] Telling you something about us in just one line - (2011-03-15)
Some other Articles
Lindors Hotel, near St. Briavels, Wye ValleyPreserved railways - struggling to the future?Ever had One of THOSE mornings?IstanbulUpgrade from PHP 4 to PHP 5 - the TRY issuePerl v PHP, choosing the right languageDynamic maps / geographics in PHPPublic Training Course Dates until July 2009Glorious (?) 12th August - what a Pe(a)rl!Using server side and client side programming together