Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflection* classes should be uncloneable #61

Closed
asgrim opened this issue Jul 14, 2015 · 3 comments
Closed

Reflection* classes should be uncloneable #61

asgrim opened this issue Jul 14, 2015 · 3 comments

Comments

@asgrim
Copy link
Member

asgrim commented Jul 14, 2015

Reflection* classes should prevent being able to be cloned.

--TEST--
Reflection class can not be cloned
--CREDITS--
Stefan Koopmanschap <[email protected]>
TestFest PHP|Tek
--SKIPIF--
<?php
if (!extension_loaded('reflection')) print 'skip';
?>
--FILE-- 
<?php
require 'vendor/autoload.php';
use BetterReflection\Reflector\ClassReflector;
use BetterReflection\SourceLocator\SingleFileSourceLocator;
$reflector = new ClassReflector(new SingleFileSourceLocator(__FILE__));

class Foo {
}

$rc = $reflector->reflect("Foo");
$rc2 = clone($rc);
?>
--EXPECTF--
Fatal error: Uncaught Error: Trying to clone an uncloneable object of class ReflectionClass in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d
@Ocramius
Copy link
Member

@asgrim should they be? :|

@asgrim
Copy link
Member Author

asgrim commented Jul 14, 2015

seems that way...

@asgrim asgrim added this to the 1.0.0 milestone Aug 21, 2015
@asgrim asgrim removed this from the 1.0.0 milestone Aug 28, 2015
@asgrim asgrim added this to the 1.0.0 milestone Nov 2, 2015
asgrim added a commit that referenced this issue Nov 14, 2015
@asgrim asgrim self-assigned this Nov 18, 2015
@asgrim
Copy link
Member Author

asgrim commented Jan 7, 2016

Handled by #150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants