Doc #73303 [NEW]: Not documented Backward incompatible change related to assert
| From: | ildar dot aim at gmail dot com | Date: | Wed, 12 Oct 2016 15:16:56 +0000 |
| Subject: | Doc #73303 [NEW]: Not documented Backward incompatible change related to assert | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-14008@lists.php.net to get a copy of this message | ||
From: ildar dot aim at gmail dot com
Operating system: Linux
PHP version: 7.1.0RC3
Package: *General Issues
Bug Type: Documentation Problem
Bug description:Not documented Backward incompatible change related to assert
Description:
------------
aim-server[~/tmp]$ /usr/bin/php --version
PHP 7.0.11 (cli) (built: Sep 16 2016 18:52:44) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
aim-server[~/tmp]$ /usr/bin/php test_class.php
Success%
aim-server[~/tmp]$
/opt/phpfarm/inst/php-7.1.0RC3/bin/php --version
PHP 7.1.0RC3 (cli) (built: Oct 12 2016 16:13:20) ( NTS DEBUG )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
aim-server[~/tmp]$ /opt/phpfarm/inst/php-7.1.0RC3/bin/php test_class.php
PHP Warning: assert(): Assertion
"self::checkCacheKey(get_object_vars($this))" failed in
/home/aim/tmp/test_class.php on line 7
Warning: assert(): Assertion
"self::checkCacheKey(get_object_vars($this))" failed in
/home/aim/tmp/test_class.php on line 7
PHP Fatal error: Uncaught Error: Cannot access self:: when no class
scope is active in /home/aim/tmp/test_class.php(7) : assert code:1
Stack trace:
#0 [internal function]: unknown()
#1 /home/aim/tmp/test_class.php(7): assert('self::checkCach...')
#2 /home/aim/tmp/test_class.php(17): Test->main()
#3 {main}
thrown in /home/aim/tmp/test_class.php(7) : assert code on line 1
Fatal error: Uncaught Error: Cannot access self:: when no class scope is
active in /home/aim/tmp/test_class.php(7) : assert code:1
Stack trace:
#0 [internal function]: unknown()
#1 /home/aim/tmp/test_class.php(7): assert('self::checkCach...')
#2 /home/aim/tmp/test_class.php(17): Test->main()
#3 {main}
thrown in /home/aim/tmp/test_class.php(7) : assert code on line 1
aim-server[~/tmp]$
http://i.imgur.com/aG7kYps.png
I cannot find a description of this behavior in
http://php.net/manual/en/migration71.incompatible.php
Test script:
---------------
aim-server[~/tmp]$ cat test_class.php
<?php
class Test {
public $prop;
public function main(){
assert('self::checkCacheKey(get_object_vars($this))');
echo 'Success';
}
private static function checkCacheKey($obj_properties){
return count($obj_properties) == 1;
}
}
$obj = new Test();
$obj->main();
Expected result:
----------------
Success output
or
description in
http://php.net/manual/en/migration71.incompatible.php
Actual result:
--------------
Fatal error: Uncaught Error: Cannot access self:: when no class scope is
active in /home/aim/tmp/test_class.php(7) : assert code:1
--
Edit bug report at https://bugs.php.net/bug.php?id=73303&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73303&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73303&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73303&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73303&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73303&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73303&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73303&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73303&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73303&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73303&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73303&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73303&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73303&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73303&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73303&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73303&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73303&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73303&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73303&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73303&r=mysqlcfg