Bug #76636 [NEW]: E_PARSE error not throw in the spl_autoload_register.
From: sugerliedear at gmail dot com
Operating system: centos65
PHP version: 7.2.7
Package: *General Issues
Bug Type: Bug
Bug description:E_PARSE error not throw in the spl_autoload_register.
Description:
------------
When i invoke spl_autoload_register two times, E_PARSE error not throw
in the spl_autoload_register in the first time.
Test script:
---------------
https://github.com/khadgarmage/hello-world/blob/master/php72-bug1.md
Expected result:
----------------
root@/mnt/htdocs $ php72 t.php
object(ParseError)#3 (7) {
["message":protected]=>
string(95) "syntax error, unexpected 'fdsaf' (T_STRING), expecting
function (T_FUNCTION) or const (T_CONST)"
["string":"Error":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(17) "/data2/mytest.php"
["line":protected]=>
int(3)
["trace":"Error":private]=>
array(2) {
[0]=>
array(2) {
["function"]=>
string(9) "{closure}"
["args"]=>
array(1) {
[0]=>
string(6) "mytest"
}
}
[1]=>
array(4) {
["file"]=>
string(12) "/data2/t.php"
["line"]=>
int(23)
["function"]=>
string(17) "spl_autoload_call"
["args"]=>
array(1) {
[0]=>
string(6) "mytest"
}
}
}
["previous":"Error":private]=>
NULL
}
PHP Warning: require_once(namespace\mytest.php): failed to open stream:
No such file or directory in /data2/t.php on line 19
PHP Fatal error: require_once(): Failed opening required
'namespace\mytest.php'
(include_path='.:/opt/remi/php72/root/usr/share/pear:/opt/remi/php72/root/usr/share/php:/usr/share/pear:/usr/share/php')
in /data2/t.php on line 19
Actual result:
--------------
root@/mnt/htdocs $ php72 t.php
PHP Warning: require_once(namespace\mytest.php): failed to open stream:
No such file or directory in /data2/t.php on line 15
PHP Fatal error: require_once(): Failed opening required
'namespace\mytest.php'
(include_path='.:/opt/remi/php72/root/usr/share/pear:/opt/remi/php72/root/usr/share/php:/usr/share/pear:/usr/share/php')
in /data2/t.php on line 15
--
Edit bug report at https://bugs.php.net/bug.php?id=76636&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76636&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76636&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76636&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76636&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76636&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76636&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76636&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76636&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76636&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76636&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76636&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76636&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76636&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76636&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76636&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76636&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76636&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76636&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76636&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76636&r=mysqlcfg
Thread (1 message)
- sugerliedear at gmail dot com