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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 07:01:33 2025 UTC