php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62456 Incorrect description of notice
Submitted: 2012-06-30 22:57 UTC Modified: 2012-10-15 14:06 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: iblacksmoke at gmail dot com Assigned: ab (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.4.4 OS: debian linux
Private report: No CVE-ID: None
 [2012-06-30 22:57 UTC] iblacksmoke at gmail dot com
Description:
------------
Description of notice when calling missing property of standard php object contains incorrect characters (possibly from different encoding). They cause error in class of standard class ErrorException, and script returns fatal error(with no information) rather than exception. It turns out there as much as two bugs: incorrect encoding of strings and lack of data filtering in ErrorException constructor.

Test script:
---------------
one:
$test = new StdClass();
echo $test->qwerty;


two:
set_error_handler(function($errno, $errstr, $errfile, $errline){
	throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
});

$test = new StdClass();
echo $test->qwerty;

Expected result:
----------------
one:
Notice: Undefined property: stdClass::$qwerty in script

two:
correct php exception

Actual result:
--------------
one:
Notice: Undefined property: stdClass�K�::$qwerty in script

two:
Fatal error: in script

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-01 14:16 UTC] Sjon at hortensius dot net
If you suspect that this is caused by encoding in your script, can't you post an 
example that actually contains these characters? Because your current test-script 
works fine here.

Maybe you can post an example with eval and chr?
 [2012-07-02 00:52 UTC] aharvey@php.net
I can't reproduce this.

What extensions do you have loaded (php -m output would be good, if possible), and 
can you please check your local test script for any non-printable characters 
embedded within it?
 [2012-07-02 00:52 UTC] aharvey@php.net
-Status: Open +Status: Feedback -Package: I18N and L10N related +Package: Scripting Engine problem
 [2012-07-02 10:03 UTC] iblacksmoke at gmail dot com
My test script contains only lines, that I wrote in report. More information about of php and extensions:

root@pav-home:~# php -v
PHP 5.4.4-2~dotdeb.0 (cli) (built: Jun 22 2012 13:21:56)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
root@pav-home:~#

root@pav-home:~# php -m
[PHP Modules]
apc
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
geoip
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
zip
zlib

[Zend Modules]

root@pav-home:~#


Also, I use php build by dotdeb.org. Maybe, problem in this.
 [2012-07-02 10:22 UTC] aharvey@php.net
Possibly. Can you try it without APC, and if that doesn't help, with a stock 
build, please?
 [2012-07-02 10:23 UTC] iblacksmoke at gmail dot com
Upd: problem in apc. If apc is off, additional symbols in error not appear.
Apc config:
; configuration for php apc module
extension=apc.so
 [2012-07-02 10:46 UTC] aharvey@php.net
Thanks; I'll pop this into the APC category, then.
 [2012-07-02 10:46 UTC] aharvey@php.net
-Status: Feedback +Status: Open -Package: Scripting Engine problem +Package: APC
 [2012-07-02 16:33 UTC] ab@php.net
could you please try the latest APC trunk to see if the error is present there?
 [2012-07-02 18:37 UTC] iblacksmoke at gmail dot com
Sorry, I dont have possibility install stock version. If You cant reproduce this bug, can consider it mistake to building package and close this bugreport.
 [2012-07-20 20:52 UTC] ab@php.net
Automatic comment from SVN on behalf of ab
Revision: http://svn.php.net/viewvc/?view=revision&revision=326747
Log: added tests for bug #62456 Incorrect description of notice
 [2012-07-20 20:53 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2012-07-20 20:53 UTC] ab@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 [2012-10-15 12:53 UTC] jinxiao2010 at gmail dot com
i met this problem this morning , when i run 
#make test
it showed this bug , my php version is 5.4.7 , the newest Stable version , why the bug is still there
 [2012-10-15 14:06 UTC] ab@php.net
Which APC version are you using? Could you pls try the latest beta or trunk?
 [2012-11-24 17:27 UTC] sfedder at hotmail dot com
I also had this problem occur after proper install of latest version APC 3.1.13 
under PHP 5.4.8 running make test.  FAIL APC: Bug #62456 54_0 Incorrect 
description of notice variation 1 (php 5.4 nts) [tests/apc54_004.phpt]
 [2012-12-14 00:37 UTC] alj62888 at yahoo dot com
I am seeing this in php-5.4.9.tar.gz from 'make test'.
 [2013-04-04 01:03 UTC] mi+php at aldan dot algebra dot com
This test is failing, when APC-3.1.13 is built against php-4.3.13:

FAILED TEST SUMMARY
---------------------------------------------------------------------
APC: Bug #62190 Couldn't fetch DOMProcessingInstruction with APC and native obj (php 5.4 nts) [tests/apc54_003.phpt]
APC: Bug #62456 Incorrect description of notice variation 1 (php 5.4 nts) [tests/apc54_004.phpt]
APC: Bug #61912 Memory corruption in ext/dom (php 5.4) [tests/apc54_008.phpt]
APC: Bug #61824 apc produces strange notice (php 5.4) [tests/apc54_009.phpt]
APC: Bug #59938 APCIterator fails with large user cache [tests/apc54_018.phpt]
Trying to exclude trait method multiple times (origin Zend/tests/traits/error_010.phpt) [tests/apc54_error_010.phpt]
Exclude trait method [tests/apc54_error_010_2.phpt]
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 16 02:01:28 2024 UTC