2812 Upgrade from PHP 4 to PHP 5 - the TRY issue
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Upgrade from PHP 4 to PHP 5 - the TRY issue

Topkapi Palace, IstanbulIt'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 under
2b27 G997 - Well House Consultants - Newsletter Lead Articles
  [3202] Telling you something about us in just one line - (2011-03-15)
  [2743] Public Open Source Training Courses running this summer and autumn in Melksham - (2010-04-27)
  [2538] Open Source Training Centre and Courses for 2010 - (2009-12-16)
  [2425] Weekend and Christmas Promotion - Well House Manor Hotel, Melksham - (2009-09-26)
  [2370] C++, Python, and other training - do we use an IDE - (2009-08-21)
  [2253] Walks in and around Melksham, Wiltshire - (2009-06-21)
  [2119] Make your business a DESTINATION business - (2009-04-05)
  [2052] How was my web site compromised? - (2009-02-24)
  [1912] Book now for 2009 - (2008-11-29)
  [1819] Calling base class constructors - (2008-10-03)
  [1663] Python in an afternoon - a lecture for experienced programmers - (2008-06-01)
  [1600] Cambidge - Tcl, Expect and Perl courses - (2008-04-04)
  [1545] Letting new visitors know we provide training courses - (2008-02-19)
  [1488] New trainee laptop fleet for our Open Source courses - (2007-12-30)
  [1386] New software product for warmblooded programmers - (2007-10-10)
  [1318] Well House Manor - feature comparison against the old place! - (2007-08-24)
  [1224] Object Relation Mapping (ORM) - (2007-06-09)
  [1136] Buffering output - why it is done and issues raised in Tcl, Perl, Python and PHP - (2007-04-06)
  [1065] Graham Ellis - an Introduction - (2007-02-05)
  [1000] One Thousand Posts and still going strong - (2006-12-18)

H310 - PHP - Putting it all together
  [3454] Your PHP website - how to factor and refactor to reduce growing pains - (2011-09-24)
  [2931] Syncronise - software, trains, and buses. Please! - (2010-08-22)
  [2635] A PHP example that lets your users edit content without HTML knowledge - (2010-02-14)
  [2275] Debugging multipage (session based) PHP applications - (2009-07-09)
  [1962] Index Card System for Game Characters in PHP - (2008-12-27)
  [1840] Validating Credit Card Numbers - (2008-10-14)
  [1794] Refactoring - a PHP demo becomes a production page - (2008-09-12)
  [1716] Larger applications in PHP - (2008-07-22)
  [687] Presentation, Business and Persistence layers in Perl and PHP - (2006-04-17)
  [468] Stand alone PHP programs - (2005-10-18)

S159 - MySQL 5 and PHP 5
  [3455] MySQL, MySQLi, PDO or something else - how best to talk to databases from PHP - (2011-09-24)
  [2172] PHP4 v PHP5 - Object Model Difference - (2009-05-11)
  [1766] Diagrams to show you how - Tomcat, Java, PHP - (2008-08-22)
  [1455] Connecting to MySQL 5 from PHP on Mac OSX Leopard - (2007-12-03)
  [1417] What software version do we teach? - (2007-10-31)
  [1131] MySQL - Password security (authentication protocol) - (2007-04-02)
  [515] MySQL - an FAQ - (2005-12-03)
  [494] MySQL - a score of things to remember - (2005-11-12)
  [104] mysql_connect or mysql_pconnect in PHP? - (2004-10-30)


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
4083 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, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82 at 50 posts per page

41ba
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).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2013: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/1754_Upg ... issue.html • PAGE BUILT: Sat Feb 23 12:39:13 2013 • BUILD SYSTEM: wizard
0