php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30102 Reflection API problems
Submitted: 2004-09-16 05:06 UTC Modified: 2004-09-17 00:36 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mark at ttzn dot nl Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.0.1 OS: win 2k sp4
Private report: No CVE-ID: None
 [2004-09-16 05:06 UTC] mark at ttzn dot nl
Description:
------------
When I wanted to test the reflection function in PHP5.0.1 I stumbled upon something strange. For some reason it gives me an error that I did not expect especially not from the example codes in the manual.

The error: Trying to clone an uncloneable object of class ReflectionFunction ... is quite strange ... Either I am doing something wrong or this is a real bug.

Please help me becouse I like to use the reflection API.

Reproduce code:
---------------
http://www.php.net/manual/en/language.oop5.reflection.php

Example 18-28. Using the ReflectionFunction class



Expected result:
----------------
Not the error

Actual result:
--------------
Fatal error: Trying to clone an uncloneable object of class ReflectionFunction in D:\hosted\stuff\test.php on line 15


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-16 05:24 UTC] mark at ttzn dot nl
This seems to only occur when zend.ze1_compatibility_mode is set to On.

Is this then still a bug or is it just me not understanding something?
 [2004-09-17 00:36 UTC] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Reflection API classes are not cloneable.

While in ze1 compat mode the engine tries to do so unless you assign by explicit reference.

=> just DON\'T MIX PHP 4 and PHP 5 specific functionality.
   Either specific 4 or specific 5 but not compat mode 
   and all new features of 5.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Feb 25 20:01:24 2021 UTC