Re: [PHP4BETA] Difference in parsing "{" inside control loops

From: Date: Sun, 12 Sep 1999 23:07:53 +0000
Subject: Re: [PHP4BETA] Difference in parsing "{" inside control loops
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-4373@lists.php.net to get a copy of this message
At 00:53 13/09/1999 , Michal Kolodziejczyk wrote:
Hello, I am trying imp with php4.0b2, and I found out its not working because of the following lines: while(!is_object($structure) || !imap_ping($mbox)) {
    $mbox = imap_open("{$server:$port}$mailbox", $user, $pass);
    $structure = @imap_fetchstructure($mbox, imap_msgno($mbox, $index));
} To make it working I had to add a backslash before "{" in the second line:
    $mbox = imap_open("\{$server:$port}$mailbox", $user, $pass);
Is it expected behaviour? The braces are quoted and I think should not affect the control loop. Looks like a bug to me. It did work for php3.
It's no bug - PHP 4.0 supports full variable evaluation inside quoted strings using "{$foo...}" notation. It is an incompatibility with 3.0, and the solution is to escape { or $ as you did. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il

« previous php.version4 (#4373) next »