ZF-7184: Zend_CodeGenerator_Php_File::fromReflection receives Warning: Illegal offset type in...
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
Comments
Posted by Ralph Schindler (ralph) on 2009-07-10T09:34:20.000+0000
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
test.php
Posted by Jayson Santos dos Reis (jaysonsantos) on 2009-07-10T11:54:13.000+0000
Hello Ralph. I'm running against version 1.8.4. This is the code.
test.php <?php class Test { public $foo;
}
testReflection.php <?php require_once 'test.php'; require_once 'Zend/Reflection/File.php'; require_once 'Zend/CodeGenerator/Php/File.php'; Zend_CodeGenerator_Php_File::fromReflectedFileName('test.php');
Posted by Ralph Schindler (ralph) on 2009-07-10T15:31:43.000+0000
Can you try running against trunk? There have been new features over the past few weeks.
Posted by Jayson Santos dos Reis (jaysonsantos) on 2009-07-10T18:19:23.000+0000
Hello Ralph, running against trunk that work's fine. Do you know when that trunk will be release as stable ? Best Regards Jayson Reis
Posted by Benjamin Eberlei (beberlei) on 2009-09-18T07:39:40.000+0000
This seems to be fixed in 1.9