php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71747 php --rf assert on php7 erronously returns function description
Submitted: 2016-03-08 20:22 UTC Modified: 2016-03-09 04:09 UTC
From: nino dot skopac at gmail dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 7.0.4 OS: debian jessie
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: nino dot skopac at gmail dot com
New email:
PHP Version: OS:

 

 [2016-03-08 20:22 UTC] nino dot skopac at gmail dot com
Description:
------------
Running php --rf assert on CLI returns assert() function synopsis, but the docs for assert() say that as of php7 the function is no longer a function, but a language construct, so it should return "Exception: Function assert() does not exist instead", innit?

Also:
php -v
PHP 7.0.4-1~bpo80+1 (cli) ( NTS )


Test script:
---------------
php --rf assert

Expected result:
----------------
Exception: Function assert() does not exist

Actual result:
--------------
Function [ <internal:standard> function assert ] {

  - Parameters [2] {
    Parameter #0 [ <required> $assertion ]
    Parameter #1 [ <optional> $description ]
  }
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-08 20:42 UTC] nino dot skopac at gmail dot com
-Package: Doc Build problem +Package: CGI/CLI related -Operating System: jessie +Operating System: debian jessie
 [2016-03-08 20:42 UTC] nino dot skopac at gmail dot com
changed package
 [2016-03-09 04:09 UTC] laruence@php.net
-Status: Open +Status: Not a bug
 [2016-03-09 04:09 UTC] laruence@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

assert is still exists.

just in most cases, we complie it into a function statement.

but there still cases, you can call the function, like:

$a = 'assert'; 
$a(0); // the compiler doesn't know $a is assert, so it's can not compiles it into statement, as that is why we still have a "function" assert.

thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC