php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59791 Inconsistent warning message when enabled APC
Submitted: 2011-05-29 01:08 UTC Modified: 2012-04-13 09:39 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tszming at gmail dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.3.2 OS: Ubuntu 10.04.2 LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tszming at gmail dot com
New email:
PHP Version: OS:

 

 [2011-05-29 01:08 UTC] tszming at gmail dot com
Description:
------------
When the provided code get executed under Apache/mod_php, 
with APC enabled, only the FIRST request would result in 
warning:

======
Warning: The magic method __set() must have public 
visibility and cannot be static in test.php on line 5
======

When you request the file second time, no warning message 
appear - some how it was caught by APC and being omitted.

This Inconsistent behavior is hard to debug and wasted a lot 
of the development time. 
 



Reproduce code:
---------------
<?php

class Foo
{
     protected function __set($name, $value){}
     protected function __get($name) {}
}

echo "Loaded";

Expected result:
----------------
The warning message should always appear.


Actual result:
--------------
The warning message only appear in the 1st request.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-13 09:39 UTC] pajoye@php.net
-Status: Open +Status: Not a bug
 [2012-04-13 09:39 UTC] pajoye@php.net
This is due to the nature of the warning.

This kind of warnings is generated at compile time, which happens only once when 
an opcode cache is enabled (like APC).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 16:01:30 2024 UTC