Bug #65845 [Com]: Error when Zend Opcache Optimizer is fully enabled

2013-10-08 Thread brunobergot at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65845&edit=1

 ID: 65845
 Comment by: brunobergot at gmail dot com
 Reported by:bruno+php at ahennezel dot info
 Summary:Error when Zend Opcache Optimizer is fully enabled
 Status: Feedback
 Type:   Bug
 Package:opcache
 Operating System:   Linux 3.11.2-1-ARCH
 PHP Version:5.5.4
 Block user comment: N
 Private report: N

 New Comment:

Me again, here is a last test script that work without changing 
opcache.optimization_level :

APC BUG
<
// This should echo "tutu" string: >tutu<


function table_valeur($table, $cle, $defaut='') {
foreach (explode('/', $cle) as $k) {

$table = is_string($table) ? @unserialize($table) : $table;

if (is_object($table)) {
$table =  (($k !== "") and isset($table->$k)) ? $table->$k : 
$defaut;
} elseif (is_array($table)) {
$table = isset($table[$k]) ? $table[$k] : $defaut;
} else {
$table = $defaut;
}
}
return $table;
}

function vide($texte){
return "";
}

echo "This should echo empty string: 
>".vide($Pile['vars'][$zzz=(string)'toto'] = 'tutu')."<";
echo "This should echo \"tutu\" string: 
>".table_valeur($Pile['vars'],'toto')."<";

?>


Previous Comments:

[2013-10-08 10:30:33] brunobergot at gmail dot com

Hi again Laruence,

We found that the problem comes form the cast in $Pile['vars'][(string)'toto']. 
With this news test script it works as expected :

APC BUG
<
// This should echo "tutu" string: >tutu<

// Works as expected with opcache.optimization_level=0xffef in php.ini


function table_valeur($table, $cle, $defaut='') {
var_dump($table);
var_dump($cle);
var_dump($table[$cle]);
foreach (explode('/', $cle) as $k) {

$table = is_string($table) ? @unserialize($table) : $table;

if (is_object($table)) {
$table =  (($k !== "") and isset($table->$k)) ? $table->$k : 
$defaut;
} elseif (is_array($table)) {
$table = isset($table[$k]) ? $table[$k] : $defaut;
} else {
$table = $defaut;
}
}
return $table;
}

function vide($texte){
return "";
}

echo "This should echo empty string: >".vide($Pile['vars']['toto'] = 
'tutu')."<";
echo "This should echo \"tutu\" string: 
>".table_valeur($Pile['vars'],'toto')."<";

?>


[2013-10-08 10:17:30] brunobergot at gmail dot com

Hi Laurence,

Here is a script that show the bug in action :

APC BUG
<
// This should echo "tutu" string: >tutu<

// Works as expected with opcache.optimization_level=0xffef in php.ini


function table_valeur($table, $cle, $defaut='') {
foreach (explode('/', $cle) as $k) {

$table = is_string($table) ? @unserialize($table) : $table;

if (is_object($table)) {
$table =  (($k !== "") and isset($table->$k)) ? $table->$k : 
$defaut;
} elseif (is_array($table)) {
$table = isset($table[$k]) ? $table[$k] : $defaut;
} else {
$table = $defaut;
}
}
return $table;
}

function vide($texte){
return "";
}

echo "This should echo empty string: >".vide($Pile['vars'][(string)'toto'] = 
'tutu')."<";
echo "This should echo \"tutu\" string: 
>".table_valeur($Pile['vars'],'toto')."<";

?>


[2013-10-08 05:56:39] larue...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

hmm, are you able to get the compiled SPIP view file?  it must be a PHP script 
which can be used to reproduce this problem?


[2013-10-06 18:13:34] bruno+php at ahennezel dot info

Wrong package : Opcache


[2013-10-06 18:10:34] bruno+php at ahennezel dot info

Typo : With opcache.optimization_level=0xffef the result is "value".




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=65845


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65845&edit=1


Bug #65845 [Com]: Error when Zend Opcache Optimizer is fully enabled

2013-10-08 Thread brunobergot at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65845&edit=1

 ID: 65845
 Comment by: brunobergot at gmail dot com
 Reported by:bruno+php at ahennezel dot info
 Summary:Error when Zend Opcache Optimizer is fully enabled
 Status: Feedback
 Type:   Bug
 Package:opcache
 Operating System:   Linux 3.11.2-1-ARCH
 PHP Version:5.5.4
 Block user comment: N
 Private report: N

 New Comment:

Hi again Laruence,

We found that the problem comes form the cast in $Pile['vars'][(string)'toto']. 
With this news test script it works as expected :

APC BUG
<
// This should echo "tutu" string: >tutu<

// Works as expected with opcache.optimization_level=0xffef in php.ini


function table_valeur($table, $cle, $defaut='') {
var_dump($table);
var_dump($cle);
var_dump($table[$cle]);
foreach (explode('/', $cle) as $k) {

$table = is_string($table) ? @unserialize($table) : $table;

if (is_object($table)) {
$table =  (($k !== "") and isset($table->$k)) ? $table->$k : 
$defaut;
} elseif (is_array($table)) {
$table = isset($table[$k]) ? $table[$k] : $defaut;
} else {
$table = $defaut;
}
}
return $table;
}

function vide($texte){
return "";
}

echo "This should echo empty string: >".vide($Pile['vars']['toto'] = 
'tutu')."<";
echo "This should echo \"tutu\" string: 
>".table_valeur($Pile['vars'],'toto')."<";

?>


Previous Comments:

[2013-10-08 10:17:30] brunobergot at gmail dot com

Hi Laurence,

Here is a script that show the bug in action :

APC BUG
<
// This should echo "tutu" string: >tutu<

// Works as expected with opcache.optimization_level=0xffef in php.ini


function table_valeur($table, $cle, $defaut='') {
foreach (explode('/', $cle) as $k) {

$table = is_string($table) ? @unserialize($table) : $table;

if (is_object($table)) {
$table =  (($k !== "") and isset($table->$k)) ? $table->$k : 
$defaut;
} elseif (is_array($table)) {
$table = isset($table[$k]) ? $table[$k] : $defaut;
} else {
$table = $defaut;
}
}
return $table;
}

function vide($texte){
return "";
}

echo "This should echo empty string: >".vide($Pile['vars'][(string)'toto'] = 
'tutu')."<";
echo "This should echo \"tutu\" string: 
>".table_valeur($Pile['vars'],'toto')."<";

?>


[2013-10-08 05:56:39] larue...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

hmm, are you able to get the compiled SPIP view file?  it must be a PHP script 
which can be used to reproduce this problem?


[2013-10-06 18:13:34] bruno+php at ahennezel dot info

Wrong package : Opcache


[2013-10-06 18:10:34] bruno+php at ahennezel dot info

Typo : With opcache.optimization_level=0xffef the result is "value".


[2013-10-06 11:38:42] bruno+php at ahennezel dot info

Description:

With the SPIP CMS V3, the default optimization level 
opcache.optimization_level=0x
and 
opcache.optimization_level=0xffef
give different results.


Test script:
---
I dont know how to test directly in PHP, but here is a very short SPIP snippet 
which brings out the problem. Put in the SPIP's sommaire.html skeleton : 

#SET{var,value}
[(#GET{var})]

With opcache.optimization_level=0x the result is empty.
With opcache.optimization_level=0x the result is "value".








Expected result:

I expect the content "value"

Actual result:
--
The content is empty






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65845&edit=1


Bug #65845 [Com]: Error when Zend Opcache Optimizer is fully enabled

2013-10-08 Thread brunobergot at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=65845&edit=1

 ID: 65845
 Comment by: brunobergot at gmail dot com
 Reported by:bruno+php at ahennezel dot info
 Summary:Error when Zend Opcache Optimizer is fully enabled
 Status: Feedback
 Type:   Bug
 Package:opcache
 Operating System:   Linux 3.11.2-1-ARCH
 PHP Version:5.5.4
 Block user comment: N
 Private report: N

 New Comment:

Hi Laurence,

Here is a script that show the bug in action :

APC BUG
<
// This should echo "tutu" string: >tutu<

// Works as expected with opcache.optimization_level=0xffef in php.ini


function table_valeur($table, $cle, $defaut='') {
foreach (explode('/', $cle) as $k) {

$table = is_string($table) ? @unserialize($table) : $table;

if (is_object($table)) {
$table =  (($k !== "") and isset($table->$k)) ? $table->$k : 
$defaut;
} elseif (is_array($table)) {
$table = isset($table[$k]) ? $table[$k] : $defaut;
} else {
$table = $defaut;
}
}
return $table;
}

function vide($texte){
return "";
}

echo "This should echo empty string: >".vide($Pile['vars'][(string)'toto'] = 
'tutu')."<";
echo "This should echo \"tutu\" string: 
>".table_valeur($Pile['vars'],'toto')."<";

?>


Previous Comments:

[2013-10-08 05:56:39] larue...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

hmm, are you able to get the compiled SPIP view file?  it must be a PHP script 
which can be used to reproduce this problem?


[2013-10-06 18:13:34] bruno+php at ahennezel dot info

Wrong package : Opcache


[2013-10-06 18:10:34] bruno+php at ahennezel dot info

Typo : With opcache.optimization_level=0xffef the result is "value".


[2013-10-06 11:38:42] bruno+php at ahennezel dot info

Description:

With the SPIP CMS V3, the default optimization level 
opcache.optimization_level=0x
and 
opcache.optimization_level=0xffef
give different results.


Test script:
---
I dont know how to test directly in PHP, but here is a very short SPIP snippet 
which brings out the problem. Put in the SPIP's sommaire.html skeleton : 

#SET{var,value}
[(#GET{var})]

With opcache.optimization_level=0x the result is empty.
With opcache.optimization_level=0x the result is "value".








Expected result:

I expect the content "value"

Actual result:
--
The content is empty






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65845&edit=1