Mantis - Quercus
Viewing Issue Advanced Details
1975 major always 08-26-07 03:57 09-19-07 07:38
kim  
ferg  
normal  
closed 3.1.3  
fixed  
none    
none 3.1.3  
0001975: isset() returns false on Spyc-parsed array datastructure
Spyc (http://spyc.sourceforge.net/) [^] is a YAML parser written in PHP heavily used by the Symfony Framework (http://www.symfony-project.com). [^] Due to the issue illustrated below, symfony does not start up.
YAML (foo.yml):

foo:
  bar: foobar


PHP:

require_once('/path/to/Spyc.class.php');

$spyc = new Spyc();
$yml = $spyc->load('foo.yml');

// outputs as expected:
// Array
//(
// [foo] => Array
// (
// [bar] => foobar
// )
//
//)
print_r($yml);

foreach ($yml as $category => $vals) {
        // outputs as expected:
        // Array
        // (
        // [bar] => foobar
        // )
    print_r($vals);

    if (!isset($vals["bar"])) {
                // should not get executed
        echo '$vals["bar"] is not set';
    }
}

Notes
(0002237)
kim   
08-26-07 04:00   
basically duplicate of 0001938
(0002303)
ferg   
09-19-07 07:38   
php/0i20