php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65645 interactive shell doesn't support finally block
Submitted: 2013-09-09 18:48 UTC Modified: 2013-09-10 10:58 UTC
From: schavery at gmail dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.4.19 OS: OS X 10.8.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: schavery at gmail dot com
New email:
PHP Version: OS:

 

 [2013-09-09 18:48 UTC] schavery at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/features.commandline.interactive
---

Using php -a

try { echo 'try'; } catch(Exception $e) { echo 'catch'; } finally { echo 
'finally'; }
returns:
PHP Parse error:  parse error in php shell code on line 1

and:

php > try {
php { echo '1';
php { } catch(Exception $e) {
php { echo '2';
php { } finally { <-- line 5
php { echo '3';
php { }
PHP Parse error:  parse error in php shell code on line 5

Test script:
---------------
<?php
try {
   echo '1';
} catch (Exception $e) {
   echo '2';
} finally {
   echo '3';
}

Expected result:
----------------
expected result is:
13

Actual result:
--------------
PHP Parse error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-09 19:24 UTC] schavery at gmail dot com
-Status: Open +Status: Closed
 [2013-09-09 19:24 UTC] schavery at gmail dot com
Only works with 5.5+, and I was running 5.4
 [2013-09-10 10:58 UTC] rasmus@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC