| > |
PHPFAQ - What do I have to do to convert PHP3 pages to PHP4 pages? Are there any compatibility problems? |
[Bookmark it] |
|
|
| PHPFAQ - What do I have to do to convert PHP3 pages to PHP4 pages? Are there any compatibility problems? |
|
Question : What do I have to do to convert PHP3 pages to PHP4 pages? Are there any compatibility problems?Answer :Onthewholetherearenomajorproblems.PHP3scriptsshouldworkjustfine. However:
The mysql_insert_id() command must be used properly in 4 but if you were to pass a $mysql_result to mysql_insert_id like this:
<?
$the_id=mysql_insert_id($mysql_result);
?>
you will recieve an error in PHP4 but not in PHP3.
String concatenation in initialization of variables in class definitions is possible in PHP3, but not in PHP4:
PHP3SYNTAX:
<?
class foo
{
var $bar = "A lot of text that I'd rather ".
"put on multiple lines using the string concatenator
('.')";
}
?>
PHP4SYNTAX:
<?
class foo
{
var $bar = "A lot of text that I'd rather put on mulitiple lines but have to keep on a single line 'cause I'm using PHP4 - which by the way is a pretty nice tool";
}
?>
|
|
|
|
|
|
|