Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
N/A
-
Resolution: Fixed
-
Affects Version/s: 1.8.4
-
Fix Version/s: 1.9.0
-
Component/s: Zend_CodeGenerator
-
Labels:None
-
Tags:
Description
When I call something like:
require 'test.php';
$file = new Zend_Reflection_File('test.php');
$a = Zend_CodeGenerator_Php_File::fromReflection($file);
I'm receiving this message:
Warning: Illegal offset type in /usr/share/php/Zend/CodeGenerator/Php/Class.php on line 294
Call Stack:
0.0008 106028 1. {main}() /home/jayson/Projetos/PHP_Organizer/organizer.php:0
0.0279 948648 2. Zend_CodeGenerator_Php_File::fromReflection() /home/jayson/Projetos/PHP_Organizer/organizer.php:188
0.0319 1131984 3. Zend_CodeGenerator_Php_Class::fromReflection() /usr/share/php/Zend/CodeGenerator/Php/File.php:153
0.0323 1134216 4. Zend_CodeGenerator_Php_Class->setProperties() /usr/share/php/Zend/CodeGenerator/Php/Class.php:127
0.0323 1134288 5. Zend_CodeGenerator_Php_Class->setProperty() /usr/share/php/Zend/CodeGenerator/Php/Class.php:270
Warning: Illegal offset type in /usr/share/php/Zend/CodeGenerator/Php/Class.php on line 294
Call Stack:
0.0008 106028 1. {main}() /home/jayson/Projetos/PHP_Organizer/organizer.php:0
0.0279 948648 2. Zend_CodeGenerator_Php_File::fromReflection() /home/jayson/Projetos/PHP_Organizer/organizer.php:188
0.0319 1131984 3. Zend_CodeGenerator_Php_Class::fromReflection() /usr/share/php/Zend/CodeGenerator/Php/File.php:153
0.0323 1134216 4. Zend_CodeGenerator_Php_Class->setProperties() /usr/share/php/Zend/CodeGenerator/Php/Class.php:127
0.0324 1134360 5. Zend_CodeGenerator_Php_Class->setProperty() /usr/share/php/Zend/CodeGenerator/Php/Class.php:270
Warning: Illegal offset type in /usr/share/php/Zend/CodeGenerator/Php/Class.php on line 294
Call Stack:
0.0008 106028 1. {main}() /home/jayson/Projetos/PHP_Organizer/organizer.php:0
0.0279 948648 2. Zend_CodeGenerator_Php_File::fromReflection() /home/jayson/Projetos/PHP_Organizer/organizer.php:188
0.0319 1131984 3. Zend_CodeGenerator_Php_Class::fromReflection() /usr/share/php/Zend/CodeGenerator/Php/File.php:153
0.0323 1134216 4. Zend_CodeGenerator_Php_Class->setProperties() /usr/share/php/Zend/CodeGenerator/Php/Class.php:127
0.0325 1134360 5. Zend_CodeGenerator_Php_Class->setProperty() /usr/share/php/Zend/CodeGenerator/Php/Class.php:270
I tried others PHP files and that error occurs in all that.
Best Regards
Jayson Reis
I cannot reproduce this, are you running against trunk?
can you tell me what your test.php looks like?
my files look like this:
codegen.php
<?php error_reporting(E_ALL | E_STRICT); set_include_path('/Users/ralphschindler/Projects/ZFStandardTrunk/library'); require_once 'Zend/Reflection/File.php'; require_once 'Zend/CodeGenerator/Php/File.php'; require 'test.php'; $file = new Zend_Reflection_File('test.php'); $a = Zend_CodeGenerator_Php_File::fromReflection($file); echo $a->getClass()->getProperty('bar')->getDefaultValue()->getValue();test.php
~/tmp/test-codegenerator$ cat test.php <?php class Foo { public $bar = 5; }<?php error_reporting(E_ALL | E_STRICT); set_include_path('/Users/ralphschindler/Projects/ZFStandardTrunk/library'); require_once 'Zend/Reflection/File.php'; require_once 'Zend/CodeGenerator/Php/File.php'; require 'test.php'; $file = new Zend_Reflection_File('test.php'); $a = Zend_CodeGenerator_Php_File::fromReflection($file); echo $a->getClass()->getProperty('bar')->getDefaultValue()->getValue();~/tmp/test-codegenerator$ cat test.php <?php class Foo { public $bar = 5; }