php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #29307 The Reflection Information Is Incorrect
Submitted: 2004-07-21 16:42 UTC Modified: 2004-07-26 15:21 UTC
From: timothy dot may at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: timothy dot may at gmail dot com
New email:
PHP Version: OS:

 

 [2004-07-21 16:42 UTC] timothy dot may at gmail dot com
Description:
------------
http://www.php.net/zend-engine-2.php

When I scroll to the bottom of the page, I reviewed the changes and the addition of the reflection API.  I decided to test it out and see how it works.  The code used as an example there does not work.  The code pasted has underscores in them which was renamed somewhere in the beta process.  I wanted to alert you so you can keep your content correct.

As a side note, the zend page is also incorrect.

http://www.zend.com/php5/articles/engine2-php5-changes.php

Reproduce code:
---------------
<?php
class Foo {
   public $prop;
   function Func($name) {
       echo "Hello $name";
   }
}

reflectionclass::export('Foo');
reflectionobject::export(new Foo);
reflectionmethod::export('Foo', 'func');
reflectionproperty::export('Foo', 'prop');
reflectionextension::export('standard');
?> 

Expected result:
----------------
Class [  class Foo ] { @@ C:\web\Apache2\htdocs\test.php 2-7 - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [1] { Property [  public $prop ] } - Methods [1] { Method [  public method Func ] { @@ C:\web\Apache2\htdocs\test.php 4 - 6 - Parameters [1] { Parameter #0 [ $name ] } } } } Object of class [  class Foo ] { @@ C:\web\Apache2\htdocs\test.php 2-7 - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [1] { Property [  public $prop ] } - Dynamic properties [0] { } - Methods [1] { Method [  public method Func ] { @@ C:\web\Apache2\htdocs\test.php 4 - 6 - Parameters [1] { Parameter #0 [ $name ] } } } } Method [  public method Func ] { @@

etc...

Actual result:
--------------
Fatal error: Class 'reflection_class' not found in C:\web\Apache2\htdocs\test.php on line 9

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-26 15:21 UTC] nlopess@php.net
duplicate of #29130
 [2004-08-09 20:27 UTC] gpopmail at gmail dot com
Same problem here... 

Fatal error: Class 'reflection_class' not found in C:\apachefriends\xampp\htdocs\PHP\Delegate\index.php on line 9
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 00:01:28 2024 UTC