Edit report at https://bugs.php.net/bug.php?id=71747&edit=1
ID: 71747
Updated by: laruence@php.net
Reported by: nino dot skopac at gmail dot com
Summary: php --rf assert on php7 erronously returns function
description
-Status: Open
+Status: Not a bug
Type: Bug
Package: CGI/CLI related
Operating System: debian jessie
PHP Version: 7.0.4
Block user comment: N
Private report: N
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2016-03-08 20:42:43] nino dot skopac at gmail dot com
changed package
------------------------------------------------------------------------
[2016-03-08 20:22:17] 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 ]
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71747&edit=1